index.cjs 399 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926
  1. /*!
  2. Stencil Mock Doc (CommonJS) v4.20.0 | MIT Licensed | https://stenciljs.com
  3. */
  4. "use strict";
  5. var __defProp = Object.defineProperty;
  6. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  7. var __getOwnPropNames = Object.getOwnPropertyNames;
  8. var __hasOwnProp = Object.prototype.hasOwnProperty;
  9. var __export = (target, all) => {
  10. for (var name in all)
  11. __defProp(target, name, { get: all[name], enumerable: true });
  12. };
  13. var __copyProps = (to, from, except, desc) => {
  14. if (from && typeof from === "object" || typeof from === "function") {
  15. for (let key of __getOwnPropNames(from))
  16. if (!__hasOwnProp.call(to, key) && key !== except)
  17. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  18. }
  19. return to;
  20. };
  21. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  22. // src/mock-doc/index.ts
  23. var mock_doc_exports = {};
  24. __export(mock_doc_exports, {
  25. MockAttr: () => MockAttr,
  26. MockAttributeMap: () => MockAttributeMap,
  27. MockComment: () => MockComment,
  28. MockCustomEvent: () => MockCustomEvent,
  29. MockDocument: () => MockDocument,
  30. MockElement: () => MockElement,
  31. MockHTMLElement: () => MockHTMLElement,
  32. MockHeaders: () => MockHeaders,
  33. MockKeyboardEvent: () => MockKeyboardEvent,
  34. MockMouseEvent: () => MockMouseEvent,
  35. MockNode: () => MockNode2,
  36. MockRequest: () => MockRequest,
  37. MockResponse: () => MockResponse,
  38. MockTextNode: () => MockTextNode,
  39. MockWindow: () => MockWindow,
  40. NODE_TYPES: () => NODE_TYPES,
  41. cloneAttributes: () => cloneAttributes,
  42. cloneDocument: () => cloneDocument,
  43. cloneWindow: () => cloneWindow,
  44. constrainTimeouts: () => constrainTimeouts,
  45. createDocument: () => createDocument,
  46. createFragment: () => createFragment,
  47. parseHtmlToDocument: () => parseHtmlToDocument,
  48. parseHtmlToFragment: () => parseHtmlToFragment,
  49. patchWindow: () => patchWindow,
  50. resetDocument: () => resetDocument,
  51. serializeNodeToHtml: () => serializeNodeToHtml,
  52. setupGlobal: () => setupGlobal,
  53. teardownGlobal: () => teardownGlobal
  54. });
  55. module.exports = __toCommonJS(mock_doc_exports);
  56. // src/runtime/runtime-constants.ts
  57. var CONTENT_REF_ID = "r";
  58. var ORG_LOCATION_ID = "o";
  59. var SLOT_NODE_ID = "s";
  60. var TEXT_NODE_ID = "t";
  61. var XLINK_NS = "http://www.w3.org/1999/xlink";
  62. // src/mock-doc/attribute.ts
  63. var attrHandler = {
  64. get(obj, prop) {
  65. if (prop in obj) {
  66. return obj[prop];
  67. }
  68. if (typeof prop !== "symbol" && !isNaN(prop)) {
  69. return obj.__items[prop];
  70. }
  71. return void 0;
  72. }
  73. };
  74. var createAttributeProxy = (caseInsensitive) => new Proxy(new MockAttributeMap(caseInsensitive), attrHandler);
  75. var MockAttributeMap = class {
  76. constructor(caseInsensitive = false) {
  77. this.caseInsensitive = caseInsensitive;
  78. this.__items = [];
  79. }
  80. get length() {
  81. return this.__items.length;
  82. }
  83. item(index) {
  84. return this.__items[index] || null;
  85. }
  86. setNamedItem(attr) {
  87. attr.namespaceURI = null;
  88. this.setNamedItemNS(attr);
  89. }
  90. setNamedItemNS(attr) {
  91. if (attr != null && attr.value != null) {
  92. attr.value = String(attr.value);
  93. }
  94. const existingAttr = this.__items.find((a) => a.name === attr.name && a.namespaceURI === attr.namespaceURI);
  95. if (existingAttr != null) {
  96. existingAttr.value = attr.value;
  97. } else {
  98. this.__items.push(attr);
  99. }
  100. }
  101. getNamedItem(attrName) {
  102. if (this.caseInsensitive) {
  103. attrName = attrName.toLowerCase();
  104. }
  105. return this.getNamedItemNS(null, attrName);
  106. }
  107. getNamedItemNS(namespaceURI, attrName) {
  108. namespaceURI = getNamespaceURI(namespaceURI);
  109. return this.__items.find((attr) => attr.name === attrName && getNamespaceURI(attr.namespaceURI) === namespaceURI) || null;
  110. }
  111. removeNamedItem(attr) {
  112. this.removeNamedItemNS(attr);
  113. }
  114. removeNamedItemNS(attr) {
  115. for (let i = 0, ii = this.__items.length; i < ii; i++) {
  116. if (this.__items[i].name === attr.name && this.__items[i].namespaceURI === attr.namespaceURI) {
  117. this.__items.splice(i, 1);
  118. break;
  119. }
  120. }
  121. }
  122. [Symbol.iterator]() {
  123. let i = 0;
  124. return {
  125. next: () => ({
  126. done: i === this.length,
  127. value: this.item(i++)
  128. })
  129. };
  130. }
  131. get [Symbol.toStringTag]() {
  132. return "MockAttributeMap";
  133. }
  134. };
  135. function getNamespaceURI(namespaceURI) {
  136. return namespaceURI === XLINK_NS ? null : namespaceURI;
  137. }
  138. function cloneAttributes(srcAttrs, sortByName = false) {
  139. const dstAttrs = new MockAttributeMap(srcAttrs.caseInsensitive);
  140. if (srcAttrs != null) {
  141. const attrLen = srcAttrs.length;
  142. if (sortByName && attrLen > 1) {
  143. const sortedAttrs = [];
  144. for (let i = 0; i < attrLen; i++) {
  145. const srcAttr = srcAttrs.item(i);
  146. const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
  147. sortedAttrs.push(dstAttr);
  148. }
  149. sortedAttrs.sort(sortAttributes).forEach((attr) => {
  150. dstAttrs.setNamedItemNS(attr);
  151. });
  152. } else {
  153. for (let i = 0; i < attrLen; i++) {
  154. const srcAttr = srcAttrs.item(i);
  155. const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
  156. dstAttrs.setNamedItemNS(dstAttr);
  157. }
  158. }
  159. }
  160. return dstAttrs;
  161. }
  162. function sortAttributes(a, b) {
  163. if (a.name < b.name) return -1;
  164. if (a.name > b.name) return 1;
  165. return 0;
  166. }
  167. var MockAttr = class {
  168. constructor(attrName, attrValue, namespaceURI = null) {
  169. this._name = attrName;
  170. this._value = String(attrValue);
  171. this._namespaceURI = namespaceURI;
  172. }
  173. get name() {
  174. return this._name;
  175. }
  176. set name(value) {
  177. this._name = value;
  178. }
  179. get value() {
  180. return this._value;
  181. }
  182. set value(value) {
  183. this._value = String(value);
  184. }
  185. get nodeName() {
  186. return this._name;
  187. }
  188. set nodeName(value) {
  189. this._name = value;
  190. }
  191. get nodeValue() {
  192. return this._value;
  193. }
  194. set nodeValue(value) {
  195. this._value = String(value);
  196. }
  197. get namespaceURI() {
  198. return this._namespaceURI;
  199. }
  200. set namespaceURI(namespaceURI) {
  201. this._namespaceURI = namespaceURI;
  202. }
  203. };
  204. // src/mock-doc/constants.ts
  205. var NODE_TYPES = /* @__PURE__ */ ((NODE_TYPES2) => {
  206. NODE_TYPES2[NODE_TYPES2["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
  207. NODE_TYPES2[NODE_TYPES2["ATTRIBUTE_NODE"] = 2] = "ATTRIBUTE_NODE";
  208. NODE_TYPES2[NODE_TYPES2["TEXT_NODE"] = 3] = "TEXT_NODE";
  209. NODE_TYPES2[NODE_TYPES2["CDATA_SECTION_NODE"] = 4] = "CDATA_SECTION_NODE";
  210. NODE_TYPES2[NODE_TYPES2["ENTITY_REFERENCE_NODE"] = 5] = "ENTITY_REFERENCE_NODE";
  211. NODE_TYPES2[NODE_TYPES2["ENTITY_NODE"] = 6] = "ENTITY_NODE";
  212. NODE_TYPES2[NODE_TYPES2["PROCESSING_INSTRUCTION_NODE"] = 7] = "PROCESSING_INSTRUCTION_NODE";
  213. NODE_TYPES2[NODE_TYPES2["COMMENT_NODE"] = 8] = "COMMENT_NODE";
  214. NODE_TYPES2[NODE_TYPES2["DOCUMENT_NODE"] = 9] = "DOCUMENT_NODE";
  215. NODE_TYPES2[NODE_TYPES2["DOCUMENT_TYPE_NODE"] = 10] = "DOCUMENT_TYPE_NODE";
  216. NODE_TYPES2[NODE_TYPES2["DOCUMENT_FRAGMENT_NODE"] = 11] = "DOCUMENT_FRAGMENT_NODE";
  217. NODE_TYPES2[NODE_TYPES2["NOTATION_NODE"] = 12] = "NOTATION_NODE";
  218. return NODE_TYPES2;
  219. })(NODE_TYPES || {});
  220. // src/mock-doc/class-list.ts
  221. var MockClassList = class {
  222. constructor(elm) {
  223. this.elm = elm;
  224. }
  225. add(...classNames) {
  226. const clsNames = getItems(this.elm);
  227. let updated = false;
  228. classNames.forEach((className) => {
  229. className = String(className);
  230. validateClass(className);
  231. if (clsNames.includes(className) === false) {
  232. clsNames.push(className);
  233. updated = true;
  234. }
  235. });
  236. if (updated) {
  237. this.elm.setAttributeNS(null, "class", clsNames.join(" "));
  238. }
  239. }
  240. remove(...classNames) {
  241. const clsNames = getItems(this.elm);
  242. let updated = false;
  243. classNames.forEach((className) => {
  244. className = String(className);
  245. validateClass(className);
  246. const index = clsNames.indexOf(className);
  247. if (index > -1) {
  248. clsNames.splice(index, 1);
  249. updated = true;
  250. }
  251. });
  252. if (updated) {
  253. this.elm.setAttributeNS(null, "class", clsNames.filter((c) => c.length > 0).join(" "));
  254. }
  255. }
  256. contains(className) {
  257. className = String(className);
  258. return getItems(this.elm).includes(className);
  259. }
  260. toggle(className) {
  261. className = String(className);
  262. if (this.contains(className) === true) {
  263. this.remove(className);
  264. } else {
  265. this.add(className);
  266. }
  267. }
  268. get length() {
  269. return getItems(this.elm).length;
  270. }
  271. item(index) {
  272. return getItems(this.elm)[index];
  273. }
  274. toString() {
  275. return getItems(this.elm).join(" ");
  276. }
  277. };
  278. function validateClass(className) {
  279. if (className === "") {
  280. throw new Error("The token provided must not be empty.");
  281. }
  282. if (/\s/.test(className)) {
  283. throw new Error(
  284. `The token provided ('${className}') contains HTML space characters, which are not valid in tokens.`
  285. );
  286. }
  287. }
  288. function getItems(elm) {
  289. const className = elm.getAttribute("class");
  290. if (typeof className === "string" && className.length > 0) {
  291. return className.trim().split(" ").filter((c) => c.length > 0);
  292. }
  293. return [];
  294. }
  295. // src/mock-doc/css-style-declaration.ts
  296. var MockCSSStyleDeclaration = class {
  297. constructor() {
  298. this._styles = /* @__PURE__ */ new Map();
  299. }
  300. setProperty(prop, value) {
  301. prop = jsCaseToCssCase(prop);
  302. if (value == null || value === "") {
  303. this._styles.delete(prop);
  304. } else {
  305. this._styles.set(prop, String(value));
  306. }
  307. }
  308. getPropertyValue(prop) {
  309. prop = jsCaseToCssCase(prop);
  310. return String(this._styles.get(prop) || "");
  311. }
  312. removeProperty(prop) {
  313. prop = jsCaseToCssCase(prop);
  314. this._styles.delete(prop);
  315. }
  316. get length() {
  317. return this._styles.size;
  318. }
  319. get cssText() {
  320. const cssText = [];
  321. this._styles.forEach((value, prop) => {
  322. cssText.push(`${prop}: ${value};`);
  323. });
  324. return cssText.join(" ").trim();
  325. }
  326. set cssText(cssText) {
  327. if (cssText == null || cssText === "") {
  328. this._styles.clear();
  329. return;
  330. }
  331. cssText.split(";").forEach((rule) => {
  332. rule = rule.trim();
  333. if (rule.length > 0) {
  334. const splt = rule.split(":");
  335. if (splt.length > 1) {
  336. const prop = splt[0].trim();
  337. const value = splt.slice(1).join(":").trim();
  338. if (prop !== "" && value !== "") {
  339. this._styles.set(jsCaseToCssCase(prop), value);
  340. }
  341. }
  342. }
  343. });
  344. }
  345. };
  346. function createCSSStyleDeclaration() {
  347. return new Proxy(new MockCSSStyleDeclaration(), cssProxyHandler);
  348. }
  349. var cssProxyHandler = {
  350. get(cssStyle, prop) {
  351. if (prop in cssStyle) {
  352. return cssStyle[prop];
  353. }
  354. prop = cssCaseToJsCase(prop);
  355. return cssStyle.getPropertyValue(prop);
  356. },
  357. set(cssStyle, prop, value) {
  358. if (prop in cssStyle) {
  359. cssStyle[prop] = value;
  360. } else {
  361. cssStyle.setProperty(prop, value);
  362. }
  363. return true;
  364. }
  365. };
  366. function cssCaseToJsCase(str) {
  367. if (str.length > 1 && str.includes("-") === true) {
  368. str = str.toLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join("");
  369. str = str.slice(0, 1).toLowerCase() + str.slice(1);
  370. }
  371. return str;
  372. }
  373. function jsCaseToCssCase(str) {
  374. if (str.length > 1 && str.includes("-") === false && /[A-Z]/.test(str) === true) {
  375. str = str.replace(/([A-Z])/g, (g) => " " + g[0]).trim().replace(/ /g, "-").toLowerCase();
  376. }
  377. return str;
  378. }
  379. // src/mock-doc/custom-element-registry.ts
  380. var MockCustomElementRegistry = class {
  381. constructor(win) {
  382. this.win = win;
  383. }
  384. define(tagName, cstr, options) {
  385. if (tagName.toLowerCase() !== tagName) {
  386. throw new Error(
  387. `Failed to execute 'define' on 'CustomElementRegistry': "${tagName}" is not a valid custom element name`
  388. );
  389. }
  390. if (this.__registry == null) {
  391. this.__registry = /* @__PURE__ */ new Map();
  392. }
  393. this.__registry.set(tagName, { cstr, options });
  394. if (this.__whenDefined != null) {
  395. const whenDefinedResolveFns = this.__whenDefined.get(tagName);
  396. if (whenDefinedResolveFns != null) {
  397. whenDefinedResolveFns.forEach((whenDefinedResolveFn) => {
  398. whenDefinedResolveFn();
  399. });
  400. whenDefinedResolveFns.length = 0;
  401. this.__whenDefined.delete(tagName);
  402. }
  403. }
  404. const doc = this.win.document;
  405. if (doc != null) {
  406. const hosts = doc.querySelectorAll(tagName);
  407. hosts.forEach((host) => {
  408. if (upgradedElements.has(host) === false) {
  409. tempDisableCallbacks.add(doc);
  410. const upgradedCmp = createCustomElement(this, doc, tagName);
  411. for (let i = 0; i < host.childNodes.length; i++) {
  412. const childNode = host.childNodes[i];
  413. childNode.remove();
  414. upgradedCmp.appendChild(childNode);
  415. }
  416. tempDisableCallbacks.delete(doc);
  417. if (proxyElements.has(host)) {
  418. proxyElements.set(host, upgradedCmp);
  419. }
  420. }
  421. fireConnectedCallback(host);
  422. });
  423. }
  424. }
  425. get(tagName) {
  426. if (this.__registry != null) {
  427. const def = this.__registry.get(tagName.toLowerCase());
  428. if (def != null) {
  429. return def.cstr;
  430. }
  431. }
  432. return void 0;
  433. }
  434. getName(cstr) {
  435. for (const [tagName, def] of this.__registry.entries()) {
  436. if (def.cstr === cstr) {
  437. return tagName;
  438. }
  439. }
  440. return void 0;
  441. }
  442. upgrade(_rootNode) {
  443. }
  444. clear() {
  445. if (this.__registry != null) {
  446. this.__registry.clear();
  447. }
  448. if (this.__whenDefined != null) {
  449. this.__whenDefined.clear();
  450. }
  451. }
  452. whenDefined(tagName) {
  453. tagName = tagName.toLowerCase();
  454. if (this.__registry != null && this.__registry.has(tagName) === true) {
  455. return Promise.resolve(this.__registry.get(tagName).cstr);
  456. }
  457. return new Promise((resolve) => {
  458. if (this.__whenDefined == null) {
  459. this.__whenDefined = /* @__PURE__ */ new Map();
  460. }
  461. let whenDefinedResolveFns = this.__whenDefined.get(tagName);
  462. if (whenDefinedResolveFns == null) {
  463. whenDefinedResolveFns = [];
  464. this.__whenDefined.set(tagName, whenDefinedResolveFns);
  465. }
  466. whenDefinedResolveFns.push(resolve);
  467. });
  468. }
  469. };
  470. function createCustomElement(customElements, ownerDocument, tagName) {
  471. const Cstr = customElements.get(tagName);
  472. if (Cstr != null) {
  473. const cmp = new Cstr(ownerDocument);
  474. cmp.nodeName = tagName.toUpperCase();
  475. upgradedElements.add(cmp);
  476. return cmp;
  477. }
  478. const host = new Proxy(
  479. {},
  480. {
  481. get(obj, prop) {
  482. const elm2 = proxyElements.get(host);
  483. if (elm2 != null) {
  484. return elm2[prop];
  485. }
  486. return obj[prop];
  487. },
  488. set(obj, prop, val) {
  489. const elm2 = proxyElements.get(host);
  490. if (elm2 != null) {
  491. elm2[prop] = val;
  492. } else {
  493. obj[prop] = val;
  494. }
  495. return true;
  496. },
  497. has(obj, prop) {
  498. const elm2 = proxyElements.get(host);
  499. if (prop in elm2) {
  500. return true;
  501. }
  502. if (prop in obj) {
  503. return true;
  504. }
  505. return false;
  506. }
  507. }
  508. );
  509. const elm = new MockHTMLElement(ownerDocument, tagName);
  510. proxyElements.set(host, elm);
  511. return host;
  512. }
  513. var proxyElements = /* @__PURE__ */ new WeakMap();
  514. var upgradedElements = /* @__PURE__ */ new WeakSet();
  515. function connectNode(ownerDocument, node) {
  516. node.ownerDocument = ownerDocument;
  517. if (node.nodeType === 1 /* ELEMENT_NODE */) {
  518. if (ownerDocument != null && node.nodeName.includes("-")) {
  519. const win = ownerDocument.defaultView;
  520. if (win != null && typeof node.connectedCallback === "function" && node.isConnected) {
  521. fireConnectedCallback(node);
  522. }
  523. const shadowRoot = node.shadowRoot;
  524. if (shadowRoot != null) {
  525. shadowRoot.childNodes.forEach((childNode) => {
  526. connectNode(ownerDocument, childNode);
  527. });
  528. }
  529. }
  530. node.childNodes.forEach((childNode) => {
  531. connectNode(ownerDocument, childNode);
  532. });
  533. } else {
  534. node.childNodes.forEach((childNode) => {
  535. childNode.ownerDocument = ownerDocument;
  536. });
  537. }
  538. }
  539. function fireConnectedCallback(node) {
  540. if (typeof node.connectedCallback === "function") {
  541. if (tempDisableCallbacks.has(node.ownerDocument) === false) {
  542. try {
  543. node.connectedCallback();
  544. } catch (e2) {
  545. console.error(e2);
  546. }
  547. }
  548. }
  549. }
  550. function disconnectNode(node) {
  551. if (node.nodeType === 1 /* ELEMENT_NODE */) {
  552. if (node.nodeName.includes("-") === true && typeof node.disconnectedCallback === "function") {
  553. if (tempDisableCallbacks.has(node.ownerDocument) === false) {
  554. try {
  555. node.disconnectedCallback();
  556. } catch (e2) {
  557. console.error(e2);
  558. }
  559. }
  560. }
  561. node.childNodes.forEach(disconnectNode);
  562. }
  563. }
  564. function attributeChanged(node, attrName, oldValue, newValue) {
  565. attrName = attrName.toLowerCase();
  566. const observedAttributes = node.constructor.observedAttributes;
  567. if (Array.isArray(observedAttributes) === true && observedAttributes.some((obs) => obs.toLowerCase() === attrName) === true) {
  568. try {
  569. node.attributeChangedCallback(attrName, oldValue, newValue);
  570. } catch (e2) {
  571. console.error(e2);
  572. }
  573. }
  574. }
  575. function checkAttributeChanged(node) {
  576. return node.nodeName.includes("-") === true && typeof node.attributeChangedCallback === "function";
  577. }
  578. var tempDisableCallbacks = /* @__PURE__ */ new Set();
  579. // src/mock-doc/dataset.ts
  580. function dataset(elm) {
  581. const ds = {};
  582. const attributes = elm.attributes;
  583. const attrLen = attributes.length;
  584. for (let i = 0; i < attrLen; i++) {
  585. const attr = attributes.item(i);
  586. const nodeName = attr.nodeName;
  587. if (nodeName.startsWith("data-")) {
  588. ds[dashToPascalCase(nodeName)] = attr.nodeValue;
  589. }
  590. }
  591. return new Proxy(ds, {
  592. get(_obj, camelCaseProp) {
  593. return ds[camelCaseProp];
  594. },
  595. set(_obj, camelCaseProp, value) {
  596. const dataAttr = toDataAttribute(camelCaseProp);
  597. elm.setAttribute(dataAttr, value);
  598. return true;
  599. }
  600. });
  601. }
  602. function toDataAttribute(str) {
  603. return "data-" + String(str).replace(/([A-Z0-9])/g, (g) => " " + g[0]).trim().replace(/ /g, "-").toLowerCase();
  604. }
  605. function dashToPascalCase(str) {
  606. str = String(str).slice(5);
  607. return str.split("-").map((segment, index) => {
  608. if (index === 0) {
  609. return segment.charAt(0).toLowerCase() + segment.slice(1);
  610. }
  611. return segment.charAt(0).toUpperCase() + segment.slice(1);
  612. }).join("");
  613. }
  614. // src/mock-doc/event.ts
  615. var MockEvent = class {
  616. constructor(type, eventInitDict) {
  617. this.bubbles = false;
  618. this.cancelBubble = false;
  619. this.cancelable = false;
  620. this.composed = false;
  621. this.currentTarget = null;
  622. this.defaultPrevented = false;
  623. this.srcElement = null;
  624. this.target = null;
  625. if (typeof type !== "string") {
  626. throw new Error(`Event type required`);
  627. }
  628. this.type = type;
  629. this.timeStamp = Date.now();
  630. if (eventInitDict != null) {
  631. Object.assign(this, eventInitDict);
  632. }
  633. }
  634. preventDefault() {
  635. this.defaultPrevented = true;
  636. }
  637. stopPropagation() {
  638. this.cancelBubble = true;
  639. }
  640. stopImmediatePropagation() {
  641. this.cancelBubble = true;
  642. }
  643. /**
  644. * @ref https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
  645. * @returns a composed path of the event
  646. */
  647. composedPath() {
  648. const composedPath = [];
  649. let currentElement = this.target;
  650. while (currentElement) {
  651. composedPath.push(currentElement);
  652. if (!currentElement.parentElement && currentElement.nodeName === "#document" /* DOCUMENT_NODE */) {
  653. composedPath.push(currentElement.defaultView);
  654. break;
  655. }
  656. if (currentElement.parentElement == null && currentElement.tagName === "HTML") {
  657. currentElement = currentElement.ownerDocument;
  658. } else {
  659. currentElement = currentElement.parentElement;
  660. }
  661. }
  662. return composedPath;
  663. }
  664. };
  665. var MockCustomEvent = class extends MockEvent {
  666. constructor(type, customEventInitDic) {
  667. super(type);
  668. this.detail = null;
  669. if (customEventInitDic != null) {
  670. Object.assign(this, customEventInitDic);
  671. }
  672. }
  673. };
  674. var MockKeyboardEvent = class extends MockEvent {
  675. constructor(type, keyboardEventInitDic) {
  676. super(type);
  677. this.code = "";
  678. this.key = "";
  679. this.altKey = false;
  680. this.ctrlKey = false;
  681. this.metaKey = false;
  682. this.shiftKey = false;
  683. this.location = 0;
  684. this.repeat = false;
  685. if (keyboardEventInitDic != null) {
  686. Object.assign(this, keyboardEventInitDic);
  687. }
  688. }
  689. };
  690. var MockMouseEvent = class extends MockEvent {
  691. constructor(type, mouseEventInitDic) {
  692. super(type);
  693. this.screenX = 0;
  694. this.screenY = 0;
  695. this.clientX = 0;
  696. this.clientY = 0;
  697. this.ctrlKey = false;
  698. this.shiftKey = false;
  699. this.altKey = false;
  700. this.metaKey = false;
  701. this.button = 0;
  702. this.buttons = 0;
  703. this.relatedTarget = null;
  704. if (mouseEventInitDic != null) {
  705. Object.assign(this, mouseEventInitDic);
  706. }
  707. }
  708. };
  709. var MockUIEvent = class extends MockEvent {
  710. constructor(type, uiEventInitDic) {
  711. super(type);
  712. this.detail = null;
  713. this.view = null;
  714. if (uiEventInitDic != null) {
  715. Object.assign(this, uiEventInitDic);
  716. }
  717. }
  718. };
  719. var MockFocusEvent = class extends MockUIEvent {
  720. constructor(type, focusEventInitDic) {
  721. super(type);
  722. this.relatedTarget = null;
  723. if (focusEventInitDic != null) {
  724. Object.assign(this, focusEventInitDic);
  725. }
  726. }
  727. };
  728. var MockEventListener = class {
  729. constructor(type, handler) {
  730. this.type = type;
  731. this.handler = handler;
  732. }
  733. };
  734. function addEventListener(elm, type, handler) {
  735. const target = elm;
  736. if (target.__listeners == null) {
  737. target.__listeners = [];
  738. }
  739. target.__listeners.push(new MockEventListener(type, handler));
  740. }
  741. function removeEventListener(elm, type, handler) {
  742. const target = elm;
  743. if (target != null && Array.isArray(target.__listeners) === true) {
  744. const elmListener = target.__listeners.find((e2) => e2.type === type && e2.handler === handler);
  745. if (elmListener != null) {
  746. const index = target.__listeners.indexOf(elmListener);
  747. target.__listeners.splice(index, 1);
  748. }
  749. }
  750. }
  751. function resetEventListeners(target) {
  752. if (target != null && target.__listeners != null) {
  753. target.__listeners = null;
  754. }
  755. }
  756. function triggerEventListener(elm, ev) {
  757. if (elm == null || ev.cancelBubble === true) {
  758. return;
  759. }
  760. const target = elm;
  761. ev.currentTarget = elm;
  762. if (Array.isArray(target.__listeners) === true) {
  763. const listeners = target.__listeners.filter((e2) => e2.type === ev.type);
  764. listeners.forEach((listener) => {
  765. try {
  766. listener.handler.call(target, ev);
  767. } catch (err) {
  768. console.error(err);
  769. }
  770. });
  771. }
  772. if (ev.bubbles === false) {
  773. return;
  774. }
  775. if (elm.nodeName === "#document" /* DOCUMENT_NODE */) {
  776. triggerEventListener(elm.defaultView, ev);
  777. } else if (elm.parentElement == null && elm.tagName === "HTML") {
  778. triggerEventListener(elm.ownerDocument, ev);
  779. } else {
  780. triggerEventListener(elm.parentElement, ev);
  781. }
  782. }
  783. function dispatchEvent(currentTarget, ev) {
  784. ev.target = currentTarget;
  785. triggerEventListener(currentTarget, ev);
  786. return true;
  787. }
  788. // scripts/build/parse5-7_1_2-bundle-cache.min.js
  789. var e = function(e2) {
  790. const t = /* @__PURE__ */ new Set([65534, 65535, 131070, 131071, 196606, 196607, 262142, 262143, 327678, 327679, 393214, 393215, 458750, 458751, 524286, 524287, 589822, 589823, 655358, 655359, 720894, 720895, 786430, 786431, 851966, 851967, 917502, 917503, 983038, 983039, 1048574, 1048575, 1114110, 1114111]), s = "\uFFFD";
  791. var a;
  792. !function(e3) {
  793. e3[e3.EOF = -1] = "EOF", e3[e3.NULL = 0] = "NULL", e3[e3.TABULATION = 9] = "TABULATION", e3[e3.CARRIAGE_RETURN = 13] = "CARRIAGE_RETURN", e3[e3.LINE_FEED = 10] = "LINE_FEED", e3[e3.FORM_FEED = 12] = "FORM_FEED", e3[e3.SPACE = 32] = "SPACE", e3[e3.EXCLAMATION_MARK = 33] = "EXCLAMATION_MARK", e3[e3.QUOTATION_MARK = 34] = "QUOTATION_MARK", e3[e3.NUMBER_SIGN = 35] = "NUMBER_SIGN", e3[e3.AMPERSAND = 38] = "AMPERSAND", e3[e3.APOSTROPHE = 39] = "APOSTROPHE", e3[e3.HYPHEN_MINUS = 45] = "HYPHEN_MINUS", e3[e3.SOLIDUS = 47] = "SOLIDUS", e3[e3.DIGIT_0 = 48] = "DIGIT_0", e3[e3.DIGIT_9 = 57] = "DIGIT_9", e3[e3.SEMICOLON = 59] = "SEMICOLON", e3[e3.LESS_THAN_SIGN = 60] = "LESS_THAN_SIGN", e3[e3.EQUALS_SIGN = 61] = "EQUALS_SIGN", e3[e3.GREATER_THAN_SIGN = 62] = "GREATER_THAN_SIGN", e3[e3.QUESTION_MARK = 63] = "QUESTION_MARK", e3[e3.LATIN_CAPITAL_A = 65] = "LATIN_CAPITAL_A", e3[e3.LATIN_CAPITAL_F = 70] = "LATIN_CAPITAL_F", e3[e3.LATIN_CAPITAL_X = 88] = "LATIN_CAPITAL_X", e3[e3.LATIN_CAPITAL_Z = 90] = "LATIN_CAPITAL_Z", e3[e3.RIGHT_SQUARE_BRACKET = 93] = "RIGHT_SQUARE_BRACKET", e3[e3.GRAVE_ACCENT = 96] = "GRAVE_ACCENT", e3[e3.LATIN_SMALL_A = 97] = "LATIN_SMALL_A", e3[e3.LATIN_SMALL_F = 102] = "LATIN_SMALL_F", e3[e3.LATIN_SMALL_X = 120] = "LATIN_SMALL_X", e3[e3.LATIN_SMALL_Z = 122] = "LATIN_SMALL_Z", e3[e3.REPLACEMENT_CHARACTER = 65533] = "REPLACEMENT_CHARACTER";
  794. }(a = a || (a = {}));
  795. const r = "[CDATA[", n = "doctype", i = "script";
  796. function o(e3) {
  797. return e3 >= 55296 && e3 <= 57343;
  798. }
  799. function c(e3) {
  800. return 32 !== e3 && 10 !== e3 && 13 !== e3 && 9 !== e3 && 12 !== e3 && e3 >= 1 && e3 <= 31 || e3 >= 127 && e3 <= 159;
  801. }
  802. function E(e3) {
  803. return e3 >= 64976 && e3 <= 65007 || t.has(e3);
  804. }
  805. var T, h;
  806. !function(e3) {
  807. e3.controlCharacterInInputStream = "control-character-in-input-stream", e3.noncharacterInInputStream = "noncharacter-in-input-stream", e3.surrogateInInputStream = "surrogate-in-input-stream", e3.nonVoidHtmlElementStartTagWithTrailingSolidus = "non-void-html-element-start-tag-with-trailing-solidus", e3.endTagWithAttributes = "end-tag-with-attributes", e3.endTagWithTrailingSolidus = "end-tag-with-trailing-solidus", e3.unexpectedSolidusInTag = "unexpected-solidus-in-tag", e3.unexpectedNullCharacter = "unexpected-null-character", e3.unexpectedQuestionMarkInsteadOfTagName = "unexpected-question-mark-instead-of-tag-name", e3.invalidFirstCharacterOfTagName = "invalid-first-character-of-tag-name", e3.unexpectedEqualsSignBeforeAttributeName = "unexpected-equals-sign-before-attribute-name", e3.missingEndTagName = "missing-end-tag-name", e3.unexpectedCharacterInAttributeName = "unexpected-character-in-attribute-name", e3.unknownNamedCharacterReference = "unknown-named-character-reference", e3.missingSemicolonAfterCharacterReference = "missing-semicolon-after-character-reference", e3.unexpectedCharacterAfterDoctypeSystemIdentifier = "unexpected-character-after-doctype-system-identifier", e3.unexpectedCharacterInUnquotedAttributeValue = "unexpected-character-in-unquoted-attribute-value", e3.eofBeforeTagName = "eof-before-tag-name", e3.eofInTag = "eof-in-tag", e3.missingAttributeValue = "missing-attribute-value", e3.missingWhitespaceBetweenAttributes = "missing-whitespace-between-attributes", e3.missingWhitespaceAfterDoctypePublicKeyword = "missing-whitespace-after-doctype-public-keyword", e3.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = "missing-whitespace-between-doctype-public-and-system-identifiers", e3.missingWhitespaceAfterDoctypeSystemKeyword = "missing-whitespace-after-doctype-system-keyword", e3.missingQuoteBeforeDoctypePublicIdentifier = "missing-quote-before-doctype-public-identifier", e3.missingQuoteBeforeDoctypeSystemIdentifier = "missing-quote-before-doctype-system-identifier", e3.missingDoctypePublicIdentifier = "missing-doctype-public-identifier", e3.missingDoctypeSystemIdentifier = "missing-doctype-system-identifier", e3.abruptDoctypePublicIdentifier = "abrupt-doctype-public-identifier", e3.abruptDoctypeSystemIdentifier = "abrupt-doctype-system-identifier", e3.cdataInHtmlContent = "cdata-in-html-content", e3.incorrectlyOpenedComment = "incorrectly-opened-comment", e3.eofInScriptHtmlCommentLikeText = "eof-in-script-html-comment-like-text", e3.eofInDoctype = "eof-in-doctype", e3.nestedComment = "nested-comment", e3.abruptClosingOfEmptyComment = "abrupt-closing-of-empty-comment", e3.eofInComment = "eof-in-comment", e3.incorrectlyClosedComment = "incorrectly-closed-comment", e3.eofInCdata = "eof-in-cdata", e3.absenceOfDigitsInNumericCharacterReference = "absence-of-digits-in-numeric-character-reference", e3.nullCharacterReference = "null-character-reference", e3.surrogateCharacterReference = "surrogate-character-reference", e3.characterReferenceOutsideUnicodeRange = "character-reference-outside-unicode-range", e3.controlCharacterReference = "control-character-reference", e3.noncharacterCharacterReference = "noncharacter-character-reference", e3.missingWhitespaceBeforeDoctypeName = "missing-whitespace-before-doctype-name", e3.missingDoctypeName = "missing-doctype-name", e3.invalidCharacterSequenceAfterDoctypeName = "invalid-character-sequence-after-doctype-name", e3.duplicateAttribute = "duplicate-attribute", e3.nonConformingDoctype = "non-conforming-doctype", e3.missingDoctype = "missing-doctype", e3.misplacedDoctype = "misplaced-doctype", e3.endTagWithoutMatchingOpenElement = "end-tag-without-matching-open-element", e3.closingOfElementWithOpenChildElements = "closing-of-element-with-open-child-elements", e3.disallowedContentInNoscriptInHead = "disallowed-content-in-noscript-in-head", e3.openElementsLeftAfterEof = "open-elements-left-after-eof", e3.abandonedHeadElementChild = "abandoned-head-element-child", e3.misplacedStartTagForHeadElement = "misplaced-start-tag-for-head-element", e3.nestedNoscriptInHead = "nested-noscript-in-head", e3.eofInElementThatCanContainOnlyText = "eof-in-element-that-can-contain-only-text";
  808. }(T = T || (T = {}));
  809. class _ {
  810. constructor(e3) {
  811. this.handler = e3, this.html = "", this.pos = -1, this.lastGapPos = -2, this.gapStack = [], this.skipNextNewLine = false, this.lastChunkWritten = false, this.endOfChunkHit = false, this.bufferWaterline = 65536, this.isEol = false, this.lineStartPos = 0, this.droppedBufferSize = 0, this.line = 1, this.lastErrOffset = -1;
  812. }
  813. get col() {
  814. return this.pos - this.lineStartPos + Number(this.lastGapPos !== this.pos);
  815. }
  816. get offset() {
  817. return this.droppedBufferSize + this.pos;
  818. }
  819. getError(e3) {
  820. const { line: t2, col: s2, offset: a2 } = this;
  821. return { code: e3, startLine: t2, endLine: t2, startCol: s2, endCol: s2, startOffset: a2, endOffset: a2 };
  822. }
  823. _err(e3) {
  824. this.handler.onParseError && this.lastErrOffset !== this.offset && (this.lastErrOffset = this.offset, this.handler.onParseError(this.getError(e3)));
  825. }
  826. _addGap() {
  827. this.gapStack.push(this.lastGapPos), this.lastGapPos = this.pos;
  828. }
  829. _processSurrogate(e3) {
  830. if (this.pos !== this.html.length - 1) {
  831. const t2 = this.html.charCodeAt(this.pos + 1);
  832. if (function(e4) {
  833. return e4 >= 56320 && e4 <= 57343;
  834. }(t2)) return this.pos++, this._addGap(), 1024 * (e3 - 55296) + 9216 + t2;
  835. } else if (!this.lastChunkWritten) return this.endOfChunkHit = true, a.EOF;
  836. return this._err(T.surrogateInInputStream), e3;
  837. }
  838. willDropParsedChunk() {
  839. return this.pos > this.bufferWaterline;
  840. }
  841. dropParsedChunk() {
  842. this.willDropParsedChunk() && (this.html = this.html.substring(this.pos), this.lineStartPos -= this.pos, this.droppedBufferSize += this.pos, this.pos = 0, this.lastGapPos = -2, this.gapStack.length = 0);
  843. }
  844. write(e3, t2) {
  845. this.html.length > 0 ? this.html += e3 : this.html = e3, this.endOfChunkHit = false, this.lastChunkWritten = t2;
  846. }
  847. insertHtmlAtCurrentPos(e3) {
  848. this.html = this.html.substring(0, this.pos + 1) + e3 + this.html.substring(this.pos + 1), this.endOfChunkHit = false;
  849. }
  850. startsWith(e3, t2) {
  851. if (this.pos + e3.length > this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, false;
  852. if (t2) return this.html.startsWith(e3, this.pos);
  853. for (let t3 = 0; t3 < e3.length; t3++) if ((32 | this.html.charCodeAt(this.pos + t3)) !== e3.charCodeAt(t3)) return false;
  854. return true;
  855. }
  856. peek(e3) {
  857. const t2 = this.pos + e3;
  858. if (t2 >= this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, a.EOF;
  859. const s2 = this.html.charCodeAt(t2);
  860. return s2 === a.CARRIAGE_RETURN ? a.LINE_FEED : s2;
  861. }
  862. advance() {
  863. if (this.pos++, this.isEol && (this.isEol = false, this.line++, this.lineStartPos = this.pos), this.pos >= this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, a.EOF;
  864. let e3 = this.html.charCodeAt(this.pos);
  865. return e3 === a.CARRIAGE_RETURN ? (this.isEol = true, this.skipNextNewLine = true, a.LINE_FEED) : e3 === a.LINE_FEED && (this.isEol = true, this.skipNextNewLine) ? (this.line--, this.skipNextNewLine = false, this._addGap(), this.advance()) : (this.skipNextNewLine = false, o(e3) && (e3 = this._processSurrogate(e3)), null === this.handler.onParseError || e3 > 31 && e3 < 127 || e3 === a.LINE_FEED || e3 === a.CARRIAGE_RETURN || e3 > 159 && e3 < 64976 || this._checkForProblematicCharacters(e3), e3);
  866. }
  867. _checkForProblematicCharacters(e3) {
  868. c(e3) ? this._err(T.controlCharacterInInputStream) : E(e3) && this._err(T.noncharacterInInputStream);
  869. }
  870. retreat(e3) {
  871. for (this.pos -= e3; this.pos < this.lastGapPos; ) this.lastGapPos = this.gapStack.pop(), this.pos--;
  872. this.isEol = false;
  873. }
  874. }
  875. function A(e3, t2) {
  876. for (let s2 = e3.attrs.length - 1; s2 >= 0; s2--) if (e3.attrs[s2].name === t2) return e3.attrs[s2].value;
  877. return null;
  878. }
  879. !function(e3) {
  880. e3[e3.CHARACTER = 0] = "CHARACTER", e3[e3.NULL_CHARACTER = 1] = "NULL_CHARACTER", e3[e3.WHITESPACE_CHARACTER = 2] = "WHITESPACE_CHARACTER", e3[e3.START_TAG = 3] = "START_TAG", e3[e3.END_TAG = 4] = "END_TAG", e3[e3.COMMENT = 5] = "COMMENT", e3[e3.DOCTYPE = 6] = "DOCTYPE", e3[e3.EOF = 7] = "EOF", e3[e3.HIBERNATION = 8] = "HIBERNATION";
  881. }(h = h || (h = {}));
  882. var l = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, m = {}, d = {};
  883. Object.defineProperty(d, "__esModule", { value: true }), d.default = new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(function(e3) {
  884. return e3.charCodeAt(0);
  885. }));
  886. var p = {};
  887. Object.defineProperty(p, "__esModule", { value: true }), p.default = new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(function(e3) {
  888. return e3.charCodeAt(0);
  889. }));
  890. var u, N, I, C, S, D = {};
  891. !function(e3) {
  892. var t2;
  893. Object.defineProperty(e3, "__esModule", { value: true }), e3.replaceCodePoint = e3.fromCodePoint = void 0;
  894. var s2 = /* @__PURE__ */ new Map([[0, 65533], [128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376]]);
  895. function a2(e4) {
  896. var t3;
  897. return e4 >= 55296 && e4 <= 57343 || e4 > 1114111 ? 65533 : null !== (t3 = s2.get(e4)) && void 0 !== t3 ? t3 : e4;
  898. }
  899. e3.fromCodePoint = null !== (t2 = String.fromCodePoint) && void 0 !== t2 ? t2 : function(e4) {
  900. var t3 = "";
  901. return e4 > 65535 && (e4 -= 65536, t3 += String.fromCharCode(e4 >>> 10 & 1023 | 55296), e4 = 56320 | 1023 & e4), t3 + String.fromCharCode(e4);
  902. }, e3.replaceCodePoint = a2, e3.default = function(t3) {
  903. return (0, e3.fromCodePoint)(a2(t3));
  904. };
  905. }(D), function(e3) {
  906. var t2 = l && l.__createBinding || (Object.create ? function(e4, t3, s3, a3) {
  907. void 0 === a3 && (a3 = s3);
  908. var r3 = Object.getOwnPropertyDescriptor(t3, s3);
  909. r3 && !("get" in r3 ? !t3.__esModule : r3.writable || r3.configurable) || (r3 = { enumerable: true, get: function() {
  910. return t3[s3];
  911. } }), Object.defineProperty(e4, a3, r3);
  912. } : function(e4, t3, s3, a3) {
  913. void 0 === a3 && (a3 = s3), e4[a3] = t3[s3];
  914. }), s2 = l && l.__setModuleDefault || (Object.create ? function(e4, t3) {
  915. Object.defineProperty(e4, "default", { enumerable: true, value: t3 });
  916. } : function(e4, t3) {
  917. e4.default = t3;
  918. }), a2 = l && l.__importStar || function(e4) {
  919. if (e4 && e4.__esModule) return e4;
  920. var a3 = {};
  921. if (null != e4) for (var r3 in e4) "default" !== r3 && Object.prototype.hasOwnProperty.call(e4, r3) && t2(a3, e4, r3);
  922. return s2(a3, e4), a3;
  923. }, r2 = l && l.__importDefault || function(e4) {
  924. return e4 && e4.__esModule ? e4 : { default: e4 };
  925. };
  926. Object.defineProperty(e3, "__esModule", { value: true }), e3.decodeXML = e3.decodeHTMLStrict = e3.decodeHTMLAttribute = e3.decodeHTML = e3.determineBranch = e3.EntityDecoder = e3.DecodingMode = e3.BinTrieFlags = e3.fromCodePoint = e3.replaceCodePoint = e3.decodeCodePoint = e3.xmlDecodeTree = e3.htmlDecodeTree = void 0;
  927. var n2 = r2(d);
  928. e3.htmlDecodeTree = n2.default;
  929. var i2 = r2(p);
  930. e3.xmlDecodeTree = i2.default;
  931. var o2 = a2(D);
  932. e3.decodeCodePoint = o2.default;
  933. var c2, E2, T2, h2, _2 = D;
  934. function A2(e4) {
  935. return e4 >= c2.ZERO && e4 <= c2.NINE;
  936. }
  937. Object.defineProperty(e3, "replaceCodePoint", { enumerable: true, get: function() {
  938. return _2.replaceCodePoint;
  939. } }), Object.defineProperty(e3, "fromCodePoint", { enumerable: true, get: function() {
  940. return _2.fromCodePoint;
  941. } }), function(e4) {
  942. e4[e4.NUM = 35] = "NUM", e4[e4.SEMI = 59] = "SEMI", e4[e4.EQUALS = 61] = "EQUALS", e4[e4.ZERO = 48] = "ZERO", e4[e4.NINE = 57] = "NINE", e4[e4.LOWER_A = 97] = "LOWER_A", e4[e4.LOWER_F = 102] = "LOWER_F", e4[e4.LOWER_X = 120] = "LOWER_X", e4[e4.LOWER_Z = 122] = "LOWER_Z", e4[e4.UPPER_A = 65] = "UPPER_A", e4[e4.UPPER_F = 70] = "UPPER_F", e4[e4.UPPER_Z = 90] = "UPPER_Z";
  943. }(c2 || (c2 = {})), function(e4) {
  944. e4[e4.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e4[e4.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e4[e4.JUMP_TABLE = 127] = "JUMP_TABLE";
  945. }(E2 = e3.BinTrieFlags || (e3.BinTrieFlags = {})), function(e4) {
  946. e4[e4.EntityStart = 0] = "EntityStart", e4[e4.NumericStart = 1] = "NumericStart", e4[e4.NumericDecimal = 2] = "NumericDecimal", e4[e4.NumericHex = 3] = "NumericHex", e4[e4.NamedEntity = 4] = "NamedEntity";
  947. }(T2 || (T2 = {})), function(e4) {
  948. e4[e4.Legacy = 0] = "Legacy", e4[e4.Strict = 1] = "Strict", e4[e4.Attribute = 2] = "Attribute";
  949. }(h2 = e3.DecodingMode || (e3.DecodingMode = {}));
  950. var m2 = function() {
  951. function e4(e5, t3, s3) {
  952. this.decodeTree = e5, this.emitCodePoint = t3, this.errors = s3, this.state = T2.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = h2.Strict;
  953. }
  954. return e4.prototype.startEntity = function(e5) {
  955. this.decodeMode = e5, this.state = T2.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
  956. }, e4.prototype.write = function(e5, t3) {
  957. switch (this.state) {
  958. case T2.EntityStart:
  959. return e5.charCodeAt(t3) === c2.NUM ? (this.state = T2.NumericStart, this.consumed += 1, this.stateNumericStart(e5, t3 + 1)) : (this.state = T2.NamedEntity, this.stateNamedEntity(e5, t3));
  960. case T2.NumericStart:
  961. return this.stateNumericStart(e5, t3);
  962. case T2.NumericDecimal:
  963. return this.stateNumericDecimal(e5, t3);
  964. case T2.NumericHex:
  965. return this.stateNumericHex(e5, t3);
  966. case T2.NamedEntity:
  967. return this.stateNamedEntity(e5, t3);
  968. }
  969. }, e4.prototype.stateNumericStart = function(e5, t3) {
  970. return t3 >= e5.length ? -1 : (32 | e5.charCodeAt(t3)) === c2.LOWER_X ? (this.state = T2.NumericHex, this.consumed += 1, this.stateNumericHex(e5, t3 + 1)) : (this.state = T2.NumericDecimal, this.stateNumericDecimal(e5, t3));
  971. }, e4.prototype.addToNumericResult = function(e5, t3, s3, a3) {
  972. if (t3 !== s3) {
  973. var r3 = s3 - t3;
  974. this.result = this.result * Math.pow(a3, r3) + parseInt(e5.substr(t3, r3), a3), this.consumed += r3;
  975. }
  976. }, e4.prototype.stateNumericHex = function(e5, t3) {
  977. for (var s3, a3 = t3; t3 < e5.length; ) {
  978. var r3 = e5.charCodeAt(t3);
  979. if (!(A2(r3) || (s3 = r3, s3 >= c2.UPPER_A && s3 <= c2.UPPER_F || s3 >= c2.LOWER_A && s3 <= c2.LOWER_F))) return this.addToNumericResult(e5, a3, t3, 16), this.emitNumericEntity(r3, 3);
  980. t3 += 1;
  981. }
  982. return this.addToNumericResult(e5, a3, t3, 16), -1;
  983. }, e4.prototype.stateNumericDecimal = function(e5, t3) {
  984. for (var s3 = t3; t3 < e5.length; ) {
  985. var a3 = e5.charCodeAt(t3);
  986. if (!A2(a3)) return this.addToNumericResult(e5, s3, t3, 10), this.emitNumericEntity(a3, 2);
  987. t3 += 1;
  988. }
  989. return this.addToNumericResult(e5, s3, t3, 10), -1;
  990. }, e4.prototype.emitNumericEntity = function(e5, t3) {
  991. var s3;
  992. if (this.consumed <= t3) return null === (s3 = this.errors) || void 0 === s3 || s3.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
  993. if (e5 === c2.SEMI) this.consumed += 1;
  994. else if (this.decodeMode === h2.Strict) return 0;
  995. return this.emitCodePoint((0, o2.replaceCodePoint)(this.result), this.consumed), this.errors && (e5 !== c2.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
  996. }, e4.prototype.stateNamedEntity = function(e5, t3) {
  997. for (var s3 = this.decodeTree, a3 = s3[this.treeIndex], r3 = (a3 & E2.VALUE_LENGTH) >> 14; t3 < e5.length; t3++, this.excess++) {
  998. var n3 = e5.charCodeAt(t3);
  999. if (this.treeIndex = N2(s3, a3, this.treeIndex + Math.max(1, r3), n3), this.treeIndex < 0) return 0 === this.result || this.decodeMode === h2.Attribute && (0 === r3 || ((i3 = n3) === c2.EQUALS || function(e6) {
  1000. return e6 >= c2.UPPER_A && e6 <= c2.UPPER_Z || e6 >= c2.LOWER_A && e6 <= c2.LOWER_Z || A2(e6);
  1001. }(i3))) ? 0 : this.emitNotTerminatedNamedEntity();
  1002. if (0 != (r3 = ((a3 = s3[this.treeIndex]) & E2.VALUE_LENGTH) >> 14)) {
  1003. if (n3 === c2.SEMI) return this.emitNamedEntityData(this.treeIndex, r3, this.consumed + this.excess);
  1004. this.decodeMode !== h2.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
  1005. }
  1006. }
  1007. var i3;
  1008. return -1;
  1009. }, e4.prototype.emitNotTerminatedNamedEntity = function() {
  1010. var e5, t3 = this.result, s3 = (this.decodeTree[t3] & E2.VALUE_LENGTH) >> 14;
  1011. return this.emitNamedEntityData(t3, s3, this.consumed), null === (e5 = this.errors) || void 0 === e5 || e5.missingSemicolonAfterCharacterReference(), this.consumed;
  1012. }, e4.prototype.emitNamedEntityData = function(e5, t3, s3) {
  1013. var a3 = this.decodeTree;
  1014. return this.emitCodePoint(1 === t3 ? a3[e5] & ~E2.VALUE_LENGTH : a3[e5 + 1], s3), 3 === t3 && this.emitCodePoint(a3[e5 + 2], s3), s3;
  1015. }, e4.prototype.end = function() {
  1016. var e5;
  1017. switch (this.state) {
  1018. case T2.NamedEntity:
  1019. return 0 === this.result || this.decodeMode === h2.Attribute && this.result !== this.treeIndex ? 0 : this.emitNotTerminatedNamedEntity();
  1020. case T2.NumericDecimal:
  1021. return this.emitNumericEntity(0, 2);
  1022. case T2.NumericHex:
  1023. return this.emitNumericEntity(0, 3);
  1024. case T2.NumericStart:
  1025. return null === (e5 = this.errors) || void 0 === e5 || e5.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
  1026. case T2.EntityStart:
  1027. return 0;
  1028. }
  1029. }, e4;
  1030. }();
  1031. function u2(e4) {
  1032. var t3 = "", s3 = new m2(e4, function(e5) {
  1033. return t3 += (0, o2.fromCodePoint)(e5);
  1034. });
  1035. return function(e5, a3) {
  1036. for (var r3 = 0, n3 = 0; (n3 = e5.indexOf("&", n3)) >= 0; ) {
  1037. t3 += e5.slice(r3, n3), s3.startEntity(a3);
  1038. var i3 = s3.write(e5, n3 + 1);
  1039. if (i3 < 0) {
  1040. r3 = n3 + s3.end();
  1041. break;
  1042. }
  1043. r3 = n3 + i3, n3 = 0 === i3 ? r3 + 1 : r3;
  1044. }
  1045. var o3 = t3 + e5.slice(r3);
  1046. return t3 = "", o3;
  1047. };
  1048. }
  1049. function N2(e4, t3, s3, a3) {
  1050. var r3 = (t3 & E2.BRANCH_LENGTH) >> 7, n3 = t3 & E2.JUMP_TABLE;
  1051. if (0 === r3) return 0 !== n3 && a3 === n3 ? s3 : -1;
  1052. if (n3) {
  1053. var i3 = a3 - n3;
  1054. return i3 < 0 || i3 >= r3 ? -1 : e4[s3 + i3] - 1;
  1055. }
  1056. for (var o3 = s3, c3 = o3 + r3 - 1; o3 <= c3; ) {
  1057. var T3 = o3 + c3 >>> 1, h3 = e4[T3];
  1058. if (h3 < a3) o3 = T3 + 1;
  1059. else {
  1060. if (!(h3 > a3)) return e4[T3 + r3];
  1061. c3 = T3 - 1;
  1062. }
  1063. }
  1064. return -1;
  1065. }
  1066. e3.EntityDecoder = m2, e3.determineBranch = N2;
  1067. var I2 = u2(n2.default), C2 = u2(i2.default);
  1068. e3.decodeHTML = function(e4, t3) {
  1069. return void 0 === t3 && (t3 = h2.Legacy), I2(e4, t3);
  1070. }, e3.decodeHTMLAttribute = function(e4) {
  1071. return I2(e4, h2.Attribute);
  1072. }, e3.decodeHTMLStrict = function(e4) {
  1073. return I2(e4, h2.Strict);
  1074. }, e3.decodeXML = function(e4) {
  1075. return C2(e4, h2.Strict);
  1076. };
  1077. }(m), function(e3) {
  1078. e3.HTML = "http://www.w3.org/1999/xhtml", e3.MATHML = "http://www.w3.org/1998/Math/MathML", e3.SVG = "http://www.w3.org/2000/svg", e3.XLINK = "http://www.w3.org/1999/xlink", e3.XML = "http://www.w3.org/XML/1998/namespace", e3.XMLNS = "http://www.w3.org/2000/xmlns/";
  1079. }(u = u || (u = {})), function(e3) {
  1080. e3.TYPE = "type", e3.ACTION = "action", e3.ENCODING = "encoding", e3.PROMPT = "prompt", e3.NAME = "name", e3.COLOR = "color", e3.FACE = "face", e3.SIZE = "size";
  1081. }(N = N || (N = {})), function(e3) {
  1082. e3.NO_QUIRKS = "no-quirks", e3.QUIRKS = "quirks", e3.LIMITED_QUIRKS = "limited-quirks";
  1083. }(I = I || (I = {})), function(e3) {
  1084. e3.A = "a", e3.ADDRESS = "address", e3.ANNOTATION_XML = "annotation-xml", e3.APPLET = "applet", e3.AREA = "area", e3.ARTICLE = "article", e3.ASIDE = "aside", e3.B = "b", e3.BASE = "base", e3.BASEFONT = "basefont", e3.BGSOUND = "bgsound", e3.BIG = "big", e3.BLOCKQUOTE = "blockquote", e3.BODY = "body", e3.BR = "br", e3.BUTTON = "button", e3.CAPTION = "caption", e3.CENTER = "center", e3.CODE = "code", e3.COL = "col", e3.COLGROUP = "colgroup", e3.DD = "dd", e3.DESC = "desc", e3.DETAILS = "details", e3.DIALOG = "dialog", e3.DIR = "dir", e3.DIV = "div", e3.DL = "dl", e3.DT = "dt", e3.EM = "em", e3.EMBED = "embed", e3.FIELDSET = "fieldset", e3.FIGCAPTION = "figcaption", e3.FIGURE = "figure", e3.FONT = "font", e3.FOOTER = "footer", e3.FOREIGN_OBJECT = "foreignObject", e3.FORM = "form", e3.FRAME = "frame", e3.FRAMESET = "frameset", e3.H1 = "h1", e3.H2 = "h2", e3.H3 = "h3", e3.H4 = "h4", e3.H5 = "h5", e3.H6 = "h6", e3.HEAD = "head", e3.HEADER = "header", e3.HGROUP = "hgroup", e3.HR = "hr", e3.HTML = "html", e3.I = "i", e3.IMG = "img", e3.IMAGE = "image", e3.INPUT = "input", e3.IFRAME = "iframe", e3.KEYGEN = "keygen", e3.LABEL = "label", e3.LI = "li", e3.LINK = "link", e3.LISTING = "listing", e3.MAIN = "main", e3.MALIGNMARK = "malignmark", e3.MARQUEE = "marquee", e3.MATH = "math", e3.MENU = "menu", e3.META = "meta", e3.MGLYPH = "mglyph", e3.MI = "mi", e3.MO = "mo", e3.MN = "mn", e3.MS = "ms", e3.MTEXT = "mtext", e3.NAV = "nav", e3.NOBR = "nobr", e3.NOFRAMES = "noframes", e3.NOEMBED = "noembed", e3.NOSCRIPT = "noscript", e3.OBJECT = "object", e3.OL = "ol", e3.OPTGROUP = "optgroup", e3.OPTION = "option", e3.P = "p", e3.PARAM = "param", e3.PLAINTEXT = "plaintext", e3.PRE = "pre", e3.RB = "rb", e3.RP = "rp", e3.RT = "rt", e3.RTC = "rtc", e3.RUBY = "ruby", e3.S = "s", e3.SCRIPT = "script", e3.SECTION = "section", e3.SELECT = "select", e3.SOURCE = "source", e3.SMALL = "small", e3.SPAN = "span", e3.STRIKE = "strike", e3.STRONG = "strong", e3.STYLE = "style", e3.SUB = "sub", e3.SUMMARY = "summary", e3.SUP = "sup", e3.TABLE = "table", e3.TBODY = "tbody", e3.TEMPLATE = "template", e3.TEXTAREA = "textarea", e3.TFOOT = "tfoot", e3.TD = "td", e3.TH = "th", e3.THEAD = "thead", e3.TITLE = "title", e3.TR = "tr", e3.TRACK = "track", e3.TT = "tt", e3.U = "u", e3.UL = "ul", e3.SVG = "svg", e3.VAR = "var", e3.WBR = "wbr", e3.XMP = "xmp";
  1085. }(C = C || (C = {})), function(e3) {
  1086. e3[e3.UNKNOWN = 0] = "UNKNOWN", e3[e3.A = 1] = "A", e3[e3.ADDRESS = 2] = "ADDRESS", e3[e3.ANNOTATION_XML = 3] = "ANNOTATION_XML", e3[e3.APPLET = 4] = "APPLET", e3[e3.AREA = 5] = "AREA", e3[e3.ARTICLE = 6] = "ARTICLE", e3[e3.ASIDE = 7] = "ASIDE", e3[e3.B = 8] = "B", e3[e3.BASE = 9] = "BASE", e3[e3.BASEFONT = 10] = "BASEFONT", e3[e3.BGSOUND = 11] = "BGSOUND", e3[e3.BIG = 12] = "BIG", e3[e3.BLOCKQUOTE = 13] = "BLOCKQUOTE", e3[e3.BODY = 14] = "BODY", e3[e3.BR = 15] = "BR", e3[e3.BUTTON = 16] = "BUTTON", e3[e3.CAPTION = 17] = "CAPTION", e3[e3.CENTER = 18] = "CENTER", e3[e3.CODE = 19] = "CODE", e3[e3.COL = 20] = "COL", e3[e3.COLGROUP = 21] = "COLGROUP", e3[e3.DD = 22] = "DD", e3[e3.DESC = 23] = "DESC", e3[e3.DETAILS = 24] = "DETAILS", e3[e3.DIALOG = 25] = "DIALOG", e3[e3.DIR = 26] = "DIR", e3[e3.DIV = 27] = "DIV", e3[e3.DL = 28] = "DL", e3[e3.DT = 29] = "DT", e3[e3.EM = 30] = "EM", e3[e3.EMBED = 31] = "EMBED", e3[e3.FIELDSET = 32] = "FIELDSET", e3[e3.FIGCAPTION = 33] = "FIGCAPTION", e3[e3.FIGURE = 34] = "FIGURE", e3[e3.FONT = 35] = "FONT", e3[e3.FOOTER = 36] = "FOOTER", e3[e3.FOREIGN_OBJECT = 37] = "FOREIGN_OBJECT", e3[e3.FORM = 38] = "FORM", e3[e3.FRAME = 39] = "FRAME", e3[e3.FRAMESET = 40] = "FRAMESET", e3[e3.H1 = 41] = "H1", e3[e3.H2 = 42] = "H2", e3[e3.H3 = 43] = "H3", e3[e3.H4 = 44] = "H4", e3[e3.H5 = 45] = "H5", e3[e3.H6 = 46] = "H6", e3[e3.HEAD = 47] = "HEAD", e3[e3.HEADER = 48] = "HEADER", e3[e3.HGROUP = 49] = "HGROUP", e3[e3.HR = 50] = "HR", e3[e3.HTML = 51] = "HTML", e3[e3.I = 52] = "I", e3[e3.IMG = 53] = "IMG", e3[e3.IMAGE = 54] = "IMAGE", e3[e3.INPUT = 55] = "INPUT", e3[e3.IFRAME = 56] = "IFRAME", e3[e3.KEYGEN = 57] = "KEYGEN", e3[e3.LABEL = 58] = "LABEL", e3[e3.LI = 59] = "LI", e3[e3.LINK = 60] = "LINK", e3[e3.LISTING = 61] = "LISTING", e3[e3.MAIN = 62] = "MAIN", e3[e3.MALIGNMARK = 63] = "MALIGNMARK", e3[e3.MARQUEE = 64] = "MARQUEE", e3[e3.MATH = 65] = "MATH", e3[e3.MENU = 66] = "MENU", e3[e3.META = 67] = "META", e3[e3.MGLYPH = 68] = "MGLYPH", e3[e3.MI = 69] = "MI", e3[e3.MO = 70] = "MO", e3[e3.MN = 71] = "MN", e3[e3.MS = 72] = "MS", e3[e3.MTEXT = 73] = "MTEXT", e3[e3.NAV = 74] = "NAV", e3[e3.NOBR = 75] = "NOBR", e3[e3.NOFRAMES = 76] = "NOFRAMES", e3[e3.NOEMBED = 77] = "NOEMBED", e3[e3.NOSCRIPT = 78] = "NOSCRIPT", e3[e3.OBJECT = 79] = "OBJECT", e3[e3.OL = 80] = "OL", e3[e3.OPTGROUP = 81] = "OPTGROUP", e3[e3.OPTION = 82] = "OPTION", e3[e3.P = 83] = "P", e3[e3.PARAM = 84] = "PARAM", e3[e3.PLAINTEXT = 85] = "PLAINTEXT", e3[e3.PRE = 86] = "PRE", e3[e3.RB = 87] = "RB", e3[e3.RP = 88] = "RP", e3[e3.RT = 89] = "RT", e3[e3.RTC = 90] = "RTC", e3[e3.RUBY = 91] = "RUBY", e3[e3.S = 92] = "S", e3[e3.SCRIPT = 93] = "SCRIPT", e3[e3.SECTION = 94] = "SECTION", e3[e3.SELECT = 95] = "SELECT", e3[e3.SOURCE = 96] = "SOURCE", e3[e3.SMALL = 97] = "SMALL", e3[e3.SPAN = 98] = "SPAN", e3[e3.STRIKE = 99] = "STRIKE", e3[e3.STRONG = 100] = "STRONG", e3[e3.STYLE = 101] = "STYLE", e3[e3.SUB = 102] = "SUB", e3[e3.SUMMARY = 103] = "SUMMARY", e3[e3.SUP = 104] = "SUP", e3[e3.TABLE = 105] = "TABLE", e3[e3.TBODY = 106] = "TBODY", e3[e3.TEMPLATE = 107] = "TEMPLATE", e3[e3.TEXTAREA = 108] = "TEXTAREA", e3[e3.TFOOT = 109] = "TFOOT", e3[e3.TD = 110] = "TD", e3[e3.TH = 111] = "TH", e3[e3.THEAD = 112] = "THEAD", e3[e3.TITLE = 113] = "TITLE", e3[e3.TR = 114] = "TR", e3[e3.TRACK = 115] = "TRACK", e3[e3.TT = 116] = "TT", e3[e3.U = 117] = "U", e3[e3.UL = 118] = "UL", e3[e3.SVG = 119] = "SVG", e3[e3.VAR = 120] = "VAR", e3[e3.WBR = 121] = "WBR", e3[e3.XMP = 122] = "XMP";
  1087. }(S = S || (S = {}));
  1088. const R = /* @__PURE__ */ new Map([[C.A, S.A], [C.ADDRESS, S.ADDRESS], [C.ANNOTATION_XML, S.ANNOTATION_XML], [C.APPLET, S.APPLET], [C.AREA, S.AREA], [C.ARTICLE, S.ARTICLE], [C.ASIDE, S.ASIDE], [C.B, S.B], [C.BASE, S.BASE], [C.BASEFONT, S.BASEFONT], [C.BGSOUND, S.BGSOUND], [C.BIG, S.BIG], [C.BLOCKQUOTE, S.BLOCKQUOTE], [C.BODY, S.BODY], [C.BR, S.BR], [C.BUTTON, S.BUTTON], [C.CAPTION, S.CAPTION], [C.CENTER, S.CENTER], [C.CODE, S.CODE], [C.COL, S.COL], [C.COLGROUP, S.COLGROUP], [C.DD, S.DD], [C.DESC, S.DESC], [C.DETAILS, S.DETAILS], [C.DIALOG, S.DIALOG], [C.DIR, S.DIR], [C.DIV, S.DIV], [C.DL, S.DL], [C.DT, S.DT], [C.EM, S.EM], [C.EMBED, S.EMBED], [C.FIELDSET, S.FIELDSET], [C.FIGCAPTION, S.FIGCAPTION], [C.FIGURE, S.FIGURE], [C.FONT, S.FONT], [C.FOOTER, S.FOOTER], [C.FOREIGN_OBJECT, S.FOREIGN_OBJECT], [C.FORM, S.FORM], [C.FRAME, S.FRAME], [C.FRAMESET, S.FRAMESET], [C.H1, S.H1], [C.H2, S.H2], [C.H3, S.H3], [C.H4, S.H4], [C.H5, S.H5], [C.H6, S.H6], [C.HEAD, S.HEAD], [C.HEADER, S.HEADER], [C.HGROUP, S.HGROUP], [C.HR, S.HR], [C.HTML, S.HTML], [C.I, S.I], [C.IMG, S.IMG], [C.IMAGE, S.IMAGE], [C.INPUT, S.INPUT], [C.IFRAME, S.IFRAME], [C.KEYGEN, S.KEYGEN], [C.LABEL, S.LABEL], [C.LI, S.LI], [C.LINK, S.LINK], [C.LISTING, S.LISTING], [C.MAIN, S.MAIN], [C.MALIGNMARK, S.MALIGNMARK], [C.MARQUEE, S.MARQUEE], [C.MATH, S.MATH], [C.MENU, S.MENU], [C.META, S.META], [C.MGLYPH, S.MGLYPH], [C.MI, S.MI], [C.MO, S.MO], [C.MN, S.MN], [C.MS, S.MS], [C.MTEXT, S.MTEXT], [C.NAV, S.NAV], [C.NOBR, S.NOBR], [C.NOFRAMES, S.NOFRAMES], [C.NOEMBED, S.NOEMBED], [C.NOSCRIPT, S.NOSCRIPT], [C.OBJECT, S.OBJECT], [C.OL, S.OL], [C.OPTGROUP, S.OPTGROUP], [C.OPTION, S.OPTION], [C.P, S.P], [C.PARAM, S.PARAM], [C.PLAINTEXT, S.PLAINTEXT], [C.PRE, S.PRE], [C.RB, S.RB], [C.RP, S.RP], [C.RT, S.RT], [C.RTC, S.RTC], [C.RUBY, S.RUBY], [C.S, S.S], [C.SCRIPT, S.SCRIPT], [C.SECTION, S.SECTION], [C.SELECT, S.SELECT], [C.SOURCE, S.SOURCE], [C.SMALL, S.SMALL], [C.SPAN, S.SPAN], [C.STRIKE, S.STRIKE], [C.STRONG, S.STRONG], [C.STYLE, S.STYLE], [C.SUB, S.SUB], [C.SUMMARY, S.SUMMARY], [C.SUP, S.SUP], [C.TABLE, S.TABLE], [C.TBODY, S.TBODY], [C.TEMPLATE, S.TEMPLATE], [C.TEXTAREA, S.TEXTAREA], [C.TFOOT, S.TFOOT], [C.TD, S.TD], [C.TH, S.TH], [C.THEAD, S.THEAD], [C.TITLE, S.TITLE], [C.TR, S.TR], [C.TRACK, S.TRACK], [C.TT, S.TT], [C.U, S.U], [C.UL, S.UL], [C.SVG, S.SVG], [C.VAR, S.VAR], [C.WBR, S.WBR], [C.XMP, S.XMP]]);
  1089. function O(e3) {
  1090. var t2;
  1091. return null !== (t2 = R.get(e3)) && void 0 !== t2 ? t2 : S.UNKNOWN;
  1092. }
  1093. const f = S, L = { [u.HTML]: /* @__PURE__ */ new Set([f.ADDRESS, f.APPLET, f.AREA, f.ARTICLE, f.ASIDE, f.BASE, f.BASEFONT, f.BGSOUND, f.BLOCKQUOTE, f.BODY, f.BR, f.BUTTON, f.CAPTION, f.CENTER, f.COL, f.COLGROUP, f.DD, f.DETAILS, f.DIR, f.DIV, f.DL, f.DT, f.EMBED, f.FIELDSET, f.FIGCAPTION, f.FIGURE, f.FOOTER, f.FORM, f.FRAME, f.FRAMESET, f.H1, f.H2, f.H3, f.H4, f.H5, f.H6, f.HEAD, f.HEADER, f.HGROUP, f.HR, f.HTML, f.IFRAME, f.IMG, f.INPUT, f.LI, f.LINK, f.LISTING, f.MAIN, f.MARQUEE, f.MENU, f.META, f.NAV, f.NOEMBED, f.NOFRAMES, f.NOSCRIPT, f.OBJECT, f.OL, f.P, f.PARAM, f.PLAINTEXT, f.PRE, f.SCRIPT, f.SECTION, f.SELECT, f.SOURCE, f.STYLE, f.SUMMARY, f.TABLE, f.TBODY, f.TD, f.TEMPLATE, f.TEXTAREA, f.TFOOT, f.TH, f.THEAD, f.TITLE, f.TR, f.TRACK, f.UL, f.WBR, f.XMP]), [u.MATHML]: /* @__PURE__ */ new Set([f.MI, f.MO, f.MN, f.MS, f.MTEXT, f.ANNOTATION_XML]), [u.SVG]: /* @__PURE__ */ new Set([f.TITLE, f.FOREIGN_OBJECT, f.DESC]), [u.XLINK]: /* @__PURE__ */ new Set(), [u.XML]: /* @__PURE__ */ new Set(), [u.XMLNS]: /* @__PURE__ */ new Set() };
  1094. function M(e3) {
  1095. return e3 === f.H1 || e3 === f.H2 || e3 === f.H3 || e3 === f.H4 || e3 === f.H5 || e3 === f.H6;
  1096. }
  1097. /* @__PURE__ */ new Set([C.STYLE, C.SCRIPT, C.XMP, C.IFRAME, C.NOEMBED, C.NOFRAMES, C.PLAINTEXT]);
  1098. const g = /* @__PURE__ */ new Map([[128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376]]);
  1099. var P;
  1100. !function(e3) {
  1101. e3[e3.DATA = 0] = "DATA", e3[e3.RCDATA = 1] = "RCDATA", e3[e3.RAWTEXT = 2] = "RAWTEXT", e3[e3.SCRIPT_DATA = 3] = "SCRIPT_DATA", e3[e3.PLAINTEXT = 4] = "PLAINTEXT", e3[e3.TAG_OPEN = 5] = "TAG_OPEN", e3[e3.END_TAG_OPEN = 6] = "END_TAG_OPEN", e3[e3.TAG_NAME = 7] = "TAG_NAME", e3[e3.RCDATA_LESS_THAN_SIGN = 8] = "RCDATA_LESS_THAN_SIGN", e3[e3.RCDATA_END_TAG_OPEN = 9] = "RCDATA_END_TAG_OPEN", e3[e3.RCDATA_END_TAG_NAME = 10] = "RCDATA_END_TAG_NAME", e3[e3.RAWTEXT_LESS_THAN_SIGN = 11] = "RAWTEXT_LESS_THAN_SIGN", e3[e3.RAWTEXT_END_TAG_OPEN = 12] = "RAWTEXT_END_TAG_OPEN", e3[e3.RAWTEXT_END_TAG_NAME = 13] = "RAWTEXT_END_TAG_NAME", e3[e3.SCRIPT_DATA_LESS_THAN_SIGN = 14] = "SCRIPT_DATA_LESS_THAN_SIGN", e3[e3.SCRIPT_DATA_END_TAG_OPEN = 15] = "SCRIPT_DATA_END_TAG_OPEN", e3[e3.SCRIPT_DATA_END_TAG_NAME = 16] = "SCRIPT_DATA_END_TAG_NAME", e3[e3.SCRIPT_DATA_ESCAPE_START = 17] = "SCRIPT_DATA_ESCAPE_START", e3[e3.SCRIPT_DATA_ESCAPE_START_DASH = 18] = "SCRIPT_DATA_ESCAPE_START_DASH", e3[e3.SCRIPT_DATA_ESCAPED = 19] = "SCRIPT_DATA_ESCAPED", e3[e3.SCRIPT_DATA_ESCAPED_DASH = 20] = "SCRIPT_DATA_ESCAPED_DASH", e3[e3.SCRIPT_DATA_ESCAPED_DASH_DASH = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH", e3[e3.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN", e3[e3.SCRIPT_DATA_ESCAPED_END_TAG_OPEN = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN", e3[e3.SCRIPT_DATA_ESCAPED_END_TAG_NAME = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPE_START = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPED = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN", e3[e3.SCRIPT_DATA_DOUBLE_ESCAPE_END = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END", e3[e3.BEFORE_ATTRIBUTE_NAME = 31] = "BEFORE_ATTRIBUTE_NAME", e3[e3.ATTRIBUTE_NAME = 32] = "ATTRIBUTE_NAME", e3[e3.AFTER_ATTRIBUTE_NAME = 33] = "AFTER_ATTRIBUTE_NAME", e3[e3.BEFORE_ATTRIBUTE_VALUE = 34] = "BEFORE_ATTRIBUTE_VALUE", e3[e3.ATTRIBUTE_VALUE_DOUBLE_QUOTED = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED", e3[e3.ATTRIBUTE_VALUE_SINGLE_QUOTED = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED", e3[e3.ATTRIBUTE_VALUE_UNQUOTED = 37] = "ATTRIBUTE_VALUE_UNQUOTED", e3[e3.AFTER_ATTRIBUTE_VALUE_QUOTED = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED", e3[e3.SELF_CLOSING_START_TAG = 39] = "SELF_CLOSING_START_TAG", e3[e3.BOGUS_COMMENT = 40] = "BOGUS_COMMENT", e3[e3.MARKUP_DECLARATION_OPEN = 41] = "MARKUP_DECLARATION_OPEN", e3[e3.COMMENT_START = 42] = "COMMENT_START", e3[e3.COMMENT_START_DASH = 43] = "COMMENT_START_DASH", e3[e3.COMMENT = 44] = "COMMENT", e3[e3.COMMENT_LESS_THAN_SIGN = 45] = "COMMENT_LESS_THAN_SIGN", e3[e3.COMMENT_LESS_THAN_SIGN_BANG = 46] = "COMMENT_LESS_THAN_SIGN_BANG", e3[e3.COMMENT_LESS_THAN_SIGN_BANG_DASH = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH", e3[e3.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH", e3[e3.COMMENT_END_DASH = 49] = "COMMENT_END_DASH", e3[e3.COMMENT_END = 50] = "COMMENT_END", e3[e3.COMMENT_END_BANG = 51] = "COMMENT_END_BANG", e3[e3.DOCTYPE = 52] = "DOCTYPE", e3[e3.BEFORE_DOCTYPE_NAME = 53] = "BEFORE_DOCTYPE_NAME", e3[e3.DOCTYPE_NAME = 54] = "DOCTYPE_NAME", e3[e3.AFTER_DOCTYPE_NAME = 55] = "AFTER_DOCTYPE_NAME", e3[e3.AFTER_DOCTYPE_PUBLIC_KEYWORD = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD", e3[e3.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER", e3[e3.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED", e3[e3.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED", e3[e3.AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER", e3[e3.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS", e3[e3.AFTER_DOCTYPE_SYSTEM_KEYWORD = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD", e3[e3.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER", e3[e3.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED", e3[e3.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED", e3[e3.AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER", e3[e3.BOGUS_DOCTYPE = 67] = "BOGUS_DOCTYPE", e3[e3.CDATA_SECTION = 68] = "CDATA_SECTION", e3[e3.CDATA_SECTION_BRACKET = 69] = "CDATA_SECTION_BRACKET", e3[e3.CDATA_SECTION_END = 70] = "CDATA_SECTION_END", e3[e3.CHARACTER_REFERENCE = 71] = "CHARACTER_REFERENCE", e3[e3.NAMED_CHARACTER_REFERENCE = 72] = "NAMED_CHARACTER_REFERENCE", e3[e3.AMBIGUOUS_AMPERSAND = 73] = "AMBIGUOUS_AMPERSAND", e3[e3.NUMERIC_CHARACTER_REFERENCE = 74] = "NUMERIC_CHARACTER_REFERENCE", e3[e3.HEXADEMICAL_CHARACTER_REFERENCE_START = 75] = "HEXADEMICAL_CHARACTER_REFERENCE_START", e3[e3.HEXADEMICAL_CHARACTER_REFERENCE = 76] = "HEXADEMICAL_CHARACTER_REFERENCE", e3[e3.DECIMAL_CHARACTER_REFERENCE = 77] = "DECIMAL_CHARACTER_REFERENCE", e3[e3.NUMERIC_CHARACTER_REFERENCE_END = 78] = "NUMERIC_CHARACTER_REFERENCE_END";
  1102. }(P || (P = {}));
  1103. const k = { DATA: P.DATA, RCDATA: P.RCDATA, RAWTEXT: P.RAWTEXT, SCRIPT_DATA: P.SCRIPT_DATA, PLAINTEXT: P.PLAINTEXT, CDATA_SECTION: P.CDATA_SECTION };
  1104. function b(e3) {
  1105. return e3 >= a.DIGIT_0 && e3 <= a.DIGIT_9;
  1106. }
  1107. function B(e3) {
  1108. return e3 >= a.LATIN_CAPITAL_A && e3 <= a.LATIN_CAPITAL_Z;
  1109. }
  1110. function H(e3) {
  1111. return function(e4) {
  1112. return e4 >= a.LATIN_SMALL_A && e4 <= a.LATIN_SMALL_Z;
  1113. }(e3) || B(e3);
  1114. }
  1115. function F(e3) {
  1116. return H(e3) || b(e3);
  1117. }
  1118. function U(e3) {
  1119. return e3 >= a.LATIN_CAPITAL_A && e3 <= a.LATIN_CAPITAL_F;
  1120. }
  1121. function y(e3) {
  1122. return e3 >= a.LATIN_SMALL_A && e3 <= a.LATIN_SMALL_F;
  1123. }
  1124. function G(e3) {
  1125. return e3 + 32;
  1126. }
  1127. function w(e3) {
  1128. return e3 === a.SPACE || e3 === a.LINE_FEED || e3 === a.TABULATION || e3 === a.FORM_FEED;
  1129. }
  1130. function x(e3) {
  1131. return w(e3) || e3 === a.SOLIDUS || e3 === a.GREATER_THAN_SIGN;
  1132. }
  1133. class Y {
  1134. constructor(e3, t2) {
  1135. this.options = e3, this.handler = t2, this.paused = false, this.inLoop = false, this.inForeignNode = false, this.lastStartTagName = "", this.active = false, this.state = P.DATA, this.returnState = P.DATA, this.charRefCode = -1, this.consumedAfterSnapshot = -1, this.currentCharacterToken = null, this.currentToken = null, this.currentAttr = { name: "", value: "" }, this.preprocessor = new _(t2), this.currentLocation = this.getCurrentLocation(-1);
  1136. }
  1137. _err(e3) {
  1138. var t2, s2;
  1139. null === (s2 = (t2 = this.handler).onParseError) || void 0 === s2 || s2.call(t2, this.preprocessor.getError(e3));
  1140. }
  1141. getCurrentLocation(e3) {
  1142. return this.options.sourceCodeLocationInfo ? { startLine: this.preprocessor.line, startCol: this.preprocessor.col - e3, startOffset: this.preprocessor.offset - e3, endLine: -1, endCol: -1, endOffset: -1 } : null;
  1143. }
  1144. _runParsingLoop() {
  1145. if (!this.inLoop) {
  1146. for (this.inLoop = true; this.active && !this.paused; ) {
  1147. this.consumedAfterSnapshot = 0;
  1148. const e3 = this._consume();
  1149. this._ensureHibernation() || this._callState(e3);
  1150. }
  1151. this.inLoop = false;
  1152. }
  1153. }
  1154. pause() {
  1155. this.paused = true;
  1156. }
  1157. resume(e3) {
  1158. if (!this.paused) throw new Error("Parser was already resumed");
  1159. this.paused = false, this.inLoop || (this._runParsingLoop(), this.paused || null == e3 || e3());
  1160. }
  1161. write(e3, t2, s2) {
  1162. this.active = true, this.preprocessor.write(e3, t2), this._runParsingLoop(), this.paused || null == s2 || s2();
  1163. }
  1164. insertHtmlAtCurrentPos(e3) {
  1165. this.active = true, this.preprocessor.insertHtmlAtCurrentPos(e3), this._runParsingLoop();
  1166. }
  1167. _ensureHibernation() {
  1168. return !!this.preprocessor.endOfChunkHit && (this._unconsume(this.consumedAfterSnapshot), this.active = false, true);
  1169. }
  1170. _consume() {
  1171. return this.consumedAfterSnapshot++, this.preprocessor.advance();
  1172. }
  1173. _unconsume(e3) {
  1174. this.consumedAfterSnapshot -= e3, this.preprocessor.retreat(e3);
  1175. }
  1176. _reconsumeInState(e3, t2) {
  1177. this.state = e3, this._callState(t2);
  1178. }
  1179. _advanceBy(e3) {
  1180. this.consumedAfterSnapshot += e3;
  1181. for (let t2 = 0; t2 < e3; t2++) this.preprocessor.advance();
  1182. }
  1183. _consumeSequenceIfMatch(e3, t2) {
  1184. return !!this.preprocessor.startsWith(e3, t2) && (this._advanceBy(e3.length - 1), true);
  1185. }
  1186. _createStartTagToken() {
  1187. this.currentToken = { type: h.START_TAG, tagName: "", tagID: S.UNKNOWN, selfClosing: false, ackSelfClosing: false, attrs: [], location: this.getCurrentLocation(1) };
  1188. }
  1189. _createEndTagToken() {
  1190. this.currentToken = { type: h.END_TAG, tagName: "", tagID: S.UNKNOWN, selfClosing: false, ackSelfClosing: false, attrs: [], location: this.getCurrentLocation(2) };
  1191. }
  1192. _createCommentToken(e3) {
  1193. this.currentToken = { type: h.COMMENT, data: "", location: this.getCurrentLocation(e3) };
  1194. }
  1195. _createDoctypeToken(e3) {
  1196. this.currentToken = { type: h.DOCTYPE, name: e3, forceQuirks: false, publicId: null, systemId: null, location: this.currentLocation };
  1197. }
  1198. _createCharacterToken(e3, t2) {
  1199. this.currentCharacterToken = { type: e3, chars: t2, location: this.currentLocation };
  1200. }
  1201. _createAttr(e3) {
  1202. this.currentAttr = { name: e3, value: "" }, this.currentLocation = this.getCurrentLocation(0);
  1203. }
  1204. _leaveAttrName() {
  1205. var e3, t2;
  1206. const s2 = this.currentToken;
  1207. null === A(s2, this.currentAttr.name) ? (s2.attrs.push(this.currentAttr), s2.location && this.currentLocation && ((null !== (e3 = (t2 = s2.location).attrs) && void 0 !== e3 ? e3 : t2.attrs = /* @__PURE__ */ Object.create(null))[this.currentAttr.name] = this.currentLocation, this._leaveAttrValue())) : this._err(T.duplicateAttribute);
  1208. }
  1209. _leaveAttrValue() {
  1210. this.currentLocation && (this.currentLocation.endLine = this.preprocessor.line, this.currentLocation.endCol = this.preprocessor.col, this.currentLocation.endOffset = this.preprocessor.offset);
  1211. }
  1212. prepareToken(e3) {
  1213. this._emitCurrentCharacterToken(e3.location), this.currentToken = null, e3.location && (e3.location.endLine = this.preprocessor.line, e3.location.endCol = this.preprocessor.col + 1, e3.location.endOffset = this.preprocessor.offset + 1), this.currentLocation = this.getCurrentLocation(-1);
  1214. }
  1215. emitCurrentTagToken() {
  1216. const e3 = this.currentToken;
  1217. this.prepareToken(e3), e3.tagID = O(e3.tagName), e3.type === h.START_TAG ? (this.lastStartTagName = e3.tagName, this.handler.onStartTag(e3)) : (e3.attrs.length > 0 && this._err(T.endTagWithAttributes), e3.selfClosing && this._err(T.endTagWithTrailingSolidus), this.handler.onEndTag(e3)), this.preprocessor.dropParsedChunk();
  1218. }
  1219. emitCurrentComment(e3) {
  1220. this.prepareToken(e3), this.handler.onComment(e3), this.preprocessor.dropParsedChunk();
  1221. }
  1222. emitCurrentDoctype(e3) {
  1223. this.prepareToken(e3), this.handler.onDoctype(e3), this.preprocessor.dropParsedChunk();
  1224. }
  1225. _emitCurrentCharacterToken(e3) {
  1226. if (this.currentCharacterToken) {
  1227. switch (e3 && this.currentCharacterToken.location && (this.currentCharacterToken.location.endLine = e3.startLine, this.currentCharacterToken.location.endCol = e3.startCol, this.currentCharacterToken.location.endOffset = e3.startOffset), this.currentCharacterToken.type) {
  1228. case h.CHARACTER:
  1229. this.handler.onCharacter(this.currentCharacterToken);
  1230. break;
  1231. case h.NULL_CHARACTER:
  1232. this.handler.onNullCharacter(this.currentCharacterToken);
  1233. break;
  1234. case h.WHITESPACE_CHARACTER:
  1235. this.handler.onWhitespaceCharacter(this.currentCharacterToken);
  1236. }
  1237. this.currentCharacterToken = null;
  1238. }
  1239. }
  1240. _emitEOFToken() {
  1241. const e3 = this.getCurrentLocation(0);
  1242. e3 && (e3.endLine = e3.startLine, e3.endCol = e3.startCol, e3.endOffset = e3.startOffset), this._emitCurrentCharacterToken(e3), this.handler.onEof({ type: h.EOF, location: e3 }), this.active = false;
  1243. }
  1244. _appendCharToCurrentCharacterToken(e3, t2) {
  1245. if (this.currentCharacterToken) {
  1246. if (this.currentCharacterToken.type === e3) return void (this.currentCharacterToken.chars += t2);
  1247. this.currentLocation = this.getCurrentLocation(0), this._emitCurrentCharacterToken(this.currentLocation), this.preprocessor.dropParsedChunk();
  1248. }
  1249. this._createCharacterToken(e3, t2);
  1250. }
  1251. _emitCodePoint(e3) {
  1252. const t2 = w(e3) ? h.WHITESPACE_CHARACTER : e3 === a.NULL ? h.NULL_CHARACTER : h.CHARACTER;
  1253. this._appendCharToCurrentCharacterToken(t2, String.fromCodePoint(e3));
  1254. }
  1255. _emitChars(e3) {
  1256. this._appendCharToCurrentCharacterToken(h.CHARACTER, e3);
  1257. }
  1258. _matchNamedCharacterReference(e3) {
  1259. let t2 = null, s2 = 0, r2 = false;
  1260. for (let i2 = 0, o2 = m.htmlDecodeTree[0]; i2 >= 0 && (i2 = m.determineBranch(m.htmlDecodeTree, o2, i2 + 1, e3), !(i2 < 0)); e3 = this._consume()) {
  1261. s2 += 1, o2 = m.htmlDecodeTree[i2];
  1262. const c2 = o2 & m.BinTrieFlags.VALUE_LENGTH;
  1263. if (c2) {
  1264. const o3 = (c2 >> 14) - 1;
  1265. if (e3 !== a.SEMICOLON && this._isCharacterReferenceInAttribute() && ((n2 = this.preprocessor.peek(1)) === a.EQUALS_SIGN || F(n2)) ? (t2 = [a.AMPERSAND], i2 += o3) : (t2 = 0 === o3 ? [m.htmlDecodeTree[i2] & ~m.BinTrieFlags.VALUE_LENGTH] : 1 === o3 ? [m.htmlDecodeTree[++i2]] : [m.htmlDecodeTree[++i2], m.htmlDecodeTree[++i2]], s2 = 0, r2 = e3 !== a.SEMICOLON), 0 === o3) {
  1266. this._consume();
  1267. break;
  1268. }
  1269. }
  1270. }
  1271. var n2;
  1272. return this._unconsume(s2), r2 && !this.preprocessor.endOfChunkHit && this._err(T.missingSemicolonAfterCharacterReference), this._unconsume(1), t2;
  1273. }
  1274. _isCharacterReferenceInAttribute() {
  1275. return this.returnState === P.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === P.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === P.ATTRIBUTE_VALUE_UNQUOTED;
  1276. }
  1277. _flushCodePointConsumedAsCharacterReference(e3) {
  1278. this._isCharacterReferenceInAttribute() ? this.currentAttr.value += String.fromCodePoint(e3) : this._emitCodePoint(e3);
  1279. }
  1280. _callState(e3) {
  1281. switch (this.state) {
  1282. case P.DATA:
  1283. this._stateData(e3);
  1284. break;
  1285. case P.RCDATA:
  1286. this._stateRcdata(e3);
  1287. break;
  1288. case P.RAWTEXT:
  1289. this._stateRawtext(e3);
  1290. break;
  1291. case P.SCRIPT_DATA:
  1292. this._stateScriptData(e3);
  1293. break;
  1294. case P.PLAINTEXT:
  1295. this._statePlaintext(e3);
  1296. break;
  1297. case P.TAG_OPEN:
  1298. this._stateTagOpen(e3);
  1299. break;
  1300. case P.END_TAG_OPEN:
  1301. this._stateEndTagOpen(e3);
  1302. break;
  1303. case P.TAG_NAME:
  1304. this._stateTagName(e3);
  1305. break;
  1306. case P.RCDATA_LESS_THAN_SIGN:
  1307. this._stateRcdataLessThanSign(e3);
  1308. break;
  1309. case P.RCDATA_END_TAG_OPEN:
  1310. this._stateRcdataEndTagOpen(e3);
  1311. break;
  1312. case P.RCDATA_END_TAG_NAME:
  1313. this._stateRcdataEndTagName(e3);
  1314. break;
  1315. case P.RAWTEXT_LESS_THAN_SIGN:
  1316. this._stateRawtextLessThanSign(e3);
  1317. break;
  1318. case P.RAWTEXT_END_TAG_OPEN:
  1319. this._stateRawtextEndTagOpen(e3);
  1320. break;
  1321. case P.RAWTEXT_END_TAG_NAME:
  1322. this._stateRawtextEndTagName(e3);
  1323. break;
  1324. case P.SCRIPT_DATA_LESS_THAN_SIGN:
  1325. this._stateScriptDataLessThanSign(e3);
  1326. break;
  1327. case P.SCRIPT_DATA_END_TAG_OPEN:
  1328. this._stateScriptDataEndTagOpen(e3);
  1329. break;
  1330. case P.SCRIPT_DATA_END_TAG_NAME:
  1331. this._stateScriptDataEndTagName(e3);
  1332. break;
  1333. case P.SCRIPT_DATA_ESCAPE_START:
  1334. this._stateScriptDataEscapeStart(e3);
  1335. break;
  1336. case P.SCRIPT_DATA_ESCAPE_START_DASH:
  1337. this._stateScriptDataEscapeStartDash(e3);
  1338. break;
  1339. case P.SCRIPT_DATA_ESCAPED:
  1340. this._stateScriptDataEscaped(e3);
  1341. break;
  1342. case P.SCRIPT_DATA_ESCAPED_DASH:
  1343. this._stateScriptDataEscapedDash(e3);
  1344. break;
  1345. case P.SCRIPT_DATA_ESCAPED_DASH_DASH:
  1346. this._stateScriptDataEscapedDashDash(e3);
  1347. break;
  1348. case P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:
  1349. this._stateScriptDataEscapedLessThanSign(e3);
  1350. break;
  1351. case P.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:
  1352. this._stateScriptDataEscapedEndTagOpen(e3);
  1353. break;
  1354. case P.SCRIPT_DATA_ESCAPED_END_TAG_NAME:
  1355. this._stateScriptDataEscapedEndTagName(e3);
  1356. break;
  1357. case P.SCRIPT_DATA_DOUBLE_ESCAPE_START:
  1358. this._stateScriptDataDoubleEscapeStart(e3);
  1359. break;
  1360. case P.SCRIPT_DATA_DOUBLE_ESCAPED:
  1361. this._stateScriptDataDoubleEscaped(e3);
  1362. break;
  1363. case P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:
  1364. this._stateScriptDataDoubleEscapedDash(e3);
  1365. break;
  1366. case P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:
  1367. this._stateScriptDataDoubleEscapedDashDash(e3);
  1368. break;
  1369. case P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:
  1370. this._stateScriptDataDoubleEscapedLessThanSign(e3);
  1371. break;
  1372. case P.SCRIPT_DATA_DOUBLE_ESCAPE_END:
  1373. this._stateScriptDataDoubleEscapeEnd(e3);
  1374. break;
  1375. case P.BEFORE_ATTRIBUTE_NAME:
  1376. this._stateBeforeAttributeName(e3);
  1377. break;
  1378. case P.ATTRIBUTE_NAME:
  1379. this._stateAttributeName(e3);
  1380. break;
  1381. case P.AFTER_ATTRIBUTE_NAME:
  1382. this._stateAfterAttributeName(e3);
  1383. break;
  1384. case P.BEFORE_ATTRIBUTE_VALUE:
  1385. this._stateBeforeAttributeValue(e3);
  1386. break;
  1387. case P.ATTRIBUTE_VALUE_DOUBLE_QUOTED:
  1388. this._stateAttributeValueDoubleQuoted(e3);
  1389. break;
  1390. case P.ATTRIBUTE_VALUE_SINGLE_QUOTED:
  1391. this._stateAttributeValueSingleQuoted(e3);
  1392. break;
  1393. case P.ATTRIBUTE_VALUE_UNQUOTED:
  1394. this._stateAttributeValueUnquoted(e3);
  1395. break;
  1396. case P.AFTER_ATTRIBUTE_VALUE_QUOTED:
  1397. this._stateAfterAttributeValueQuoted(e3);
  1398. break;
  1399. case P.SELF_CLOSING_START_TAG:
  1400. this._stateSelfClosingStartTag(e3);
  1401. break;
  1402. case P.BOGUS_COMMENT:
  1403. this._stateBogusComment(e3);
  1404. break;
  1405. case P.MARKUP_DECLARATION_OPEN:
  1406. this._stateMarkupDeclarationOpen(e3);
  1407. break;
  1408. case P.COMMENT_START:
  1409. this._stateCommentStart(e3);
  1410. break;
  1411. case P.COMMENT_START_DASH:
  1412. this._stateCommentStartDash(e3);
  1413. break;
  1414. case P.COMMENT:
  1415. this._stateComment(e3);
  1416. break;
  1417. case P.COMMENT_LESS_THAN_SIGN:
  1418. this._stateCommentLessThanSign(e3);
  1419. break;
  1420. case P.COMMENT_LESS_THAN_SIGN_BANG:
  1421. this._stateCommentLessThanSignBang(e3);
  1422. break;
  1423. case P.COMMENT_LESS_THAN_SIGN_BANG_DASH:
  1424. this._stateCommentLessThanSignBangDash(e3);
  1425. break;
  1426. case P.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:
  1427. this._stateCommentLessThanSignBangDashDash(e3);
  1428. break;
  1429. case P.COMMENT_END_DASH:
  1430. this._stateCommentEndDash(e3);
  1431. break;
  1432. case P.COMMENT_END:
  1433. this._stateCommentEnd(e3);
  1434. break;
  1435. case P.COMMENT_END_BANG:
  1436. this._stateCommentEndBang(e3);
  1437. break;
  1438. case P.DOCTYPE:
  1439. this._stateDoctype(e3);
  1440. break;
  1441. case P.BEFORE_DOCTYPE_NAME:
  1442. this._stateBeforeDoctypeName(e3);
  1443. break;
  1444. case P.DOCTYPE_NAME:
  1445. this._stateDoctypeName(e3);
  1446. break;
  1447. case P.AFTER_DOCTYPE_NAME:
  1448. this._stateAfterDoctypeName(e3);
  1449. break;
  1450. case P.AFTER_DOCTYPE_PUBLIC_KEYWORD:
  1451. this._stateAfterDoctypePublicKeyword(e3);
  1452. break;
  1453. case P.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:
  1454. this._stateBeforeDoctypePublicIdentifier(e3);
  1455. break;
  1456. case P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:
  1457. this._stateDoctypePublicIdentifierDoubleQuoted(e3);
  1458. break;
  1459. case P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:
  1460. this._stateDoctypePublicIdentifierSingleQuoted(e3);
  1461. break;
  1462. case P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:
  1463. this._stateAfterDoctypePublicIdentifier(e3);
  1464. break;
  1465. case P.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:
  1466. this._stateBetweenDoctypePublicAndSystemIdentifiers(e3);
  1467. break;
  1468. case P.AFTER_DOCTYPE_SYSTEM_KEYWORD:
  1469. this._stateAfterDoctypeSystemKeyword(e3);
  1470. break;
  1471. case P.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:
  1472. this._stateBeforeDoctypeSystemIdentifier(e3);
  1473. break;
  1474. case P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:
  1475. this._stateDoctypeSystemIdentifierDoubleQuoted(e3);
  1476. break;
  1477. case P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:
  1478. this._stateDoctypeSystemIdentifierSingleQuoted(e3);
  1479. break;
  1480. case P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:
  1481. this._stateAfterDoctypeSystemIdentifier(e3);
  1482. break;
  1483. case P.BOGUS_DOCTYPE:
  1484. this._stateBogusDoctype(e3);
  1485. break;
  1486. case P.CDATA_SECTION:
  1487. this._stateCdataSection(e3);
  1488. break;
  1489. case P.CDATA_SECTION_BRACKET:
  1490. this._stateCdataSectionBracket(e3);
  1491. break;
  1492. case P.CDATA_SECTION_END:
  1493. this._stateCdataSectionEnd(e3);
  1494. break;
  1495. case P.CHARACTER_REFERENCE:
  1496. this._stateCharacterReference(e3);
  1497. break;
  1498. case P.NAMED_CHARACTER_REFERENCE:
  1499. this._stateNamedCharacterReference(e3);
  1500. break;
  1501. case P.AMBIGUOUS_AMPERSAND:
  1502. this._stateAmbiguousAmpersand(e3);
  1503. break;
  1504. case P.NUMERIC_CHARACTER_REFERENCE:
  1505. this._stateNumericCharacterReference(e3);
  1506. break;
  1507. case P.HEXADEMICAL_CHARACTER_REFERENCE_START:
  1508. this._stateHexademicalCharacterReferenceStart(e3);
  1509. break;
  1510. case P.HEXADEMICAL_CHARACTER_REFERENCE:
  1511. this._stateHexademicalCharacterReference(e3);
  1512. break;
  1513. case P.DECIMAL_CHARACTER_REFERENCE:
  1514. this._stateDecimalCharacterReference(e3);
  1515. break;
  1516. case P.NUMERIC_CHARACTER_REFERENCE_END:
  1517. this._stateNumericCharacterReferenceEnd(e3);
  1518. break;
  1519. default:
  1520. throw new Error("Unknown state");
  1521. }
  1522. }
  1523. _stateData(e3) {
  1524. switch (e3) {
  1525. case a.LESS_THAN_SIGN:
  1526. this.state = P.TAG_OPEN;
  1527. break;
  1528. case a.AMPERSAND:
  1529. this.returnState = P.DATA, this.state = P.CHARACTER_REFERENCE;
  1530. break;
  1531. case a.NULL:
  1532. this._err(T.unexpectedNullCharacter), this._emitCodePoint(e3);
  1533. break;
  1534. case a.EOF:
  1535. this._emitEOFToken();
  1536. break;
  1537. default:
  1538. this._emitCodePoint(e3);
  1539. }
  1540. }
  1541. _stateRcdata(e3) {
  1542. switch (e3) {
  1543. case a.AMPERSAND:
  1544. this.returnState = P.RCDATA, this.state = P.CHARACTER_REFERENCE;
  1545. break;
  1546. case a.LESS_THAN_SIGN:
  1547. this.state = P.RCDATA_LESS_THAN_SIGN;
  1548. break;
  1549. case a.NULL:
  1550. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1551. break;
  1552. case a.EOF:
  1553. this._emitEOFToken();
  1554. break;
  1555. default:
  1556. this._emitCodePoint(e3);
  1557. }
  1558. }
  1559. _stateRawtext(e3) {
  1560. switch (e3) {
  1561. case a.LESS_THAN_SIGN:
  1562. this.state = P.RAWTEXT_LESS_THAN_SIGN;
  1563. break;
  1564. case a.NULL:
  1565. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1566. break;
  1567. case a.EOF:
  1568. this._emitEOFToken();
  1569. break;
  1570. default:
  1571. this._emitCodePoint(e3);
  1572. }
  1573. }
  1574. _stateScriptData(e3) {
  1575. switch (e3) {
  1576. case a.LESS_THAN_SIGN:
  1577. this.state = P.SCRIPT_DATA_LESS_THAN_SIGN;
  1578. break;
  1579. case a.NULL:
  1580. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1581. break;
  1582. case a.EOF:
  1583. this._emitEOFToken();
  1584. break;
  1585. default:
  1586. this._emitCodePoint(e3);
  1587. }
  1588. }
  1589. _statePlaintext(e3) {
  1590. switch (e3) {
  1591. case a.NULL:
  1592. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1593. break;
  1594. case a.EOF:
  1595. this._emitEOFToken();
  1596. break;
  1597. default:
  1598. this._emitCodePoint(e3);
  1599. }
  1600. }
  1601. _stateTagOpen(e3) {
  1602. if (H(e3)) this._createStartTagToken(), this.state = P.TAG_NAME, this._stateTagName(e3);
  1603. else switch (e3) {
  1604. case a.EXCLAMATION_MARK:
  1605. this.state = P.MARKUP_DECLARATION_OPEN;
  1606. break;
  1607. case a.SOLIDUS:
  1608. this.state = P.END_TAG_OPEN;
  1609. break;
  1610. case a.QUESTION_MARK:
  1611. this._err(T.unexpectedQuestionMarkInsteadOfTagName), this._createCommentToken(1), this.state = P.BOGUS_COMMENT, this._stateBogusComment(e3);
  1612. break;
  1613. case a.EOF:
  1614. this._err(T.eofBeforeTagName), this._emitChars("<"), this._emitEOFToken();
  1615. break;
  1616. default:
  1617. this._err(T.invalidFirstCharacterOfTagName), this._emitChars("<"), this.state = P.DATA, this._stateData(e3);
  1618. }
  1619. }
  1620. _stateEndTagOpen(e3) {
  1621. if (H(e3)) this._createEndTagToken(), this.state = P.TAG_NAME, this._stateTagName(e3);
  1622. else switch (e3) {
  1623. case a.GREATER_THAN_SIGN:
  1624. this._err(T.missingEndTagName), this.state = P.DATA;
  1625. break;
  1626. case a.EOF:
  1627. this._err(T.eofBeforeTagName), this._emitChars("</"), this._emitEOFToken();
  1628. break;
  1629. default:
  1630. this._err(T.invalidFirstCharacterOfTagName), this._createCommentToken(2), this.state = P.BOGUS_COMMENT, this._stateBogusComment(e3);
  1631. }
  1632. }
  1633. _stateTagName(e3) {
  1634. const t2 = this.currentToken;
  1635. switch (e3) {
  1636. case a.SPACE:
  1637. case a.LINE_FEED:
  1638. case a.TABULATION:
  1639. case a.FORM_FEED:
  1640. this.state = P.BEFORE_ATTRIBUTE_NAME;
  1641. break;
  1642. case a.SOLIDUS:
  1643. this.state = P.SELF_CLOSING_START_TAG;
  1644. break;
  1645. case a.GREATER_THAN_SIGN:
  1646. this.state = P.DATA, this.emitCurrentTagToken();
  1647. break;
  1648. case a.NULL:
  1649. this._err(T.unexpectedNullCharacter), t2.tagName += s;
  1650. break;
  1651. case a.EOF:
  1652. this._err(T.eofInTag), this._emitEOFToken();
  1653. break;
  1654. default:
  1655. t2.tagName += String.fromCodePoint(B(e3) ? G(e3) : e3);
  1656. }
  1657. }
  1658. _stateRcdataLessThanSign(e3) {
  1659. e3 === a.SOLIDUS ? this.state = P.RCDATA_END_TAG_OPEN : (this._emitChars("<"), this.state = P.RCDATA, this._stateRcdata(e3));
  1660. }
  1661. _stateRcdataEndTagOpen(e3) {
  1662. H(e3) ? (this.state = P.RCDATA_END_TAG_NAME, this._stateRcdataEndTagName(e3)) : (this._emitChars("</"), this.state = P.RCDATA, this._stateRcdata(e3));
  1663. }
  1664. handleSpecialEndTag(e3) {
  1665. if (!this.preprocessor.startsWith(this.lastStartTagName, false)) return !this._ensureHibernation();
  1666. switch (this._createEndTagToken(), this.currentToken.tagName = this.lastStartTagName, this.preprocessor.peek(this.lastStartTagName.length)) {
  1667. case a.SPACE:
  1668. case a.LINE_FEED:
  1669. case a.TABULATION:
  1670. case a.FORM_FEED:
  1671. return this._advanceBy(this.lastStartTagName.length), this.state = P.BEFORE_ATTRIBUTE_NAME, false;
  1672. case a.SOLIDUS:
  1673. return this._advanceBy(this.lastStartTagName.length), this.state = P.SELF_CLOSING_START_TAG, false;
  1674. case a.GREATER_THAN_SIGN:
  1675. return this._advanceBy(this.lastStartTagName.length), this.emitCurrentTagToken(), this.state = P.DATA, false;
  1676. default:
  1677. return !this._ensureHibernation();
  1678. }
  1679. }
  1680. _stateRcdataEndTagName(e3) {
  1681. this.handleSpecialEndTag(e3) && (this._emitChars("</"), this.state = P.RCDATA, this._stateRcdata(e3));
  1682. }
  1683. _stateRawtextLessThanSign(e3) {
  1684. e3 === a.SOLIDUS ? this.state = P.RAWTEXT_END_TAG_OPEN : (this._emitChars("<"), this.state = P.RAWTEXT, this._stateRawtext(e3));
  1685. }
  1686. _stateRawtextEndTagOpen(e3) {
  1687. H(e3) ? (this.state = P.RAWTEXT_END_TAG_NAME, this._stateRawtextEndTagName(e3)) : (this._emitChars("</"), this.state = P.RAWTEXT, this._stateRawtext(e3));
  1688. }
  1689. _stateRawtextEndTagName(e3) {
  1690. this.handleSpecialEndTag(e3) && (this._emitChars("</"), this.state = P.RAWTEXT, this._stateRawtext(e3));
  1691. }
  1692. _stateScriptDataLessThanSign(e3) {
  1693. switch (e3) {
  1694. case a.SOLIDUS:
  1695. this.state = P.SCRIPT_DATA_END_TAG_OPEN;
  1696. break;
  1697. case a.EXCLAMATION_MARK:
  1698. this.state = P.SCRIPT_DATA_ESCAPE_START, this._emitChars("<!");
  1699. break;
  1700. default:
  1701. this._emitChars("<"), this.state = P.SCRIPT_DATA, this._stateScriptData(e3);
  1702. }
  1703. }
  1704. _stateScriptDataEndTagOpen(e3) {
  1705. H(e3) ? (this.state = P.SCRIPT_DATA_END_TAG_NAME, this._stateScriptDataEndTagName(e3)) : (this._emitChars("</"), this.state = P.SCRIPT_DATA, this._stateScriptData(e3));
  1706. }
  1707. _stateScriptDataEndTagName(e3) {
  1708. this.handleSpecialEndTag(e3) && (this._emitChars("</"), this.state = P.SCRIPT_DATA, this._stateScriptData(e3));
  1709. }
  1710. _stateScriptDataEscapeStart(e3) {
  1711. e3 === a.HYPHEN_MINUS ? (this.state = P.SCRIPT_DATA_ESCAPE_START_DASH, this._emitChars("-")) : (this.state = P.SCRIPT_DATA, this._stateScriptData(e3));
  1712. }
  1713. _stateScriptDataEscapeStartDash(e3) {
  1714. e3 === a.HYPHEN_MINUS ? (this.state = P.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-")) : (this.state = P.SCRIPT_DATA, this._stateScriptData(e3));
  1715. }
  1716. _stateScriptDataEscaped(e3) {
  1717. switch (e3) {
  1718. case a.HYPHEN_MINUS:
  1719. this.state = P.SCRIPT_DATA_ESCAPED_DASH, this._emitChars("-");
  1720. break;
  1721. case a.LESS_THAN_SIGN:
  1722. this.state = P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
  1723. break;
  1724. case a.NULL:
  1725. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1726. break;
  1727. case a.EOF:
  1728. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1729. break;
  1730. default:
  1731. this._emitCodePoint(e3);
  1732. }
  1733. }
  1734. _stateScriptDataEscapedDash(e3) {
  1735. switch (e3) {
  1736. case a.HYPHEN_MINUS:
  1737. this.state = P.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-");
  1738. break;
  1739. case a.LESS_THAN_SIGN:
  1740. this.state = P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
  1741. break;
  1742. case a.NULL:
  1743. this._err(T.unexpectedNullCharacter), this.state = P.SCRIPT_DATA_ESCAPED, this._emitChars(s);
  1744. break;
  1745. case a.EOF:
  1746. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1747. break;
  1748. default:
  1749. this.state = P.SCRIPT_DATA_ESCAPED, this._emitCodePoint(e3);
  1750. }
  1751. }
  1752. _stateScriptDataEscapedDashDash(e3) {
  1753. switch (e3) {
  1754. case a.HYPHEN_MINUS:
  1755. this._emitChars("-");
  1756. break;
  1757. case a.LESS_THAN_SIGN:
  1758. this.state = P.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
  1759. break;
  1760. case a.GREATER_THAN_SIGN:
  1761. this.state = P.SCRIPT_DATA, this._emitChars(">");
  1762. break;
  1763. case a.NULL:
  1764. this._err(T.unexpectedNullCharacter), this.state = P.SCRIPT_DATA_ESCAPED, this._emitChars(s);
  1765. break;
  1766. case a.EOF:
  1767. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1768. break;
  1769. default:
  1770. this.state = P.SCRIPT_DATA_ESCAPED, this._emitCodePoint(e3);
  1771. }
  1772. }
  1773. _stateScriptDataEscapedLessThanSign(e3) {
  1774. e3 === a.SOLIDUS ? this.state = P.SCRIPT_DATA_ESCAPED_END_TAG_OPEN : H(e3) ? (this._emitChars("<"), this.state = P.SCRIPT_DATA_DOUBLE_ESCAPE_START, this._stateScriptDataDoubleEscapeStart(e3)) : (this._emitChars("<"), this.state = P.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e3));
  1775. }
  1776. _stateScriptDataEscapedEndTagOpen(e3) {
  1777. H(e3) ? (this.state = P.SCRIPT_DATA_ESCAPED_END_TAG_NAME, this._stateScriptDataEscapedEndTagName(e3)) : (this._emitChars("</"), this.state = P.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e3));
  1778. }
  1779. _stateScriptDataEscapedEndTagName(e3) {
  1780. this.handleSpecialEndTag(e3) && (this._emitChars("</"), this.state = P.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e3));
  1781. }
  1782. _stateScriptDataDoubleEscapeStart(e3) {
  1783. if (this.preprocessor.startsWith(i, false) && x(this.preprocessor.peek(6))) {
  1784. this._emitCodePoint(e3);
  1785. for (let e4 = 0; e4 < 6; e4++) this._emitCodePoint(this._consume());
  1786. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED;
  1787. } else this._ensureHibernation() || (this.state = P.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e3));
  1788. }
  1789. _stateScriptDataDoubleEscaped(e3) {
  1790. switch (e3) {
  1791. case a.HYPHEN_MINUS:
  1792. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH, this._emitChars("-");
  1793. break;
  1794. case a.LESS_THAN_SIGN:
  1795. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
  1796. break;
  1797. case a.NULL:
  1798. this._err(T.unexpectedNullCharacter), this._emitChars(s);
  1799. break;
  1800. case a.EOF:
  1801. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1802. break;
  1803. default:
  1804. this._emitCodePoint(e3);
  1805. }
  1806. }
  1807. _stateScriptDataDoubleEscapedDash(e3) {
  1808. switch (e3) {
  1809. case a.HYPHEN_MINUS:
  1810. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH, this._emitChars("-");
  1811. break;
  1812. case a.LESS_THAN_SIGN:
  1813. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
  1814. break;
  1815. case a.NULL:
  1816. this._err(T.unexpectedNullCharacter), this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(s);
  1817. break;
  1818. case a.EOF:
  1819. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1820. break;
  1821. default:
  1822. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(e3);
  1823. }
  1824. }
  1825. _stateScriptDataDoubleEscapedDashDash(e3) {
  1826. switch (e3) {
  1827. case a.HYPHEN_MINUS:
  1828. this._emitChars("-");
  1829. break;
  1830. case a.LESS_THAN_SIGN:
  1831. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
  1832. break;
  1833. case a.GREATER_THAN_SIGN:
  1834. this.state = P.SCRIPT_DATA, this._emitChars(">");
  1835. break;
  1836. case a.NULL:
  1837. this._err(T.unexpectedNullCharacter), this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(s);
  1838. break;
  1839. case a.EOF:
  1840. this._err(T.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
  1841. break;
  1842. default:
  1843. this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(e3);
  1844. }
  1845. }
  1846. _stateScriptDataDoubleEscapedLessThanSign(e3) {
  1847. e3 === a.SOLIDUS ? (this.state = P.SCRIPT_DATA_DOUBLE_ESCAPE_END, this._emitChars("/")) : (this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(e3));
  1848. }
  1849. _stateScriptDataDoubleEscapeEnd(e3) {
  1850. if (this.preprocessor.startsWith(i, false) && x(this.preprocessor.peek(6))) {
  1851. this._emitCodePoint(e3);
  1852. for (let e4 = 0; e4 < 6; e4++) this._emitCodePoint(this._consume());
  1853. this.state = P.SCRIPT_DATA_ESCAPED;
  1854. } else this._ensureHibernation() || (this.state = P.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(e3));
  1855. }
  1856. _stateBeforeAttributeName(e3) {
  1857. switch (e3) {
  1858. case a.SPACE:
  1859. case a.LINE_FEED:
  1860. case a.TABULATION:
  1861. case a.FORM_FEED:
  1862. break;
  1863. case a.SOLIDUS:
  1864. case a.GREATER_THAN_SIGN:
  1865. case a.EOF:
  1866. this.state = P.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(e3);
  1867. break;
  1868. case a.EQUALS_SIGN:
  1869. this._err(T.unexpectedEqualsSignBeforeAttributeName), this._createAttr("="), this.state = P.ATTRIBUTE_NAME;
  1870. break;
  1871. default:
  1872. this._createAttr(""), this.state = P.ATTRIBUTE_NAME, this._stateAttributeName(e3);
  1873. }
  1874. }
  1875. _stateAttributeName(e3) {
  1876. switch (e3) {
  1877. case a.SPACE:
  1878. case a.LINE_FEED:
  1879. case a.TABULATION:
  1880. case a.FORM_FEED:
  1881. case a.SOLIDUS:
  1882. case a.GREATER_THAN_SIGN:
  1883. case a.EOF:
  1884. this._leaveAttrName(), this.state = P.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(e3);
  1885. break;
  1886. case a.EQUALS_SIGN:
  1887. this._leaveAttrName(), this.state = P.BEFORE_ATTRIBUTE_VALUE;
  1888. break;
  1889. case a.QUOTATION_MARK:
  1890. case a.APOSTROPHE:
  1891. case a.LESS_THAN_SIGN:
  1892. this._err(T.unexpectedCharacterInAttributeName), this.currentAttr.name += String.fromCodePoint(e3);
  1893. break;
  1894. case a.NULL:
  1895. this._err(T.unexpectedNullCharacter), this.currentAttr.name += s;
  1896. break;
  1897. default:
  1898. this.currentAttr.name += String.fromCodePoint(B(e3) ? G(e3) : e3);
  1899. }
  1900. }
  1901. _stateAfterAttributeName(e3) {
  1902. switch (e3) {
  1903. case a.SPACE:
  1904. case a.LINE_FEED:
  1905. case a.TABULATION:
  1906. case a.FORM_FEED:
  1907. break;
  1908. case a.SOLIDUS:
  1909. this.state = P.SELF_CLOSING_START_TAG;
  1910. break;
  1911. case a.EQUALS_SIGN:
  1912. this.state = P.BEFORE_ATTRIBUTE_VALUE;
  1913. break;
  1914. case a.GREATER_THAN_SIGN:
  1915. this.state = P.DATA, this.emitCurrentTagToken();
  1916. break;
  1917. case a.EOF:
  1918. this._err(T.eofInTag), this._emitEOFToken();
  1919. break;
  1920. default:
  1921. this._createAttr(""), this.state = P.ATTRIBUTE_NAME, this._stateAttributeName(e3);
  1922. }
  1923. }
  1924. _stateBeforeAttributeValue(e3) {
  1925. switch (e3) {
  1926. case a.SPACE:
  1927. case a.LINE_FEED:
  1928. case a.TABULATION:
  1929. case a.FORM_FEED:
  1930. break;
  1931. case a.QUOTATION_MARK:
  1932. this.state = P.ATTRIBUTE_VALUE_DOUBLE_QUOTED;
  1933. break;
  1934. case a.APOSTROPHE:
  1935. this.state = P.ATTRIBUTE_VALUE_SINGLE_QUOTED;
  1936. break;
  1937. case a.GREATER_THAN_SIGN:
  1938. this._err(T.missingAttributeValue), this.state = P.DATA, this.emitCurrentTagToken();
  1939. break;
  1940. default:
  1941. this.state = P.ATTRIBUTE_VALUE_UNQUOTED, this._stateAttributeValueUnquoted(e3);
  1942. }
  1943. }
  1944. _stateAttributeValueDoubleQuoted(e3) {
  1945. switch (e3) {
  1946. case a.QUOTATION_MARK:
  1947. this.state = P.AFTER_ATTRIBUTE_VALUE_QUOTED;
  1948. break;
  1949. case a.AMPERSAND:
  1950. this.returnState = P.ATTRIBUTE_VALUE_DOUBLE_QUOTED, this.state = P.CHARACTER_REFERENCE;
  1951. break;
  1952. case a.NULL:
  1953. this._err(T.unexpectedNullCharacter), this.currentAttr.value += s;
  1954. break;
  1955. case a.EOF:
  1956. this._err(T.eofInTag), this._emitEOFToken();
  1957. break;
  1958. default:
  1959. this.currentAttr.value += String.fromCodePoint(e3);
  1960. }
  1961. }
  1962. _stateAttributeValueSingleQuoted(e3) {
  1963. switch (e3) {
  1964. case a.APOSTROPHE:
  1965. this.state = P.AFTER_ATTRIBUTE_VALUE_QUOTED;
  1966. break;
  1967. case a.AMPERSAND:
  1968. this.returnState = P.ATTRIBUTE_VALUE_SINGLE_QUOTED, this.state = P.CHARACTER_REFERENCE;
  1969. break;
  1970. case a.NULL:
  1971. this._err(T.unexpectedNullCharacter), this.currentAttr.value += s;
  1972. break;
  1973. case a.EOF:
  1974. this._err(T.eofInTag), this._emitEOFToken();
  1975. break;
  1976. default:
  1977. this.currentAttr.value += String.fromCodePoint(e3);
  1978. }
  1979. }
  1980. _stateAttributeValueUnquoted(e3) {
  1981. switch (e3) {
  1982. case a.SPACE:
  1983. case a.LINE_FEED:
  1984. case a.TABULATION:
  1985. case a.FORM_FEED:
  1986. this._leaveAttrValue(), this.state = P.BEFORE_ATTRIBUTE_NAME;
  1987. break;
  1988. case a.AMPERSAND:
  1989. this.returnState = P.ATTRIBUTE_VALUE_UNQUOTED, this.state = P.CHARACTER_REFERENCE;
  1990. break;
  1991. case a.GREATER_THAN_SIGN:
  1992. this._leaveAttrValue(), this.state = P.DATA, this.emitCurrentTagToken();
  1993. break;
  1994. case a.NULL:
  1995. this._err(T.unexpectedNullCharacter), this.currentAttr.value += s;
  1996. break;
  1997. case a.QUOTATION_MARK:
  1998. case a.APOSTROPHE:
  1999. case a.LESS_THAN_SIGN:
  2000. case a.EQUALS_SIGN:
  2001. case a.GRAVE_ACCENT:
  2002. this._err(T.unexpectedCharacterInUnquotedAttributeValue), this.currentAttr.value += String.fromCodePoint(e3);
  2003. break;
  2004. case a.EOF:
  2005. this._err(T.eofInTag), this._emitEOFToken();
  2006. break;
  2007. default:
  2008. this.currentAttr.value += String.fromCodePoint(e3);
  2009. }
  2010. }
  2011. _stateAfterAttributeValueQuoted(e3) {
  2012. switch (e3) {
  2013. case a.SPACE:
  2014. case a.LINE_FEED:
  2015. case a.TABULATION:
  2016. case a.FORM_FEED:
  2017. this._leaveAttrValue(), this.state = P.BEFORE_ATTRIBUTE_NAME;
  2018. break;
  2019. case a.SOLIDUS:
  2020. this._leaveAttrValue(), this.state = P.SELF_CLOSING_START_TAG;
  2021. break;
  2022. case a.GREATER_THAN_SIGN:
  2023. this._leaveAttrValue(), this.state = P.DATA, this.emitCurrentTagToken();
  2024. break;
  2025. case a.EOF:
  2026. this._err(T.eofInTag), this._emitEOFToken();
  2027. break;
  2028. default:
  2029. this._err(T.missingWhitespaceBetweenAttributes), this.state = P.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(e3);
  2030. }
  2031. }
  2032. _stateSelfClosingStartTag(e3) {
  2033. switch (e3) {
  2034. case a.GREATER_THAN_SIGN:
  2035. this.currentToken.selfClosing = true, this.state = P.DATA, this.emitCurrentTagToken();
  2036. break;
  2037. case a.EOF:
  2038. this._err(T.eofInTag), this._emitEOFToken();
  2039. break;
  2040. default:
  2041. this._err(T.unexpectedSolidusInTag), this.state = P.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(e3);
  2042. }
  2043. }
  2044. _stateBogusComment(e3) {
  2045. const t2 = this.currentToken;
  2046. switch (e3) {
  2047. case a.GREATER_THAN_SIGN:
  2048. this.state = P.DATA, this.emitCurrentComment(t2);
  2049. break;
  2050. case a.EOF:
  2051. this.emitCurrentComment(t2), this._emitEOFToken();
  2052. break;
  2053. case a.NULL:
  2054. this._err(T.unexpectedNullCharacter), t2.data += s;
  2055. break;
  2056. default:
  2057. t2.data += String.fromCodePoint(e3);
  2058. }
  2059. }
  2060. _stateMarkupDeclarationOpen(e3) {
  2061. this._consumeSequenceIfMatch("--", true) ? (this._createCommentToken(3), this.state = P.COMMENT_START) : this._consumeSequenceIfMatch(n, false) ? (this.currentLocation = this.getCurrentLocation(8), this.state = P.DOCTYPE) : this._consumeSequenceIfMatch(r, true) ? this.inForeignNode ? this.state = P.CDATA_SECTION : (this._err(T.cdataInHtmlContent), this._createCommentToken(8), this.currentToken.data = "[CDATA[", this.state = P.BOGUS_COMMENT) : this._ensureHibernation() || (this._err(T.incorrectlyOpenedComment), this._createCommentToken(2), this.state = P.BOGUS_COMMENT, this._stateBogusComment(e3));
  2062. }
  2063. _stateCommentStart(e3) {
  2064. switch (e3) {
  2065. case a.HYPHEN_MINUS:
  2066. this.state = P.COMMENT_START_DASH;
  2067. break;
  2068. case a.GREATER_THAN_SIGN: {
  2069. this._err(T.abruptClosingOfEmptyComment), this.state = P.DATA;
  2070. const e4 = this.currentToken;
  2071. this.emitCurrentComment(e4);
  2072. break;
  2073. }
  2074. default:
  2075. this.state = P.COMMENT, this._stateComment(e3);
  2076. }
  2077. }
  2078. _stateCommentStartDash(e3) {
  2079. const t2 = this.currentToken;
  2080. switch (e3) {
  2081. case a.HYPHEN_MINUS:
  2082. this.state = P.COMMENT_END;
  2083. break;
  2084. case a.GREATER_THAN_SIGN:
  2085. this._err(T.abruptClosingOfEmptyComment), this.state = P.DATA, this.emitCurrentComment(t2);
  2086. break;
  2087. case a.EOF:
  2088. this._err(T.eofInComment), this.emitCurrentComment(t2), this._emitEOFToken();
  2089. break;
  2090. default:
  2091. t2.data += "-", this.state = P.COMMENT, this._stateComment(e3);
  2092. }
  2093. }
  2094. _stateComment(e3) {
  2095. const t2 = this.currentToken;
  2096. switch (e3) {
  2097. case a.HYPHEN_MINUS:
  2098. this.state = P.COMMENT_END_DASH;
  2099. break;
  2100. case a.LESS_THAN_SIGN:
  2101. t2.data += "<", this.state = P.COMMENT_LESS_THAN_SIGN;
  2102. break;
  2103. case a.NULL:
  2104. this._err(T.unexpectedNullCharacter), t2.data += s;
  2105. break;
  2106. case a.EOF:
  2107. this._err(T.eofInComment), this.emitCurrentComment(t2), this._emitEOFToken();
  2108. break;
  2109. default:
  2110. t2.data += String.fromCodePoint(e3);
  2111. }
  2112. }
  2113. _stateCommentLessThanSign(e3) {
  2114. const t2 = this.currentToken;
  2115. switch (e3) {
  2116. case a.EXCLAMATION_MARK:
  2117. t2.data += "!", this.state = P.COMMENT_LESS_THAN_SIGN_BANG;
  2118. break;
  2119. case a.LESS_THAN_SIGN:
  2120. t2.data += "<";
  2121. break;
  2122. default:
  2123. this.state = P.COMMENT, this._stateComment(e3);
  2124. }
  2125. }
  2126. _stateCommentLessThanSignBang(e3) {
  2127. e3 === a.HYPHEN_MINUS ? this.state = P.COMMENT_LESS_THAN_SIGN_BANG_DASH : (this.state = P.COMMENT, this._stateComment(e3));
  2128. }
  2129. _stateCommentLessThanSignBangDash(e3) {
  2130. e3 === a.HYPHEN_MINUS ? this.state = P.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH : (this.state = P.COMMENT_END_DASH, this._stateCommentEndDash(e3));
  2131. }
  2132. _stateCommentLessThanSignBangDashDash(e3) {
  2133. e3 !== a.GREATER_THAN_SIGN && e3 !== a.EOF && this._err(T.nestedComment), this.state = P.COMMENT_END, this._stateCommentEnd(e3);
  2134. }
  2135. _stateCommentEndDash(e3) {
  2136. const t2 = this.currentToken;
  2137. switch (e3) {
  2138. case a.HYPHEN_MINUS:
  2139. this.state = P.COMMENT_END;
  2140. break;
  2141. case a.EOF:
  2142. this._err(T.eofInComment), this.emitCurrentComment(t2), this._emitEOFToken();
  2143. break;
  2144. default:
  2145. t2.data += "-", this.state = P.COMMENT, this._stateComment(e3);
  2146. }
  2147. }
  2148. _stateCommentEnd(e3) {
  2149. const t2 = this.currentToken;
  2150. switch (e3) {
  2151. case a.GREATER_THAN_SIGN:
  2152. this.state = P.DATA, this.emitCurrentComment(t2);
  2153. break;
  2154. case a.EXCLAMATION_MARK:
  2155. this.state = P.COMMENT_END_BANG;
  2156. break;
  2157. case a.HYPHEN_MINUS:
  2158. t2.data += "-";
  2159. break;
  2160. case a.EOF:
  2161. this._err(T.eofInComment), this.emitCurrentComment(t2), this._emitEOFToken();
  2162. break;
  2163. default:
  2164. t2.data += "--", this.state = P.COMMENT, this._stateComment(e3);
  2165. }
  2166. }
  2167. _stateCommentEndBang(e3) {
  2168. const t2 = this.currentToken;
  2169. switch (e3) {
  2170. case a.HYPHEN_MINUS:
  2171. t2.data += "--!", this.state = P.COMMENT_END_DASH;
  2172. break;
  2173. case a.GREATER_THAN_SIGN:
  2174. this._err(T.incorrectlyClosedComment), this.state = P.DATA, this.emitCurrentComment(t2);
  2175. break;
  2176. case a.EOF:
  2177. this._err(T.eofInComment), this.emitCurrentComment(t2), this._emitEOFToken();
  2178. break;
  2179. default:
  2180. t2.data += "--!", this.state = P.COMMENT, this._stateComment(e3);
  2181. }
  2182. }
  2183. _stateDoctype(e3) {
  2184. switch (e3) {
  2185. case a.SPACE:
  2186. case a.LINE_FEED:
  2187. case a.TABULATION:
  2188. case a.FORM_FEED:
  2189. this.state = P.BEFORE_DOCTYPE_NAME;
  2190. break;
  2191. case a.GREATER_THAN_SIGN:
  2192. this.state = P.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(e3);
  2193. break;
  2194. case a.EOF: {
  2195. this._err(T.eofInDoctype), this._createDoctypeToken(null);
  2196. const e4 = this.currentToken;
  2197. e4.forceQuirks = true, this.emitCurrentDoctype(e4), this._emitEOFToken();
  2198. break;
  2199. }
  2200. default:
  2201. this._err(T.missingWhitespaceBeforeDoctypeName), this.state = P.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(e3);
  2202. }
  2203. }
  2204. _stateBeforeDoctypeName(e3) {
  2205. if (B(e3)) this._createDoctypeToken(String.fromCharCode(G(e3))), this.state = P.DOCTYPE_NAME;
  2206. else switch (e3) {
  2207. case a.SPACE:
  2208. case a.LINE_FEED:
  2209. case a.TABULATION:
  2210. case a.FORM_FEED:
  2211. break;
  2212. case a.NULL:
  2213. this._err(T.unexpectedNullCharacter), this._createDoctypeToken(s), this.state = P.DOCTYPE_NAME;
  2214. break;
  2215. case a.GREATER_THAN_SIGN: {
  2216. this._err(T.missingDoctypeName), this._createDoctypeToken(null);
  2217. const e4 = this.currentToken;
  2218. e4.forceQuirks = true, this.emitCurrentDoctype(e4), this.state = P.DATA;
  2219. break;
  2220. }
  2221. case a.EOF: {
  2222. this._err(T.eofInDoctype), this._createDoctypeToken(null);
  2223. const e4 = this.currentToken;
  2224. e4.forceQuirks = true, this.emitCurrentDoctype(e4), this._emitEOFToken();
  2225. break;
  2226. }
  2227. default:
  2228. this._createDoctypeToken(String.fromCodePoint(e3)), this.state = P.DOCTYPE_NAME;
  2229. }
  2230. }
  2231. _stateDoctypeName(e3) {
  2232. const t2 = this.currentToken;
  2233. switch (e3) {
  2234. case a.SPACE:
  2235. case a.LINE_FEED:
  2236. case a.TABULATION:
  2237. case a.FORM_FEED:
  2238. this.state = P.AFTER_DOCTYPE_NAME;
  2239. break;
  2240. case a.GREATER_THAN_SIGN:
  2241. this.state = P.DATA, this.emitCurrentDoctype(t2);
  2242. break;
  2243. case a.NULL:
  2244. this._err(T.unexpectedNullCharacter), t2.name += s;
  2245. break;
  2246. case a.EOF:
  2247. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2248. break;
  2249. default:
  2250. t2.name += String.fromCodePoint(B(e3) ? G(e3) : e3);
  2251. }
  2252. }
  2253. _stateAfterDoctypeName(e3) {
  2254. const t2 = this.currentToken;
  2255. switch (e3) {
  2256. case a.SPACE:
  2257. case a.LINE_FEED:
  2258. case a.TABULATION:
  2259. case a.FORM_FEED:
  2260. break;
  2261. case a.GREATER_THAN_SIGN:
  2262. this.state = P.DATA, this.emitCurrentDoctype(t2);
  2263. break;
  2264. case a.EOF:
  2265. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2266. break;
  2267. default:
  2268. this._consumeSequenceIfMatch("public", false) ? this.state = P.AFTER_DOCTYPE_PUBLIC_KEYWORD : this._consumeSequenceIfMatch("system", false) ? this.state = P.AFTER_DOCTYPE_SYSTEM_KEYWORD : this._ensureHibernation() || (this._err(T.invalidCharacterSequenceAfterDoctypeName), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3));
  2269. }
  2270. }
  2271. _stateAfterDoctypePublicKeyword(e3) {
  2272. const t2 = this.currentToken;
  2273. switch (e3) {
  2274. case a.SPACE:
  2275. case a.LINE_FEED:
  2276. case a.TABULATION:
  2277. case a.FORM_FEED:
  2278. this.state = P.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;
  2279. break;
  2280. case a.QUOTATION_MARK:
  2281. this._err(T.missingWhitespaceAfterDoctypePublicKeyword), t2.publicId = "", this.state = P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
  2282. break;
  2283. case a.APOSTROPHE:
  2284. this._err(T.missingWhitespaceAfterDoctypePublicKeyword), t2.publicId = "", this.state = P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
  2285. break;
  2286. case a.GREATER_THAN_SIGN:
  2287. this._err(T.missingDoctypePublicIdentifier), t2.forceQuirks = true, this.state = P.DATA, this.emitCurrentDoctype(t2);
  2288. break;
  2289. case a.EOF:
  2290. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2291. break;
  2292. default:
  2293. this._err(T.missingQuoteBeforeDoctypePublicIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2294. }
  2295. }
  2296. _stateBeforeDoctypePublicIdentifier(e3) {
  2297. const t2 = this.currentToken;
  2298. switch (e3) {
  2299. case a.SPACE:
  2300. case a.LINE_FEED:
  2301. case a.TABULATION:
  2302. case a.FORM_FEED:
  2303. break;
  2304. case a.QUOTATION_MARK:
  2305. t2.publicId = "", this.state = P.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
  2306. break;
  2307. case a.APOSTROPHE:
  2308. t2.publicId = "", this.state = P.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
  2309. break;
  2310. case a.GREATER_THAN_SIGN:
  2311. this._err(T.missingDoctypePublicIdentifier), t2.forceQuirks = true, this.state = P.DATA, this.emitCurrentDoctype(t2);
  2312. break;
  2313. case a.EOF:
  2314. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2315. break;
  2316. default:
  2317. this._err(T.missingQuoteBeforeDoctypePublicIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2318. }
  2319. }
  2320. _stateDoctypePublicIdentifierDoubleQuoted(e3) {
  2321. const t2 = this.currentToken;
  2322. switch (e3) {
  2323. case a.QUOTATION_MARK:
  2324. this.state = P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
  2325. break;
  2326. case a.NULL:
  2327. this._err(T.unexpectedNullCharacter), t2.publicId += s;
  2328. break;
  2329. case a.GREATER_THAN_SIGN:
  2330. this._err(T.abruptDoctypePublicIdentifier), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this.state = P.DATA;
  2331. break;
  2332. case a.EOF:
  2333. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2334. break;
  2335. default:
  2336. t2.publicId += String.fromCodePoint(e3);
  2337. }
  2338. }
  2339. _stateDoctypePublicIdentifierSingleQuoted(e3) {
  2340. const t2 = this.currentToken;
  2341. switch (e3) {
  2342. case a.APOSTROPHE:
  2343. this.state = P.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
  2344. break;
  2345. case a.NULL:
  2346. this._err(T.unexpectedNullCharacter), t2.publicId += s;
  2347. break;
  2348. case a.GREATER_THAN_SIGN:
  2349. this._err(T.abruptDoctypePublicIdentifier), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this.state = P.DATA;
  2350. break;
  2351. case a.EOF:
  2352. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2353. break;
  2354. default:
  2355. t2.publicId += String.fromCodePoint(e3);
  2356. }
  2357. }
  2358. _stateAfterDoctypePublicIdentifier(e3) {
  2359. const t2 = this.currentToken;
  2360. switch (e3) {
  2361. case a.SPACE:
  2362. case a.LINE_FEED:
  2363. case a.TABULATION:
  2364. case a.FORM_FEED:
  2365. this.state = P.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;
  2366. break;
  2367. case a.GREATER_THAN_SIGN:
  2368. this.state = P.DATA, this.emitCurrentDoctype(t2);
  2369. break;
  2370. case a.QUOTATION_MARK:
  2371. this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  2372. break;
  2373. case a.APOSTROPHE:
  2374. this._err(T.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  2375. break;
  2376. case a.EOF:
  2377. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2378. break;
  2379. default:
  2380. this._err(T.missingQuoteBeforeDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2381. }
  2382. }
  2383. _stateBetweenDoctypePublicAndSystemIdentifiers(e3) {
  2384. const t2 = this.currentToken;
  2385. switch (e3) {
  2386. case a.SPACE:
  2387. case a.LINE_FEED:
  2388. case a.TABULATION:
  2389. case a.FORM_FEED:
  2390. break;
  2391. case a.GREATER_THAN_SIGN:
  2392. this.emitCurrentDoctype(t2), this.state = P.DATA;
  2393. break;
  2394. case a.QUOTATION_MARK:
  2395. t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  2396. break;
  2397. case a.APOSTROPHE:
  2398. t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  2399. break;
  2400. case a.EOF:
  2401. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2402. break;
  2403. default:
  2404. this._err(T.missingQuoteBeforeDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2405. }
  2406. }
  2407. _stateAfterDoctypeSystemKeyword(e3) {
  2408. const t2 = this.currentToken;
  2409. switch (e3) {
  2410. case a.SPACE:
  2411. case a.LINE_FEED:
  2412. case a.TABULATION:
  2413. case a.FORM_FEED:
  2414. this.state = P.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;
  2415. break;
  2416. case a.QUOTATION_MARK:
  2417. this._err(T.missingWhitespaceAfterDoctypeSystemKeyword), t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  2418. break;
  2419. case a.APOSTROPHE:
  2420. this._err(T.missingWhitespaceAfterDoctypeSystemKeyword), t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  2421. break;
  2422. case a.GREATER_THAN_SIGN:
  2423. this._err(T.missingDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.DATA, this.emitCurrentDoctype(t2);
  2424. break;
  2425. case a.EOF:
  2426. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2427. break;
  2428. default:
  2429. this._err(T.missingQuoteBeforeDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2430. }
  2431. }
  2432. _stateBeforeDoctypeSystemIdentifier(e3) {
  2433. const t2 = this.currentToken;
  2434. switch (e3) {
  2435. case a.SPACE:
  2436. case a.LINE_FEED:
  2437. case a.TABULATION:
  2438. case a.FORM_FEED:
  2439. break;
  2440. case a.QUOTATION_MARK:
  2441. t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
  2442. break;
  2443. case a.APOSTROPHE:
  2444. t2.systemId = "", this.state = P.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
  2445. break;
  2446. case a.GREATER_THAN_SIGN:
  2447. this._err(T.missingDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.DATA, this.emitCurrentDoctype(t2);
  2448. break;
  2449. case a.EOF:
  2450. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2451. break;
  2452. default:
  2453. this._err(T.missingQuoteBeforeDoctypeSystemIdentifier), t2.forceQuirks = true, this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2454. }
  2455. }
  2456. _stateDoctypeSystemIdentifierDoubleQuoted(e3) {
  2457. const t2 = this.currentToken;
  2458. switch (e3) {
  2459. case a.QUOTATION_MARK:
  2460. this.state = P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
  2461. break;
  2462. case a.NULL:
  2463. this._err(T.unexpectedNullCharacter), t2.systemId += s;
  2464. break;
  2465. case a.GREATER_THAN_SIGN:
  2466. this._err(T.abruptDoctypeSystemIdentifier), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this.state = P.DATA;
  2467. break;
  2468. case a.EOF:
  2469. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2470. break;
  2471. default:
  2472. t2.systemId += String.fromCodePoint(e3);
  2473. }
  2474. }
  2475. _stateDoctypeSystemIdentifierSingleQuoted(e3) {
  2476. const t2 = this.currentToken;
  2477. switch (e3) {
  2478. case a.APOSTROPHE:
  2479. this.state = P.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
  2480. break;
  2481. case a.NULL:
  2482. this._err(T.unexpectedNullCharacter), t2.systemId += s;
  2483. break;
  2484. case a.GREATER_THAN_SIGN:
  2485. this._err(T.abruptDoctypeSystemIdentifier), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this.state = P.DATA;
  2486. break;
  2487. case a.EOF:
  2488. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2489. break;
  2490. default:
  2491. t2.systemId += String.fromCodePoint(e3);
  2492. }
  2493. }
  2494. _stateAfterDoctypeSystemIdentifier(e3) {
  2495. const t2 = this.currentToken;
  2496. switch (e3) {
  2497. case a.SPACE:
  2498. case a.LINE_FEED:
  2499. case a.TABULATION:
  2500. case a.FORM_FEED:
  2501. break;
  2502. case a.GREATER_THAN_SIGN:
  2503. this.emitCurrentDoctype(t2), this.state = P.DATA;
  2504. break;
  2505. case a.EOF:
  2506. this._err(T.eofInDoctype), t2.forceQuirks = true, this.emitCurrentDoctype(t2), this._emitEOFToken();
  2507. break;
  2508. default:
  2509. this._err(T.unexpectedCharacterAfterDoctypeSystemIdentifier), this.state = P.BOGUS_DOCTYPE, this._stateBogusDoctype(e3);
  2510. }
  2511. }
  2512. _stateBogusDoctype(e3) {
  2513. const t2 = this.currentToken;
  2514. switch (e3) {
  2515. case a.GREATER_THAN_SIGN:
  2516. this.emitCurrentDoctype(t2), this.state = P.DATA;
  2517. break;
  2518. case a.NULL:
  2519. this._err(T.unexpectedNullCharacter);
  2520. break;
  2521. case a.EOF:
  2522. this.emitCurrentDoctype(t2), this._emitEOFToken();
  2523. }
  2524. }
  2525. _stateCdataSection(e3) {
  2526. switch (e3) {
  2527. case a.RIGHT_SQUARE_BRACKET:
  2528. this.state = P.CDATA_SECTION_BRACKET;
  2529. break;
  2530. case a.EOF:
  2531. this._err(T.eofInCdata), this._emitEOFToken();
  2532. break;
  2533. default:
  2534. this._emitCodePoint(e3);
  2535. }
  2536. }
  2537. _stateCdataSectionBracket(e3) {
  2538. e3 === a.RIGHT_SQUARE_BRACKET ? this.state = P.CDATA_SECTION_END : (this._emitChars("]"), this.state = P.CDATA_SECTION, this._stateCdataSection(e3));
  2539. }
  2540. _stateCdataSectionEnd(e3) {
  2541. switch (e3) {
  2542. case a.GREATER_THAN_SIGN:
  2543. this.state = P.DATA;
  2544. break;
  2545. case a.RIGHT_SQUARE_BRACKET:
  2546. this._emitChars("]");
  2547. break;
  2548. default:
  2549. this._emitChars("]]"), this.state = P.CDATA_SECTION, this._stateCdataSection(e3);
  2550. }
  2551. }
  2552. _stateCharacterReference(e3) {
  2553. e3 === a.NUMBER_SIGN ? this.state = P.NUMERIC_CHARACTER_REFERENCE : F(e3) ? (this.state = P.NAMED_CHARACTER_REFERENCE, this._stateNamedCharacterReference(e3)) : (this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND), this._reconsumeInState(this.returnState, e3));
  2554. }
  2555. _stateNamedCharacterReference(e3) {
  2556. const t2 = this._matchNamedCharacterReference(e3);
  2557. if (this._ensureHibernation()) ;
  2558. else if (t2) {
  2559. for (let e4 = 0; e4 < t2.length; e4++) this._flushCodePointConsumedAsCharacterReference(t2[e4]);
  2560. this.state = this.returnState;
  2561. } else this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND), this.state = P.AMBIGUOUS_AMPERSAND;
  2562. }
  2563. _stateAmbiguousAmpersand(e3) {
  2564. F(e3) ? this._flushCodePointConsumedAsCharacterReference(e3) : (e3 === a.SEMICOLON && this._err(T.unknownNamedCharacterReference), this._reconsumeInState(this.returnState, e3));
  2565. }
  2566. _stateNumericCharacterReference(e3) {
  2567. this.charRefCode = 0, e3 === a.LATIN_SMALL_X || e3 === a.LATIN_CAPITAL_X ? this.state = P.HEXADEMICAL_CHARACTER_REFERENCE_START : b(e3) ? (this.state = P.DECIMAL_CHARACTER_REFERENCE, this._stateDecimalCharacterReference(e3)) : (this._err(T.absenceOfDigitsInNumericCharacterReference), this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND), this._flushCodePointConsumedAsCharacterReference(a.NUMBER_SIGN), this._reconsumeInState(this.returnState, e3));
  2568. }
  2569. _stateHexademicalCharacterReferenceStart(e3) {
  2570. !function(e4) {
  2571. return b(e4) || U(e4) || y(e4);
  2572. }(e3) ? (this._err(T.absenceOfDigitsInNumericCharacterReference), this._flushCodePointConsumedAsCharacterReference(a.AMPERSAND), this._flushCodePointConsumedAsCharacterReference(a.NUMBER_SIGN), this._unconsume(2), this.state = this.returnState) : (this.state = P.HEXADEMICAL_CHARACTER_REFERENCE, this._stateHexademicalCharacterReference(e3));
  2573. }
  2574. _stateHexademicalCharacterReference(e3) {
  2575. U(e3) ? this.charRefCode = 16 * this.charRefCode + e3 - 55 : y(e3) ? this.charRefCode = 16 * this.charRefCode + e3 - 87 : b(e3) ? this.charRefCode = 16 * this.charRefCode + e3 - 48 : e3 === a.SEMICOLON ? this.state = P.NUMERIC_CHARACTER_REFERENCE_END : (this._err(T.missingSemicolonAfterCharacterReference), this.state = P.NUMERIC_CHARACTER_REFERENCE_END, this._stateNumericCharacterReferenceEnd(e3));
  2576. }
  2577. _stateDecimalCharacterReference(e3) {
  2578. b(e3) ? this.charRefCode = 10 * this.charRefCode + e3 - 48 : e3 === a.SEMICOLON ? this.state = P.NUMERIC_CHARACTER_REFERENCE_END : (this._err(T.missingSemicolonAfterCharacterReference), this.state = P.NUMERIC_CHARACTER_REFERENCE_END, this._stateNumericCharacterReferenceEnd(e3));
  2579. }
  2580. _stateNumericCharacterReferenceEnd(e3) {
  2581. if (this.charRefCode === a.NULL) this._err(T.nullCharacterReference), this.charRefCode = a.REPLACEMENT_CHARACTER;
  2582. else if (this.charRefCode > 1114111) this._err(T.characterReferenceOutsideUnicodeRange), this.charRefCode = a.REPLACEMENT_CHARACTER;
  2583. else if (o(this.charRefCode)) this._err(T.surrogateCharacterReference), this.charRefCode = a.REPLACEMENT_CHARACTER;
  2584. else if (E(this.charRefCode)) this._err(T.noncharacterCharacterReference);
  2585. else if (c(this.charRefCode) || this.charRefCode === a.CARRIAGE_RETURN) {
  2586. this._err(T.controlCharacterReference);
  2587. const e4 = g.get(this.charRefCode);
  2588. void 0 !== e4 && (this.charRefCode = e4);
  2589. }
  2590. this._flushCodePointConsumedAsCharacterReference(this.charRefCode), this._reconsumeInState(this.returnState, e3);
  2591. }
  2592. }
  2593. const v = /* @__PURE__ */ new Set([S.DD, S.DT, S.LI, S.OPTGROUP, S.OPTION, S.P, S.RB, S.RP, S.RT, S.RTC]), Q = /* @__PURE__ */ new Set([...v, S.CAPTION, S.COLGROUP, S.TBODY, S.TD, S.TFOOT, S.TH, S.THEAD, S.TR]), q = /* @__PURE__ */ new Map([[S.APPLET, u.HTML], [S.CAPTION, u.HTML], [S.HTML, u.HTML], [S.MARQUEE, u.HTML], [S.OBJECT, u.HTML], [S.TABLE, u.HTML], [S.TD, u.HTML], [S.TEMPLATE, u.HTML], [S.TH, u.HTML], [S.ANNOTATION_XML, u.MATHML], [S.MI, u.MATHML], [S.MN, u.MATHML], [S.MO, u.MATHML], [S.MS, u.MATHML], [S.MTEXT, u.MATHML], [S.DESC, u.SVG], [S.FOREIGN_OBJECT, u.SVG], [S.TITLE, u.SVG]]), W = [S.H1, S.H2, S.H3, S.H4, S.H5, S.H6], X = [S.TR, S.TEMPLATE, S.HTML], K = [S.TBODY, S.TFOOT, S.THEAD, S.TEMPLATE, S.HTML], V = [S.TABLE, S.TEMPLATE, S.HTML], z = [S.TD, S.TH];
  2594. class j {
  2595. get currentTmplContentOrNode() {
  2596. return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;
  2597. }
  2598. constructor(e3, t2, s2) {
  2599. this.treeAdapter = t2, this.handler = s2, this.items = [], this.tagIDs = [], this.stackTop = -1, this.tmplCount = 0, this.currentTagId = S.UNKNOWN, this.current = e3;
  2600. }
  2601. _indexOf(e3) {
  2602. return this.items.lastIndexOf(e3, this.stackTop);
  2603. }
  2604. _isInTemplate() {
  2605. return this.currentTagId === S.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === u.HTML;
  2606. }
  2607. _updateCurrentElement() {
  2608. this.current = this.items[this.stackTop], this.currentTagId = this.tagIDs[this.stackTop];
  2609. }
  2610. push(e3, t2) {
  2611. this.stackTop++, this.items[this.stackTop] = e3, this.current = e3, this.tagIDs[this.stackTop] = t2, this.currentTagId = t2, this._isInTemplate() && this.tmplCount++, this.handler.onItemPush(e3, t2, true);
  2612. }
  2613. pop() {
  2614. const e3 = this.current;
  2615. this.tmplCount > 0 && this._isInTemplate() && this.tmplCount--, this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e3, true);
  2616. }
  2617. replace(e3, t2) {
  2618. const s2 = this._indexOf(e3);
  2619. this.items[s2] = t2, s2 === this.stackTop && (this.current = t2);
  2620. }
  2621. insertAfter(e3, t2, s2) {
  2622. const a2 = this._indexOf(e3) + 1;
  2623. this.items.splice(a2, 0, t2), this.tagIDs.splice(a2, 0, s2), this.stackTop++, a2 === this.stackTop && this._updateCurrentElement(), this.handler.onItemPush(this.current, this.currentTagId, a2 === this.stackTop);
  2624. }
  2625. popUntilTagNamePopped(e3) {
  2626. let t2 = this.stackTop + 1;
  2627. do {
  2628. t2 = this.tagIDs.lastIndexOf(e3, t2 - 1);
  2629. } while (t2 > 0 && this.treeAdapter.getNamespaceURI(this.items[t2]) !== u.HTML);
  2630. this.shortenToLength(t2 < 0 ? 0 : t2);
  2631. }
  2632. shortenToLength(e3) {
  2633. for (; this.stackTop >= e3; ) {
  2634. const t2 = this.current;
  2635. this.tmplCount > 0 && this._isInTemplate() && (this.tmplCount -= 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(t2, this.stackTop < e3);
  2636. }
  2637. }
  2638. popUntilElementPopped(e3) {
  2639. const t2 = this._indexOf(e3);
  2640. this.shortenToLength(t2 < 0 ? 0 : t2);
  2641. }
  2642. popUntilPopped(e3, t2) {
  2643. const s2 = this._indexOfTagNames(e3, t2);
  2644. this.shortenToLength(s2 < 0 ? 0 : s2);
  2645. }
  2646. popUntilNumberedHeaderPopped() {
  2647. this.popUntilPopped(W, u.HTML);
  2648. }
  2649. popUntilTableCellPopped() {
  2650. this.popUntilPopped(z, u.HTML);
  2651. }
  2652. popAllUpToHtmlElement() {
  2653. this.tmplCount = 0, this.shortenToLength(1);
  2654. }
  2655. _indexOfTagNames(e3, t2) {
  2656. for (let s2 = this.stackTop; s2 >= 0; s2--) if (e3.includes(this.tagIDs[s2]) && this.treeAdapter.getNamespaceURI(this.items[s2]) === t2) return s2;
  2657. return -1;
  2658. }
  2659. clearBackTo(e3, t2) {
  2660. const s2 = this._indexOfTagNames(e3, t2);
  2661. this.shortenToLength(s2 + 1);
  2662. }
  2663. clearBackToTableContext() {
  2664. this.clearBackTo(V, u.HTML);
  2665. }
  2666. clearBackToTableBodyContext() {
  2667. this.clearBackTo(K, u.HTML);
  2668. }
  2669. clearBackToTableRowContext() {
  2670. this.clearBackTo(X, u.HTML);
  2671. }
  2672. remove(e3) {
  2673. const t2 = this._indexOf(e3);
  2674. t2 >= 0 && (t2 === this.stackTop ? this.pop() : (this.items.splice(t2, 1), this.tagIDs.splice(t2, 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e3, false)));
  2675. }
  2676. tryPeekProperlyNestedBodyElement() {
  2677. return this.stackTop >= 1 && this.tagIDs[1] === S.BODY ? this.items[1] : null;
  2678. }
  2679. contains(e3) {
  2680. return this._indexOf(e3) > -1;
  2681. }
  2682. getCommonAncestor(e3) {
  2683. const t2 = this._indexOf(e3) - 1;
  2684. return t2 >= 0 ? this.items[t2] : null;
  2685. }
  2686. isRootHtmlElementCurrent() {
  2687. return 0 === this.stackTop && this.tagIDs[0] === S.HTML;
  2688. }
  2689. hasInScope(e3) {
  2690. for (let t2 = this.stackTop; t2 >= 0; t2--) {
  2691. const s2 = this.tagIDs[t2], a2 = this.treeAdapter.getNamespaceURI(this.items[t2]);
  2692. if (s2 === e3 && a2 === u.HTML) return true;
  2693. if (q.get(s2) === a2) return false;
  2694. }
  2695. return true;
  2696. }
  2697. hasNumberedHeaderInScope() {
  2698. for (let e3 = this.stackTop; e3 >= 0; e3--) {
  2699. const t2 = this.tagIDs[e3], s2 = this.treeAdapter.getNamespaceURI(this.items[e3]);
  2700. if (M(t2) && s2 === u.HTML) return true;
  2701. if (q.get(t2) === s2) return false;
  2702. }
  2703. return true;
  2704. }
  2705. hasInListItemScope(e3) {
  2706. for (let t2 = this.stackTop; t2 >= 0; t2--) {
  2707. const s2 = this.tagIDs[t2], a2 = this.treeAdapter.getNamespaceURI(this.items[t2]);
  2708. if (s2 === e3 && a2 === u.HTML) return true;
  2709. if ((s2 === S.UL || s2 === S.OL) && a2 === u.HTML || q.get(s2) === a2) return false;
  2710. }
  2711. return true;
  2712. }
  2713. hasInButtonScope(e3) {
  2714. for (let t2 = this.stackTop; t2 >= 0; t2--) {
  2715. const s2 = this.tagIDs[t2], a2 = this.treeAdapter.getNamespaceURI(this.items[t2]);
  2716. if (s2 === e3 && a2 === u.HTML) return true;
  2717. if (s2 === S.BUTTON && a2 === u.HTML || q.get(s2) === a2) return false;
  2718. }
  2719. return true;
  2720. }
  2721. hasInTableScope(e3) {
  2722. for (let t2 = this.stackTop; t2 >= 0; t2--) {
  2723. const s2 = this.tagIDs[t2];
  2724. if (this.treeAdapter.getNamespaceURI(this.items[t2]) === u.HTML) {
  2725. if (s2 === e3) return true;
  2726. if (s2 === S.TABLE || s2 === S.TEMPLATE || s2 === S.HTML) return false;
  2727. }
  2728. }
  2729. return true;
  2730. }
  2731. hasTableBodyContextInTableScope() {
  2732. for (let e3 = this.stackTop; e3 >= 0; e3--) {
  2733. const t2 = this.tagIDs[e3];
  2734. if (this.treeAdapter.getNamespaceURI(this.items[e3]) === u.HTML) {
  2735. if (t2 === S.TBODY || t2 === S.THEAD || t2 === S.TFOOT) return true;
  2736. if (t2 === S.TABLE || t2 === S.HTML) return false;
  2737. }
  2738. }
  2739. return true;
  2740. }
  2741. hasInSelectScope(e3) {
  2742. for (let t2 = this.stackTop; t2 >= 0; t2--) {
  2743. const s2 = this.tagIDs[t2];
  2744. if (this.treeAdapter.getNamespaceURI(this.items[t2]) === u.HTML) {
  2745. if (s2 === e3) return true;
  2746. if (s2 !== S.OPTION && s2 !== S.OPTGROUP) return false;
  2747. }
  2748. }
  2749. return true;
  2750. }
  2751. generateImpliedEndTags() {
  2752. for (; v.has(this.currentTagId); ) this.pop();
  2753. }
  2754. generateImpliedEndTagsThoroughly() {
  2755. for (; Q.has(this.currentTagId); ) this.pop();
  2756. }
  2757. generateImpliedEndTagsWithExclusion(e3) {
  2758. for (; this.currentTagId !== e3 && Q.has(this.currentTagId); ) this.pop();
  2759. }
  2760. }
  2761. var J;
  2762. !function(e3) {
  2763. e3[e3.Marker = 0] = "Marker", e3[e3.Element = 1] = "Element";
  2764. }(J = J || (J = {}));
  2765. const Z = { type: J.Marker };
  2766. class $ {
  2767. constructor(e3) {
  2768. this.treeAdapter = e3, this.entries = [], this.bookmark = null;
  2769. }
  2770. _getNoahArkConditionCandidates(e3, t2) {
  2771. const s2 = [], a2 = t2.length, r2 = this.treeAdapter.getTagName(e3), n2 = this.treeAdapter.getNamespaceURI(e3);
  2772. for (let e4 = 0; e4 < this.entries.length; e4++) {
  2773. const t3 = this.entries[e4];
  2774. if (t3.type === J.Marker) break;
  2775. const { element: i2 } = t3;
  2776. if (this.treeAdapter.getTagName(i2) === r2 && this.treeAdapter.getNamespaceURI(i2) === n2) {
  2777. const t4 = this.treeAdapter.getAttrList(i2);
  2778. t4.length === a2 && s2.push({ idx: e4, attrs: t4 });
  2779. }
  2780. }
  2781. return s2;
  2782. }
  2783. _ensureNoahArkCondition(e3) {
  2784. if (this.entries.length < 3) return;
  2785. const t2 = this.treeAdapter.getAttrList(e3), s2 = this._getNoahArkConditionCandidates(e3, t2);
  2786. if (s2.length < 3) return;
  2787. const a2 = new Map(t2.map((e4) => [e4.name, e4.value]));
  2788. let r2 = 0;
  2789. for (let e4 = 0; e4 < s2.length; e4++) {
  2790. const t3 = s2[e4];
  2791. t3.attrs.every((e5) => a2.get(e5.name) === e5.value) && (r2 += 1, r2 >= 3 && this.entries.splice(t3.idx, 1));
  2792. }
  2793. }
  2794. insertMarker() {
  2795. this.entries.unshift(Z);
  2796. }
  2797. pushElement(e3, t2) {
  2798. this._ensureNoahArkCondition(e3), this.entries.unshift({ type: J.Element, element: e3, token: t2 });
  2799. }
  2800. insertElementAfterBookmark(e3, t2) {
  2801. const s2 = this.entries.indexOf(this.bookmark);
  2802. this.entries.splice(s2, 0, { type: J.Element, element: e3, token: t2 });
  2803. }
  2804. removeEntry(e3) {
  2805. const t2 = this.entries.indexOf(e3);
  2806. t2 >= 0 && this.entries.splice(t2, 1);
  2807. }
  2808. clearToLastMarker() {
  2809. const e3 = this.entries.indexOf(Z);
  2810. e3 >= 0 ? this.entries.splice(0, e3 + 1) : this.entries.length = 0;
  2811. }
  2812. getElementEntryInScopeWithTagName(e3) {
  2813. const t2 = this.entries.find((t3) => t3.type === J.Marker || this.treeAdapter.getTagName(t3.element) === e3);
  2814. return t2 && t2.type === J.Element ? t2 : null;
  2815. }
  2816. getElementEntry(e3) {
  2817. return this.entries.find((t2) => t2.type === J.Element && t2.element === e3);
  2818. }
  2819. }
  2820. function ee(e3) {
  2821. return { nodeName: "#text", value: e3, parentNode: null };
  2822. }
  2823. const te = { createDocument: () => ({ nodeName: "#document", mode: I.NO_QUIRKS, childNodes: [] }), createDocumentFragment: () => ({ nodeName: "#document-fragment", childNodes: [] }), createElement: (e3, t2, s2) => ({ nodeName: e3, tagName: e3, attrs: s2, namespaceURI: t2, childNodes: [], parentNode: null }), createCommentNode: (e3) => ({ nodeName: "#comment", data: e3, parentNode: null }), appendChild(e3, t2) {
  2824. e3.childNodes.push(t2), t2.parentNode = e3;
  2825. }, insertBefore(e3, t2, s2) {
  2826. const a2 = e3.childNodes.indexOf(s2);
  2827. e3.childNodes.splice(a2, 0, t2), t2.parentNode = e3;
  2828. }, setTemplateContent(e3, t2) {
  2829. e3.content = t2;
  2830. }, getTemplateContent: (e3) => e3.content, setDocumentType(e3, t2, s2, a2) {
  2831. const r2 = e3.childNodes.find((e4) => "#documentType" === e4.nodeName);
  2832. if (r2) r2.name = t2, r2.publicId = s2, r2.systemId = a2;
  2833. else {
  2834. const r3 = { nodeName: "#documentType", name: t2, publicId: s2, systemId: a2, parentNode: null };
  2835. te.appendChild(e3, r3);
  2836. }
  2837. }, setDocumentMode(e3, t2) {
  2838. e3.mode = t2;
  2839. }, getDocumentMode: (e3) => e3.mode, detachNode(e3) {
  2840. if (e3.parentNode) {
  2841. const t2 = e3.parentNode.childNodes.indexOf(e3);
  2842. e3.parentNode.childNodes.splice(t2, 1), e3.parentNode = null;
  2843. }
  2844. }, insertText(e3, t2) {
  2845. if (e3.childNodes.length > 0) {
  2846. const s2 = e3.childNodes[e3.childNodes.length - 1];
  2847. if (te.isTextNode(s2)) return void (s2.value += t2);
  2848. }
  2849. te.appendChild(e3, ee(t2));
  2850. }, insertTextBefore(e3, t2, s2) {
  2851. const a2 = e3.childNodes[e3.childNodes.indexOf(s2) - 1];
  2852. a2 && te.isTextNode(a2) ? a2.value += t2 : te.insertBefore(e3, ee(t2), s2);
  2853. }, adoptAttributes(e3, t2) {
  2854. const s2 = new Set(e3.attrs.map((e4) => e4.name));
  2855. for (let a2 = 0; a2 < t2.length; a2++) s2.has(t2[a2].name) || e3.attrs.push(t2[a2]);
  2856. }, getFirstChild: (e3) => e3.childNodes[0], getChildNodes: (e3) => e3.childNodes, getParentNode: (e3) => e3.parentNode, getAttrList: (e3) => e3.attrs, getTagName: (e3) => e3.tagName, getNamespaceURI: (e3) => e3.namespaceURI, getTextNodeContent: (e3) => e3.value, getCommentNodeContent: (e3) => e3.data, getDocumentTypeNodeName: (e3) => e3.name, getDocumentTypeNodePublicId: (e3) => e3.publicId, getDocumentTypeNodeSystemId: (e3) => e3.systemId, isTextNode: (e3) => "#text" === e3.nodeName, isCommentNode: (e3) => "#comment" === e3.nodeName, isDocumentTypeNode: (e3) => "#documentType" === e3.nodeName, isElementNode: (e3) => Object.prototype.hasOwnProperty.call(e3, "tagName"), setNodeSourceCodeLocation(e3, t2) {
  2857. e3.sourceCodeLocation = t2;
  2858. }, getNodeSourceCodeLocation: (e3) => e3.sourceCodeLocation, updateNodeSourceCodeLocation(e3, t2) {
  2859. e3.sourceCodeLocation = { ...e3.sourceCodeLocation, ...t2 };
  2860. } }, se = "html", ae = ["+//silmaril//dtd html pro v0r11 19970101//", "-//as//dtd html 3.0 aswedit + extensions//", "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", "-//ietf//dtd html 2.0 level 1//", "-//ietf//dtd html 2.0 level 2//", "-//ietf//dtd html 2.0 strict level 1//", "-//ietf//dtd html 2.0 strict level 2//", "-//ietf//dtd html 2.0 strict//", "-//ietf//dtd html 2.0//", "-//ietf//dtd html 2.1e//", "-//ietf//dtd html 3.0//", "-//ietf//dtd html 3.2 final//", "-//ietf//dtd html 3.2//", "-//ietf//dtd html 3//", "-//ietf//dtd html level 0//", "-//ietf//dtd html level 1//", "-//ietf//dtd html level 2//", "-//ietf//dtd html level 3//", "-//ietf//dtd html strict level 0//", "-//ietf//dtd html strict level 1//", "-//ietf//dtd html strict level 2//", "-//ietf//dtd html strict level 3//", "-//ietf//dtd html strict//", "-//ietf//dtd html//", "-//metrius//dtd metrius presentational//", "-//microsoft//dtd internet explorer 2.0 html strict//", "-//microsoft//dtd internet explorer 2.0 html//", "-//microsoft//dtd internet explorer 2.0 tables//", "-//microsoft//dtd internet explorer 3.0 html strict//", "-//microsoft//dtd internet explorer 3.0 html//", "-//microsoft//dtd internet explorer 3.0 tables//", "-//netscape comm. corp.//dtd html//", "-//netscape comm. corp.//dtd strict html//", "-//o'reilly and associates//dtd html 2.0//", "-//o'reilly and associates//dtd html extended 1.0//", "-//o'reilly and associates//dtd html extended relaxed 1.0//", "-//sq//dtd html 2.0 hotmetal + extensions//", "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", "-//spyglass//dtd html 2.0 extended//", "-//sun microsystems corp.//dtd hotjava html//", "-//sun microsystems corp.//dtd hotjava strict html//", "-//w3c//dtd html 3 1995-03-24//", "-//w3c//dtd html 3.2 draft//", "-//w3c//dtd html 3.2 final//", "-//w3c//dtd html 3.2//", "-//w3c//dtd html 3.2s draft//", "-//w3c//dtd html 4.0 frameset//", "-//w3c//dtd html 4.0 transitional//", "-//w3c//dtd html experimental 19960712//", "-//w3c//dtd html experimental 970421//", "-//w3c//dtd w3 html//", "-//w3o//dtd w3 html 3.0//", "-//webtechs//dtd mozilla html 2.0//", "-//webtechs//dtd mozilla html//"], re = [...ae, "-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//"], ne = /* @__PURE__ */ new Set(["-//w3o//dtd w3 html strict 3.0//en//", "-/w3c/dtd html 4.0 transitional/en", "html"]), ie = ["-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//"], oe = [...ie, "-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//"];
  2861. function ce(e3, t2) {
  2862. return t2.some((t3) => e3.startsWith(t3));
  2863. }
  2864. const Ee = "text/html", Te = "application/xhtml+xml", he = "definitionurl", _e = "definitionURL", Ae = new Map(["attributeName", "attributeType", "baseFrequency", "baseProfile", "calcMode", "clipPathUnits", "diffuseConstant", "edgeMode", "filterUnits", "glyphRef", "gradientTransform", "gradientUnits", "kernelMatrix", "kernelUnitLength", "keyPoints", "keySplines", "keyTimes", "lengthAdjust", "limitingConeAngle", "markerHeight", "markerUnits", "markerWidth", "maskContentUnits", "maskUnits", "numOctaves", "pathLength", "patternContentUnits", "patternTransform", "patternUnits", "pointsAtX", "pointsAtY", "pointsAtZ", "preserveAlpha", "preserveAspectRatio", "primitiveUnits", "refX", "refY", "repeatCount", "repeatDur", "requiredExtensions", "requiredFeatures", "specularConstant", "specularExponent", "spreadMethod", "startOffset", "stdDeviation", "stitchTiles", "surfaceScale", "systemLanguage", "tableValues", "targetX", "targetY", "textLength", "viewBox", "viewTarget", "xChannelSelector", "yChannelSelector", "zoomAndPan"].map((e3) => [e3.toLowerCase(), e3])), le = /* @__PURE__ */ new Map([["xlink:actuate", { prefix: "xlink", name: "actuate", namespace: u.XLINK }], ["xlink:arcrole", { prefix: "xlink", name: "arcrole", namespace: u.XLINK }], ["xlink:href", { prefix: "xlink", name: "href", namespace: u.XLINK }], ["xlink:role", { prefix: "xlink", name: "role", namespace: u.XLINK }], ["xlink:show", { prefix: "xlink", name: "show", namespace: u.XLINK }], ["xlink:title", { prefix: "xlink", name: "title", namespace: u.XLINK }], ["xlink:type", { prefix: "xlink", name: "type", namespace: u.XLINK }], ["xml:base", { prefix: "xml", name: "base", namespace: u.XML }], ["xml:lang", { prefix: "xml", name: "lang", namespace: u.XML }], ["xml:space", { prefix: "xml", name: "space", namespace: u.XML }], ["xmlns", { prefix: "", name: "xmlns", namespace: u.XMLNS }], ["xmlns:xlink", { prefix: "xmlns", name: "xlink", namespace: u.XMLNS }]]), me = new Map(["altGlyph", "altGlyphDef", "altGlyphItem", "animateColor", "animateMotion", "animateTransform", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "glyphRef", "linearGradient", "radialGradient", "textPath"].map((e3) => [e3.toLowerCase(), e3])), de = /* @__PURE__ */ new Set([S.B, S.BIG, S.BLOCKQUOTE, S.BODY, S.BR, S.CENTER, S.CODE, S.DD, S.DIV, S.DL, S.DT, S.EM, S.EMBED, S.H1, S.H2, S.H3, S.H4, S.H5, S.H6, S.HEAD, S.HR, S.I, S.IMG, S.LI, S.LISTING, S.MENU, S.META, S.NOBR, S.OL, S.P, S.PRE, S.RUBY, S.S, S.SMALL, S.SPAN, S.STRONG, S.STRIKE, S.SUB, S.SUP, S.TABLE, S.TT, S.U, S.UL, S.VAR]);
  2865. function pe(e3) {
  2866. for (let t2 = 0; t2 < e3.attrs.length; t2++) if (e3.attrs[t2].name === he) {
  2867. e3.attrs[t2].name = _e;
  2868. break;
  2869. }
  2870. }
  2871. function ue(e3) {
  2872. for (let t2 = 0; t2 < e3.attrs.length; t2++) {
  2873. const s2 = Ae.get(e3.attrs[t2].name);
  2874. null != s2 && (e3.attrs[t2].name = s2);
  2875. }
  2876. }
  2877. function Ne(e3) {
  2878. for (let t2 = 0; t2 < e3.attrs.length; t2++) {
  2879. const s2 = le.get(e3.attrs[t2].name);
  2880. s2 && (e3.attrs[t2].prefix = s2.prefix, e3.attrs[t2].name = s2.name, e3.attrs[t2].namespace = s2.namespace);
  2881. }
  2882. }
  2883. const Ie = "hidden", Ce = 8, Se = 3;
  2884. var De;
  2885. !function(e3) {
  2886. e3[e3.INITIAL = 0] = "INITIAL", e3[e3.BEFORE_HTML = 1] = "BEFORE_HTML", e3[e3.BEFORE_HEAD = 2] = "BEFORE_HEAD", e3[e3.IN_HEAD = 3] = "IN_HEAD", e3[e3.IN_HEAD_NO_SCRIPT = 4] = "IN_HEAD_NO_SCRIPT", e3[e3.AFTER_HEAD = 5] = "AFTER_HEAD", e3[e3.IN_BODY = 6] = "IN_BODY", e3[e3.TEXT = 7] = "TEXT", e3[e3.IN_TABLE = 8] = "IN_TABLE", e3[e3.IN_TABLE_TEXT = 9] = "IN_TABLE_TEXT", e3[e3.IN_CAPTION = 10] = "IN_CAPTION", e3[e3.IN_COLUMN_GROUP = 11] = "IN_COLUMN_GROUP", e3[e3.IN_TABLE_BODY = 12] = "IN_TABLE_BODY", e3[e3.IN_ROW = 13] = "IN_ROW", e3[e3.IN_CELL = 14] = "IN_CELL", e3[e3.IN_SELECT = 15] = "IN_SELECT", e3[e3.IN_SELECT_IN_TABLE = 16] = "IN_SELECT_IN_TABLE", e3[e3.IN_TEMPLATE = 17] = "IN_TEMPLATE", e3[e3.AFTER_BODY = 18] = "AFTER_BODY", e3[e3.IN_FRAMESET = 19] = "IN_FRAMESET", e3[e3.AFTER_FRAMESET = 20] = "AFTER_FRAMESET", e3[e3.AFTER_AFTER_BODY = 21] = "AFTER_AFTER_BODY", e3[e3.AFTER_AFTER_FRAMESET = 22] = "AFTER_AFTER_FRAMESET";
  2887. }(De || (De = {}));
  2888. const Re = { startLine: -1, startCol: -1, startOffset: -1, endLine: -1, endCol: -1, endOffset: -1 }, Oe = /* @__PURE__ */ new Set([S.TABLE, S.TBODY, S.TFOOT, S.THEAD, S.TR]), fe = { scriptingEnabled: true, sourceCodeLocationInfo: false, treeAdapter: te, onParseError: null };
  2889. class Le {
  2890. constructor(e3, t2, s2 = null, a2 = null) {
  2891. this.fragmentContext = s2, this.scriptHandler = a2, this.currentToken = null, this.stopped = false, this.insertionMode = De.INITIAL, this.originalInsertionMode = De.INITIAL, this.headElement = null, this.formElement = null, this.currentNotInHTML = false, this.tmplInsertionModeStack = [], this.pendingCharacterTokens = [], this.hasNonWhitespacePendingCharacterToken = false, this.framesetOk = true, this.skipNextNewLine = false, this.fosterParentingEnabled = false, this.options = { ...fe, ...e3 }, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = true), this.document = null != t2 ? t2 : this.treeAdapter.createDocument(), this.tokenizer = new Y(this.options, this), this.activeFormattingElements = new $(this.treeAdapter), this.fragmentContextID = s2 ? O(this.treeAdapter.getTagName(s2)) : S.UNKNOWN, this._setContextModes(null != s2 ? s2 : this.document, this.fragmentContextID), this.openElements = new j(this.document, this.treeAdapter, this);
  2892. }
  2893. static parse(e3, t2) {
  2894. const s2 = new this(t2);
  2895. return s2.tokenizer.write(e3, true), s2.document;
  2896. }
  2897. static getFragmentParser(e3, t2) {
  2898. const s2 = { ...fe, ...t2 };
  2899. null != e3 || (e3 = s2.treeAdapter.createElement(C.TEMPLATE, u.HTML, []));
  2900. const a2 = s2.treeAdapter.createElement("documentmock", u.HTML, []), r2 = new this(s2, a2, e3);
  2901. return r2.fragmentContextID === S.TEMPLATE && r2.tmplInsertionModeStack.unshift(De.IN_TEMPLATE), r2._initTokenizerForFragmentParsing(), r2._insertFakeRootElement(), r2._resetInsertionMode(), r2._findFormInFragmentContext(), r2;
  2902. }
  2903. getFragment() {
  2904. const e3 = this.treeAdapter.getFirstChild(this.document), t2 = this.treeAdapter.createDocumentFragment();
  2905. return this._adoptNodes(e3, t2), t2;
  2906. }
  2907. _err(e3, t2, s2) {
  2908. var a2;
  2909. if (!this.onParseError) return;
  2910. const r2 = null !== (a2 = e3.location) && void 0 !== a2 ? a2 : Re, n2 = { code: t2, startLine: r2.startLine, startCol: r2.startCol, startOffset: r2.startOffset, endLine: s2 ? r2.startLine : r2.endLine, endCol: s2 ? r2.startCol : r2.endCol, endOffset: s2 ? r2.startOffset : r2.endOffset };
  2911. this.onParseError(n2);
  2912. }
  2913. onItemPush(e3, t2, s2) {
  2914. var a2, r2;
  2915. null === (r2 = (a2 = this.treeAdapter).onItemPush) || void 0 === r2 || r2.call(a2, e3), s2 && this.openElements.stackTop > 0 && this._setContextModes(e3, t2);
  2916. }
  2917. onItemPop(e3, t2) {
  2918. var s2, a2;
  2919. if (this.options.sourceCodeLocationInfo && this._setEndLocation(e3, this.currentToken), null === (a2 = (s2 = this.treeAdapter).onItemPop) || void 0 === a2 || a2.call(s2, e3, this.openElements.current), t2) {
  2920. let e4, t3;
  2921. 0 === this.openElements.stackTop && this.fragmentContext ? (e4 = this.fragmentContext, t3 = this.fragmentContextID) : { current: e4, currentTagId: t3 } = this.openElements, this._setContextModes(e4, t3);
  2922. }
  2923. }
  2924. _setContextModes(e3, t2) {
  2925. const s2 = e3 === this.document || this.treeAdapter.getNamespaceURI(e3) === u.HTML;
  2926. this.currentNotInHTML = !s2, this.tokenizer.inForeignNode = !s2 && !this._isIntegrationPoint(t2, e3);
  2927. }
  2928. _switchToTextParsing(e3, t2) {
  2929. this._insertElement(e3, u.HTML), this.tokenizer.state = t2, this.originalInsertionMode = this.insertionMode, this.insertionMode = De.TEXT;
  2930. }
  2931. switchToPlaintextParsing() {
  2932. this.insertionMode = De.TEXT, this.originalInsertionMode = De.IN_BODY, this.tokenizer.state = k.PLAINTEXT;
  2933. }
  2934. _getAdjustedCurrentElement() {
  2935. return 0 === this.openElements.stackTop && this.fragmentContext ? this.fragmentContext : this.openElements.current;
  2936. }
  2937. _findFormInFragmentContext() {
  2938. let e3 = this.fragmentContext;
  2939. for (; e3; ) {
  2940. if (this.treeAdapter.getTagName(e3) === C.FORM) {
  2941. this.formElement = e3;
  2942. break;
  2943. }
  2944. e3 = this.treeAdapter.getParentNode(e3);
  2945. }
  2946. }
  2947. _initTokenizerForFragmentParsing() {
  2948. if (this.fragmentContext && this.treeAdapter.getNamespaceURI(this.fragmentContext) === u.HTML) switch (this.fragmentContextID) {
  2949. case S.TITLE:
  2950. case S.TEXTAREA:
  2951. this.tokenizer.state = k.RCDATA;
  2952. break;
  2953. case S.STYLE:
  2954. case S.XMP:
  2955. case S.IFRAME:
  2956. case S.NOEMBED:
  2957. case S.NOFRAMES:
  2958. case S.NOSCRIPT:
  2959. this.tokenizer.state = k.RAWTEXT;
  2960. break;
  2961. case S.SCRIPT:
  2962. this.tokenizer.state = k.SCRIPT_DATA;
  2963. break;
  2964. case S.PLAINTEXT:
  2965. this.tokenizer.state = k.PLAINTEXT;
  2966. }
  2967. }
  2968. _setDocumentType(e3) {
  2969. const t2 = e3.name || "", s2 = e3.publicId || "", a2 = e3.systemId || "";
  2970. if (this.treeAdapter.setDocumentType(this.document, t2, s2, a2), e3.location) {
  2971. const t3 = this.treeAdapter.getChildNodes(this.document).find((e4) => this.treeAdapter.isDocumentTypeNode(e4));
  2972. t3 && this.treeAdapter.setNodeSourceCodeLocation(t3, e3.location);
  2973. }
  2974. }
  2975. _attachElementToTree(e3, t2) {
  2976. if (this.options.sourceCodeLocationInfo) {
  2977. const s2 = t2 && { ...t2, startTag: t2 };
  2978. this.treeAdapter.setNodeSourceCodeLocation(e3, s2);
  2979. }
  2980. if (this._shouldFosterParentOnInsertion()) this._fosterParentElement(e3);
  2981. else {
  2982. const t3 = this.openElements.currentTmplContentOrNode;
  2983. this.treeAdapter.appendChild(t3, e3);
  2984. }
  2985. }
  2986. _appendElement(e3, t2) {
  2987. const s2 = this.treeAdapter.createElement(e3.tagName, t2, e3.attrs);
  2988. this._attachElementToTree(s2, e3.location);
  2989. }
  2990. _insertElement(e3, t2) {
  2991. const s2 = this.treeAdapter.createElement(e3.tagName, t2, e3.attrs);
  2992. this._attachElementToTree(s2, e3.location), this.openElements.push(s2, e3.tagID);
  2993. }
  2994. _insertFakeElement(e3, t2) {
  2995. const s2 = this.treeAdapter.createElement(e3, u.HTML, []);
  2996. this._attachElementToTree(s2, null), this.openElements.push(s2, t2);
  2997. }
  2998. _insertTemplate(e3) {
  2999. const t2 = this.treeAdapter.createElement(e3.tagName, u.HTML, e3.attrs), s2 = this.treeAdapter.createDocumentFragment();
  3000. this.treeAdapter.setTemplateContent(t2, s2), this._attachElementToTree(t2, e3.location), this.openElements.push(t2, e3.tagID), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(s2, null);
  3001. }
  3002. _insertFakeRootElement() {
  3003. const e3 = this.treeAdapter.createElement(C.HTML, u.HTML, []);
  3004. this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(e3, null), this.treeAdapter.appendChild(this.openElements.current, e3), this.openElements.push(e3, S.HTML);
  3005. }
  3006. _appendCommentNode(e3, t2) {
  3007. const s2 = this.treeAdapter.createCommentNode(e3.data);
  3008. this.treeAdapter.appendChild(t2, s2), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(s2, e3.location);
  3009. }
  3010. _insertCharacters(e3) {
  3011. let t2, s2;
  3012. if (this._shouldFosterParentOnInsertion() ? ({ parent: t2, beforeElement: s2 } = this._findFosterParentingLocation(), s2 ? this.treeAdapter.insertTextBefore(t2, e3.chars, s2) : this.treeAdapter.insertText(t2, e3.chars)) : (t2 = this.openElements.currentTmplContentOrNode, this.treeAdapter.insertText(t2, e3.chars)), !e3.location) return;
  3013. const a2 = this.treeAdapter.getChildNodes(t2), r2 = s2 ? a2.lastIndexOf(s2) : a2.length, n2 = a2[r2 - 1];
  3014. if (this.treeAdapter.getNodeSourceCodeLocation(n2)) {
  3015. const { endLine: t3, endCol: s3, endOffset: a3 } = e3.location;
  3016. this.treeAdapter.updateNodeSourceCodeLocation(n2, { endLine: t3, endCol: s3, endOffset: a3 });
  3017. } else this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(n2, e3.location);
  3018. }
  3019. _adoptNodes(e3, t2) {
  3020. for (let s2 = this.treeAdapter.getFirstChild(e3); s2; s2 = this.treeAdapter.getFirstChild(e3)) this.treeAdapter.detachNode(s2), this.treeAdapter.appendChild(t2, s2);
  3021. }
  3022. _setEndLocation(e3, t2) {
  3023. if (this.treeAdapter.getNodeSourceCodeLocation(e3) && t2.location) {
  3024. const s2 = t2.location, a2 = this.treeAdapter.getTagName(e3), r2 = t2.type === h.END_TAG && a2 === t2.tagName ? { endTag: { ...s2 }, endLine: s2.endLine, endCol: s2.endCol, endOffset: s2.endOffset } : { endLine: s2.startLine, endCol: s2.startCol, endOffset: s2.startOffset };
  3025. this.treeAdapter.updateNodeSourceCodeLocation(e3, r2);
  3026. }
  3027. }
  3028. shouldProcessStartTagTokenInForeignContent(e3) {
  3029. if (!this.currentNotInHTML) return false;
  3030. let t2, s2;
  3031. return 0 === this.openElements.stackTop && this.fragmentContext ? (t2 = this.fragmentContext, s2 = this.fragmentContextID) : { current: t2, currentTagId: s2 } = this.openElements, (e3.tagID !== S.SVG || this.treeAdapter.getTagName(t2) !== C.ANNOTATION_XML || this.treeAdapter.getNamespaceURI(t2) !== u.MATHML) && (this.tokenizer.inForeignNode || (e3.tagID === S.MGLYPH || e3.tagID === S.MALIGNMARK) && !this._isIntegrationPoint(s2, t2, u.HTML));
  3032. }
  3033. _processToken(e3) {
  3034. switch (e3.type) {
  3035. case h.CHARACTER:
  3036. this.onCharacter(e3);
  3037. break;
  3038. case h.NULL_CHARACTER:
  3039. this.onNullCharacter(e3);
  3040. break;
  3041. case h.COMMENT:
  3042. this.onComment(e3);
  3043. break;
  3044. case h.DOCTYPE:
  3045. this.onDoctype(e3);
  3046. break;
  3047. case h.START_TAG:
  3048. this._processStartTag(e3);
  3049. break;
  3050. case h.END_TAG:
  3051. this.onEndTag(e3);
  3052. break;
  3053. case h.EOF:
  3054. this.onEof(e3);
  3055. break;
  3056. case h.WHITESPACE_CHARACTER:
  3057. this.onWhitespaceCharacter(e3);
  3058. }
  3059. }
  3060. _isIntegrationPoint(e3, t2, s2) {
  3061. return function(e4, t3, s3, a2) {
  3062. return (!a2 || a2 === u.HTML) && function(e5, t4, s4) {
  3063. if (t4 === u.MATHML && e5 === S.ANNOTATION_XML) {
  3064. for (let e6 = 0; e6 < s4.length; e6++) if (s4[e6].name === N.ENCODING) {
  3065. const t5 = s4[e6].value.toLowerCase();
  3066. return t5 === Ee || t5 === Te;
  3067. }
  3068. }
  3069. return t4 === u.SVG && (e5 === S.FOREIGN_OBJECT || e5 === S.DESC || e5 === S.TITLE);
  3070. }(e4, t3, s3) || (!a2 || a2 === u.MATHML) && function(e5, t4) {
  3071. return t4 === u.MATHML && (e5 === S.MI || e5 === S.MO || e5 === S.MN || e5 === S.MS || e5 === S.MTEXT);
  3072. }(e4, t3);
  3073. }(e3, this.treeAdapter.getNamespaceURI(t2), this.treeAdapter.getAttrList(t2), s2);
  3074. }
  3075. _reconstructActiveFormattingElements() {
  3076. const e3 = this.activeFormattingElements.entries.length;
  3077. if (e3) {
  3078. const t2 = this.activeFormattingElements.entries.findIndex((e4) => e4.type === J.Marker || this.openElements.contains(e4.element));
  3079. for (let s2 = t2 < 0 ? e3 - 1 : t2 - 1; s2 >= 0; s2--) {
  3080. const e4 = this.activeFormattingElements.entries[s2];
  3081. this._insertElement(e4.token, this.treeAdapter.getNamespaceURI(e4.element)), e4.element = this.openElements.current;
  3082. }
  3083. }
  3084. }
  3085. _closeTableCell() {
  3086. this.openElements.generateImpliedEndTags(), this.openElements.popUntilTableCellPopped(), this.activeFormattingElements.clearToLastMarker(), this.insertionMode = De.IN_ROW;
  3087. }
  3088. _closePElement() {
  3089. this.openElements.generateImpliedEndTagsWithExclusion(S.P), this.openElements.popUntilTagNamePopped(S.P);
  3090. }
  3091. _resetInsertionMode() {
  3092. for (let e3 = this.openElements.stackTop; e3 >= 0; e3--) switch (0 === e3 && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[e3]) {
  3093. case S.TR:
  3094. return void (this.insertionMode = De.IN_ROW);
  3095. case S.TBODY:
  3096. case S.THEAD:
  3097. case S.TFOOT:
  3098. return void (this.insertionMode = De.IN_TABLE_BODY);
  3099. case S.CAPTION:
  3100. return void (this.insertionMode = De.IN_CAPTION);
  3101. case S.COLGROUP:
  3102. return void (this.insertionMode = De.IN_COLUMN_GROUP);
  3103. case S.TABLE:
  3104. return void (this.insertionMode = De.IN_TABLE);
  3105. case S.BODY:
  3106. return void (this.insertionMode = De.IN_BODY);
  3107. case S.FRAMESET:
  3108. return void (this.insertionMode = De.IN_FRAMESET);
  3109. case S.SELECT:
  3110. return void this._resetInsertionModeForSelect(e3);
  3111. case S.TEMPLATE:
  3112. return void (this.insertionMode = this.tmplInsertionModeStack[0]);
  3113. case S.HTML:
  3114. return void (this.insertionMode = this.headElement ? De.AFTER_HEAD : De.BEFORE_HEAD);
  3115. case S.TD:
  3116. case S.TH:
  3117. if (e3 > 0) return void (this.insertionMode = De.IN_CELL);
  3118. break;
  3119. case S.HEAD:
  3120. if (e3 > 0) return void (this.insertionMode = De.IN_HEAD);
  3121. }
  3122. this.insertionMode = De.IN_BODY;
  3123. }
  3124. _resetInsertionModeForSelect(e3) {
  3125. if (e3 > 0) for (let t2 = e3 - 1; t2 > 0; t2--) {
  3126. const e4 = this.openElements.tagIDs[t2];
  3127. if (e4 === S.TEMPLATE) break;
  3128. if (e4 === S.TABLE) return void (this.insertionMode = De.IN_SELECT_IN_TABLE);
  3129. }
  3130. this.insertionMode = De.IN_SELECT;
  3131. }
  3132. _isElementCausesFosterParenting(e3) {
  3133. return Oe.has(e3);
  3134. }
  3135. _shouldFosterParentOnInsertion() {
  3136. return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.currentTagId);
  3137. }
  3138. _findFosterParentingLocation() {
  3139. for (let e3 = this.openElements.stackTop; e3 >= 0; e3--) {
  3140. const t2 = this.openElements.items[e3];
  3141. switch (this.openElements.tagIDs[e3]) {
  3142. case S.TEMPLATE:
  3143. if (this.treeAdapter.getNamespaceURI(t2) === u.HTML) return { parent: this.treeAdapter.getTemplateContent(t2), beforeElement: null };
  3144. break;
  3145. case S.TABLE: {
  3146. const s2 = this.treeAdapter.getParentNode(t2);
  3147. return s2 ? { parent: s2, beforeElement: t2 } : { parent: this.openElements.items[e3 - 1], beforeElement: null };
  3148. }
  3149. }
  3150. }
  3151. return { parent: this.openElements.items[0], beforeElement: null };
  3152. }
  3153. _fosterParentElement(e3) {
  3154. const t2 = this._findFosterParentingLocation();
  3155. t2.beforeElement ? this.treeAdapter.insertBefore(t2.parent, e3, t2.beforeElement) : this.treeAdapter.appendChild(t2.parent, e3);
  3156. }
  3157. _isSpecialElement(e3, t2) {
  3158. const s2 = this.treeAdapter.getNamespaceURI(e3);
  3159. return L[s2].has(t2);
  3160. }
  3161. onCharacter(e3) {
  3162. if (this.skipNextNewLine = false, this.tokenizer.inForeignNode) !function(e4, t2) {
  3163. e4._insertCharacters(t2), e4.framesetOk = false;
  3164. }(this, e3);
  3165. else switch (this.insertionMode) {
  3166. case De.INITIAL:
  3167. ye(this, e3);
  3168. break;
  3169. case De.BEFORE_HTML:
  3170. Ge(this, e3);
  3171. break;
  3172. case De.BEFORE_HEAD:
  3173. we(this, e3);
  3174. break;
  3175. case De.IN_HEAD:
  3176. ve(this, e3);
  3177. break;
  3178. case De.IN_HEAD_NO_SCRIPT:
  3179. Qe(this, e3);
  3180. break;
  3181. case De.AFTER_HEAD:
  3182. qe(this, e3);
  3183. break;
  3184. case De.IN_BODY:
  3185. case De.IN_CAPTION:
  3186. case De.IN_CELL:
  3187. case De.IN_TEMPLATE:
  3188. Ke(this, e3);
  3189. break;
  3190. case De.TEXT:
  3191. case De.IN_SELECT:
  3192. case De.IN_SELECT_IN_TABLE:
  3193. this._insertCharacters(e3);
  3194. break;
  3195. case De.IN_TABLE:
  3196. case De.IN_TABLE_BODY:
  3197. case De.IN_ROW:
  3198. st(this, e3);
  3199. break;
  3200. case De.IN_TABLE_TEXT:
  3201. ot(this, e3);
  3202. break;
  3203. case De.IN_COLUMN_GROUP:
  3204. ht(this, e3);
  3205. break;
  3206. case De.AFTER_BODY:
  3207. It(this, e3);
  3208. break;
  3209. case De.AFTER_AFTER_BODY:
  3210. Ct(this, e3);
  3211. }
  3212. }
  3213. onNullCharacter(e3) {
  3214. if (this.skipNextNewLine = false, this.tokenizer.inForeignNode) !function(e4, t2) {
  3215. t2.chars = s, e4._insertCharacters(t2);
  3216. }(this, e3);
  3217. else switch (this.insertionMode) {
  3218. case De.INITIAL:
  3219. ye(this, e3);
  3220. break;
  3221. case De.BEFORE_HTML:
  3222. Ge(this, e3);
  3223. break;
  3224. case De.BEFORE_HEAD:
  3225. we(this, e3);
  3226. break;
  3227. case De.IN_HEAD:
  3228. ve(this, e3);
  3229. break;
  3230. case De.IN_HEAD_NO_SCRIPT:
  3231. Qe(this, e3);
  3232. break;
  3233. case De.AFTER_HEAD:
  3234. qe(this, e3);
  3235. break;
  3236. case De.TEXT:
  3237. this._insertCharacters(e3);
  3238. break;
  3239. case De.IN_TABLE:
  3240. case De.IN_TABLE_BODY:
  3241. case De.IN_ROW:
  3242. st(this, e3);
  3243. break;
  3244. case De.IN_COLUMN_GROUP:
  3245. ht(this, e3);
  3246. break;
  3247. case De.AFTER_BODY:
  3248. It(this, e3);
  3249. break;
  3250. case De.AFTER_AFTER_BODY:
  3251. Ct(this, e3);
  3252. }
  3253. }
  3254. onComment(e3) {
  3255. if (this.skipNextNewLine = false, this.currentNotInHTML) Fe(this, e3);
  3256. else switch (this.insertionMode) {
  3257. case De.INITIAL:
  3258. case De.BEFORE_HTML:
  3259. case De.BEFORE_HEAD:
  3260. case De.IN_HEAD:
  3261. case De.IN_HEAD_NO_SCRIPT:
  3262. case De.AFTER_HEAD:
  3263. case De.IN_BODY:
  3264. case De.IN_TABLE:
  3265. case De.IN_CAPTION:
  3266. case De.IN_COLUMN_GROUP:
  3267. case De.IN_TABLE_BODY:
  3268. case De.IN_ROW:
  3269. case De.IN_CELL:
  3270. case De.IN_SELECT:
  3271. case De.IN_SELECT_IN_TABLE:
  3272. case De.IN_TEMPLATE:
  3273. case De.IN_FRAMESET:
  3274. case De.AFTER_FRAMESET:
  3275. Fe(this, e3);
  3276. break;
  3277. case De.IN_TABLE_TEXT:
  3278. ct(this, e3);
  3279. break;
  3280. case De.AFTER_BODY:
  3281. !function(e4, t2) {
  3282. e4._appendCommentNode(t2, e4.openElements.items[0]);
  3283. }(this, e3);
  3284. break;
  3285. case De.AFTER_AFTER_BODY:
  3286. case De.AFTER_AFTER_FRAMESET:
  3287. !function(e4, t2) {
  3288. e4._appendCommentNode(t2, e4.document);
  3289. }(this, e3);
  3290. }
  3291. }
  3292. onDoctype(e3) {
  3293. switch (this.skipNextNewLine = false, this.insertionMode) {
  3294. case De.INITIAL:
  3295. !function(e4, t2) {
  3296. e4._setDocumentType(t2);
  3297. const s2 = t2.forceQuirks ? I.QUIRKS : function(e5) {
  3298. if (e5.name !== se) return I.QUIRKS;
  3299. const { systemId: t3 } = e5;
  3300. if (t3 && "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" === t3.toLowerCase()) return I.QUIRKS;
  3301. let { publicId: s3 } = e5;
  3302. if (null !== s3) {
  3303. if (s3 = s3.toLowerCase(), ne.has(s3)) return I.QUIRKS;
  3304. let e6 = null === t3 ? re : ae;
  3305. if (ce(s3, e6)) return I.QUIRKS;
  3306. if (e6 = null === t3 ? ie : oe, ce(s3, e6)) return I.LIMITED_QUIRKS;
  3307. }
  3308. return I.NO_QUIRKS;
  3309. }(t2);
  3310. (function(e5) {
  3311. return e5.name === se && null === e5.publicId && (null === e5.systemId || "about:legacy-compat" === e5.systemId);
  3312. })(t2) || e4._err(t2, T.nonConformingDoctype), e4.treeAdapter.setDocumentMode(e4.document, s2), e4.insertionMode = De.BEFORE_HTML;
  3313. }(this, e3);
  3314. break;
  3315. case De.BEFORE_HEAD:
  3316. case De.IN_HEAD:
  3317. case De.IN_HEAD_NO_SCRIPT:
  3318. case De.AFTER_HEAD:
  3319. this._err(e3, T.misplacedDoctype);
  3320. break;
  3321. case De.IN_TABLE_TEXT:
  3322. ct(this, e3);
  3323. }
  3324. }
  3325. onStartTag(e3) {
  3326. this.skipNextNewLine = false, this.currentToken = e3, this._processStartTag(e3), e3.selfClosing && !e3.ackSelfClosing && this._err(e3, T.nonVoidHtmlElementStartTagWithTrailingSolidus);
  3327. }
  3328. _processStartTag(e3) {
  3329. this.shouldProcessStartTagTokenInForeignContent(e3) ? function(e4, t2) {
  3330. if (function(e5) {
  3331. const t3 = e5.tagID;
  3332. return t3 === S.FONT && e5.attrs.some(({ name: e6 }) => e6 === N.COLOR || e6 === N.SIZE || e6 === N.FACE) || de.has(t3);
  3333. }(t2)) St(e4), e4._startTagOutsideForeignContent(t2);
  3334. else {
  3335. const s2 = e4._getAdjustedCurrentElement(), a2 = e4.treeAdapter.getNamespaceURI(s2);
  3336. a2 === u.MATHML ? pe(t2) : a2 === u.SVG && (function(e5) {
  3337. const t3 = me.get(e5.tagName);
  3338. null != t3 && (e5.tagName = t3, e5.tagID = O(e5.tagName));
  3339. }(t2), ue(t2)), Ne(t2), t2.selfClosing ? e4._appendElement(t2, a2) : e4._insertElement(t2, a2), t2.ackSelfClosing = true;
  3340. }
  3341. }(this, e3) : this._startTagOutsideForeignContent(e3);
  3342. }
  3343. _startTagOutsideForeignContent(e3) {
  3344. switch (this.insertionMode) {
  3345. case De.INITIAL:
  3346. ye(this, e3);
  3347. break;
  3348. case De.BEFORE_HTML:
  3349. !function(e4, t2) {
  3350. t2.tagID === S.HTML ? (e4._insertElement(t2, u.HTML), e4.insertionMode = De.BEFORE_HEAD) : Ge(e4, t2);
  3351. }(this, e3);
  3352. break;
  3353. case De.BEFORE_HEAD:
  3354. !function(e4, t2) {
  3355. switch (t2.tagID) {
  3356. case S.HTML:
  3357. Ze(e4, t2);
  3358. break;
  3359. case S.HEAD:
  3360. e4._insertElement(t2, u.HTML), e4.headElement = e4.openElements.current, e4.insertionMode = De.IN_HEAD;
  3361. break;
  3362. default:
  3363. we(e4, t2);
  3364. }
  3365. }(this, e3);
  3366. break;
  3367. case De.IN_HEAD:
  3368. xe(this, e3);
  3369. break;
  3370. case De.IN_HEAD_NO_SCRIPT:
  3371. !function(e4, t2) {
  3372. switch (t2.tagID) {
  3373. case S.HTML:
  3374. Ze(e4, t2);
  3375. break;
  3376. case S.BASEFONT:
  3377. case S.BGSOUND:
  3378. case S.HEAD:
  3379. case S.LINK:
  3380. case S.META:
  3381. case S.NOFRAMES:
  3382. case S.STYLE:
  3383. xe(e4, t2);
  3384. break;
  3385. case S.NOSCRIPT:
  3386. e4._err(t2, T.nestedNoscriptInHead);
  3387. break;
  3388. default:
  3389. Qe(e4, t2);
  3390. }
  3391. }(this, e3);
  3392. break;
  3393. case De.AFTER_HEAD:
  3394. !function(e4, t2) {
  3395. switch (t2.tagID) {
  3396. case S.HTML:
  3397. Ze(e4, t2);
  3398. break;
  3399. case S.BODY:
  3400. e4._insertElement(t2, u.HTML), e4.framesetOk = false, e4.insertionMode = De.IN_BODY;
  3401. break;
  3402. case S.FRAMESET:
  3403. e4._insertElement(t2, u.HTML), e4.insertionMode = De.IN_FRAMESET;
  3404. break;
  3405. case S.BASE:
  3406. case S.BASEFONT:
  3407. case S.BGSOUND:
  3408. case S.LINK:
  3409. case S.META:
  3410. case S.NOFRAMES:
  3411. case S.SCRIPT:
  3412. case S.STYLE:
  3413. case S.TEMPLATE:
  3414. case S.TITLE:
  3415. e4._err(t2, T.abandonedHeadElementChild), e4.openElements.push(e4.headElement, S.HEAD), xe(e4, t2), e4.openElements.remove(e4.headElement);
  3416. break;
  3417. case S.HEAD:
  3418. e4._err(t2, T.misplacedStartTagForHeadElement);
  3419. break;
  3420. default:
  3421. qe(e4, t2);
  3422. }
  3423. }(this, e3);
  3424. break;
  3425. case De.IN_BODY:
  3426. Ze(this, e3);
  3427. break;
  3428. case De.IN_TABLE:
  3429. at(this, e3);
  3430. break;
  3431. case De.IN_TABLE_TEXT:
  3432. ct(this, e3);
  3433. break;
  3434. case De.IN_CAPTION:
  3435. !function(e4, t2) {
  3436. const s2 = t2.tagID;
  3437. Et.has(s2) ? e4.openElements.hasInTableScope(S.CAPTION) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(S.CAPTION), e4.activeFormattingElements.clearToLastMarker(), e4.insertionMode = De.IN_TABLE, at(e4, t2)) : Ze(e4, t2);
  3438. }(this, e3);
  3439. break;
  3440. case De.IN_COLUMN_GROUP:
  3441. Tt(this, e3);
  3442. break;
  3443. case De.IN_TABLE_BODY:
  3444. _t(this, e3);
  3445. break;
  3446. case De.IN_ROW:
  3447. lt(this, e3);
  3448. break;
  3449. case De.IN_CELL:
  3450. !function(e4, t2) {
  3451. const s2 = t2.tagID;
  3452. Et.has(s2) ? (e4.openElements.hasInTableScope(S.TD) || e4.openElements.hasInTableScope(S.TH)) && (e4._closeTableCell(), lt(e4, t2)) : Ze(e4, t2);
  3453. }(this, e3);
  3454. break;
  3455. case De.IN_SELECT:
  3456. dt(this, e3);
  3457. break;
  3458. case De.IN_SELECT_IN_TABLE:
  3459. !function(e4, t2) {
  3460. const s2 = t2.tagID;
  3461. s2 === S.CAPTION || s2 === S.TABLE || s2 === S.TBODY || s2 === S.TFOOT || s2 === S.THEAD || s2 === S.TR || s2 === S.TD || s2 === S.TH ? (e4.openElements.popUntilTagNamePopped(S.SELECT), e4._resetInsertionMode(), e4._processStartTag(t2)) : dt(e4, t2);
  3462. }(this, e3);
  3463. break;
  3464. case De.IN_TEMPLATE:
  3465. !function(e4, t2) {
  3466. switch (t2.tagID) {
  3467. case S.BASE:
  3468. case S.BASEFONT:
  3469. case S.BGSOUND:
  3470. case S.LINK:
  3471. case S.META:
  3472. case S.NOFRAMES:
  3473. case S.SCRIPT:
  3474. case S.STYLE:
  3475. case S.TEMPLATE:
  3476. case S.TITLE:
  3477. xe(e4, t2);
  3478. break;
  3479. case S.CAPTION:
  3480. case S.COLGROUP:
  3481. case S.TBODY:
  3482. case S.TFOOT:
  3483. case S.THEAD:
  3484. e4.tmplInsertionModeStack[0] = De.IN_TABLE, e4.insertionMode = De.IN_TABLE, at(e4, t2);
  3485. break;
  3486. case S.COL:
  3487. e4.tmplInsertionModeStack[0] = De.IN_COLUMN_GROUP, e4.insertionMode = De.IN_COLUMN_GROUP, Tt(e4, t2);
  3488. break;
  3489. case S.TR:
  3490. e4.tmplInsertionModeStack[0] = De.IN_TABLE_BODY, e4.insertionMode = De.IN_TABLE_BODY, _t(e4, t2);
  3491. break;
  3492. case S.TD:
  3493. case S.TH:
  3494. e4.tmplInsertionModeStack[0] = De.IN_ROW, e4.insertionMode = De.IN_ROW, lt(e4, t2);
  3495. break;
  3496. default:
  3497. e4.tmplInsertionModeStack[0] = De.IN_BODY, e4.insertionMode = De.IN_BODY, Ze(e4, t2);
  3498. }
  3499. }(this, e3);
  3500. break;
  3501. case De.AFTER_BODY:
  3502. !function(e4, t2) {
  3503. t2.tagID === S.HTML ? Ze(e4, t2) : It(e4, t2);
  3504. }(this, e3);
  3505. break;
  3506. case De.IN_FRAMESET:
  3507. !function(e4, t2) {
  3508. switch (t2.tagID) {
  3509. case S.HTML:
  3510. Ze(e4, t2);
  3511. break;
  3512. case S.FRAMESET:
  3513. e4._insertElement(t2, u.HTML);
  3514. break;
  3515. case S.FRAME:
  3516. e4._appendElement(t2, u.HTML), t2.ackSelfClosing = true;
  3517. break;
  3518. case S.NOFRAMES:
  3519. xe(e4, t2);
  3520. }
  3521. }(this, e3);
  3522. break;
  3523. case De.AFTER_FRAMESET:
  3524. !function(e4, t2) {
  3525. switch (t2.tagID) {
  3526. case S.HTML:
  3527. Ze(e4, t2);
  3528. break;
  3529. case S.NOFRAMES:
  3530. xe(e4, t2);
  3531. }
  3532. }(this, e3);
  3533. break;
  3534. case De.AFTER_AFTER_BODY:
  3535. !function(e4, t2) {
  3536. t2.tagID === S.HTML ? Ze(e4, t2) : Ct(e4, t2);
  3537. }(this, e3);
  3538. break;
  3539. case De.AFTER_AFTER_FRAMESET:
  3540. !function(e4, t2) {
  3541. switch (t2.tagID) {
  3542. case S.HTML:
  3543. Ze(e4, t2);
  3544. break;
  3545. case S.NOFRAMES:
  3546. xe(e4, t2);
  3547. }
  3548. }(this, e3);
  3549. }
  3550. }
  3551. onEndTag(e3) {
  3552. this.skipNextNewLine = false, this.currentToken = e3, this.currentNotInHTML ? function(e4, t2) {
  3553. if (t2.tagID === S.P || t2.tagID === S.BR) return St(e4), void e4._endTagOutsideForeignContent(t2);
  3554. for (let s2 = e4.openElements.stackTop; s2 > 0; s2--) {
  3555. const a2 = e4.openElements.items[s2];
  3556. if (e4.treeAdapter.getNamespaceURI(a2) === u.HTML) {
  3557. e4._endTagOutsideForeignContent(t2);
  3558. break;
  3559. }
  3560. const r2 = e4.treeAdapter.getTagName(a2);
  3561. if (r2.toLowerCase() === t2.tagName) {
  3562. t2.tagName = r2, e4.openElements.shortenToLength(s2);
  3563. break;
  3564. }
  3565. }
  3566. }(this, e3) : this._endTagOutsideForeignContent(e3);
  3567. }
  3568. _endTagOutsideForeignContent(e3) {
  3569. switch (this.insertionMode) {
  3570. case De.INITIAL:
  3571. ye(this, e3);
  3572. break;
  3573. case De.BEFORE_HTML:
  3574. !function(e4, t2) {
  3575. const s2 = t2.tagID;
  3576. s2 !== S.HTML && s2 !== S.HEAD && s2 !== S.BODY && s2 !== S.BR || Ge(e4, t2);
  3577. }(this, e3);
  3578. break;
  3579. case De.BEFORE_HEAD:
  3580. !function(e4, t2) {
  3581. const s2 = t2.tagID;
  3582. s2 === S.HEAD || s2 === S.BODY || s2 === S.HTML || s2 === S.BR ? we(e4, t2) : e4._err(t2, T.endTagWithoutMatchingOpenElement);
  3583. }(this, e3);
  3584. break;
  3585. case De.IN_HEAD:
  3586. !function(e4, t2) {
  3587. switch (t2.tagID) {
  3588. case S.HEAD:
  3589. e4.openElements.pop(), e4.insertionMode = De.AFTER_HEAD;
  3590. break;
  3591. case S.BODY:
  3592. case S.BR:
  3593. case S.HTML:
  3594. ve(e4, t2);
  3595. break;
  3596. case S.TEMPLATE:
  3597. Ye(e4, t2);
  3598. break;
  3599. default:
  3600. e4._err(t2, T.endTagWithoutMatchingOpenElement);
  3601. }
  3602. }(this, e3);
  3603. break;
  3604. case De.IN_HEAD_NO_SCRIPT:
  3605. !function(e4, t2) {
  3606. switch (t2.tagID) {
  3607. case S.NOSCRIPT:
  3608. e4.openElements.pop(), e4.insertionMode = De.IN_HEAD;
  3609. break;
  3610. case S.BR:
  3611. Qe(e4, t2);
  3612. break;
  3613. default:
  3614. e4._err(t2, T.endTagWithoutMatchingOpenElement);
  3615. }
  3616. }(this, e3);
  3617. break;
  3618. case De.AFTER_HEAD:
  3619. !function(e4, t2) {
  3620. switch (t2.tagID) {
  3621. case S.BODY:
  3622. case S.HTML:
  3623. case S.BR:
  3624. qe(e4, t2);
  3625. break;
  3626. case S.TEMPLATE:
  3627. Ye(e4, t2);
  3628. break;
  3629. default:
  3630. e4._err(t2, T.endTagWithoutMatchingOpenElement);
  3631. }
  3632. }(this, e3);
  3633. break;
  3634. case De.IN_BODY:
  3635. et(this, e3);
  3636. break;
  3637. case De.TEXT:
  3638. !function(e4, t2) {
  3639. var s2;
  3640. t2.tagID === S.SCRIPT && (null === (s2 = e4.scriptHandler) || void 0 === s2 || s2.call(e4, e4.openElements.current)), e4.openElements.pop(), e4.insertionMode = e4.originalInsertionMode;
  3641. }(this, e3);
  3642. break;
  3643. case De.IN_TABLE:
  3644. rt(this, e3);
  3645. break;
  3646. case De.IN_TABLE_TEXT:
  3647. ct(this, e3);
  3648. break;
  3649. case De.IN_CAPTION:
  3650. !function(e4, t2) {
  3651. const s2 = t2.tagID;
  3652. switch (s2) {
  3653. case S.CAPTION:
  3654. case S.TABLE:
  3655. e4.openElements.hasInTableScope(S.CAPTION) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(S.CAPTION), e4.activeFormattingElements.clearToLastMarker(), e4.insertionMode = De.IN_TABLE, s2 === S.TABLE && rt(e4, t2));
  3656. break;
  3657. case S.BODY:
  3658. case S.COL:
  3659. case S.COLGROUP:
  3660. case S.HTML:
  3661. case S.TBODY:
  3662. case S.TD:
  3663. case S.TFOOT:
  3664. case S.TH:
  3665. case S.THEAD:
  3666. case S.TR:
  3667. break;
  3668. default:
  3669. et(e4, t2);
  3670. }
  3671. }(this, e3);
  3672. break;
  3673. case De.IN_COLUMN_GROUP:
  3674. !function(e4, t2) {
  3675. switch (t2.tagID) {
  3676. case S.COLGROUP:
  3677. e4.openElements.currentTagId === S.COLGROUP && (e4.openElements.pop(), e4.insertionMode = De.IN_TABLE);
  3678. break;
  3679. case S.TEMPLATE:
  3680. Ye(e4, t2);
  3681. break;
  3682. case S.COL:
  3683. break;
  3684. default:
  3685. ht(e4, t2);
  3686. }
  3687. }(this, e3);
  3688. break;
  3689. case De.IN_TABLE_BODY:
  3690. At(this, e3);
  3691. break;
  3692. case De.IN_ROW:
  3693. mt(this, e3);
  3694. break;
  3695. case De.IN_CELL:
  3696. !function(e4, t2) {
  3697. const s2 = t2.tagID;
  3698. switch (s2) {
  3699. case S.TD:
  3700. case S.TH:
  3701. e4.openElements.hasInTableScope(s2) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(s2), e4.activeFormattingElements.clearToLastMarker(), e4.insertionMode = De.IN_ROW);
  3702. break;
  3703. case S.TABLE:
  3704. case S.TBODY:
  3705. case S.TFOOT:
  3706. case S.THEAD:
  3707. case S.TR:
  3708. e4.openElements.hasInTableScope(s2) && (e4._closeTableCell(), mt(e4, t2));
  3709. break;
  3710. case S.BODY:
  3711. case S.CAPTION:
  3712. case S.COL:
  3713. case S.COLGROUP:
  3714. case S.HTML:
  3715. break;
  3716. default:
  3717. et(e4, t2);
  3718. }
  3719. }(this, e3);
  3720. break;
  3721. case De.IN_SELECT:
  3722. pt(this, e3);
  3723. break;
  3724. case De.IN_SELECT_IN_TABLE:
  3725. !function(e4, t2) {
  3726. const s2 = t2.tagID;
  3727. s2 === S.CAPTION || s2 === S.TABLE || s2 === S.TBODY || s2 === S.TFOOT || s2 === S.THEAD || s2 === S.TR || s2 === S.TD || s2 === S.TH ? e4.openElements.hasInTableScope(s2) && (e4.openElements.popUntilTagNamePopped(S.SELECT), e4._resetInsertionMode(), e4.onEndTag(t2)) : pt(e4, t2);
  3728. }(this, e3);
  3729. break;
  3730. case De.IN_TEMPLATE:
  3731. !function(e4, t2) {
  3732. t2.tagID === S.TEMPLATE && Ye(e4, t2);
  3733. }(this, e3);
  3734. break;
  3735. case De.AFTER_BODY:
  3736. Nt(this, e3);
  3737. break;
  3738. case De.IN_FRAMESET:
  3739. !function(e4, t2) {
  3740. t2.tagID !== S.FRAMESET || e4.openElements.isRootHtmlElementCurrent() || (e4.openElements.pop(), e4.fragmentContext || e4.openElements.currentTagId === S.FRAMESET || (e4.insertionMode = De.AFTER_FRAMESET));
  3741. }(this, e3);
  3742. break;
  3743. case De.AFTER_FRAMESET:
  3744. !function(e4, t2) {
  3745. t2.tagID === S.HTML && (e4.insertionMode = De.AFTER_AFTER_FRAMESET);
  3746. }(this, e3);
  3747. break;
  3748. case De.AFTER_AFTER_BODY:
  3749. Ct(this, e3);
  3750. }
  3751. }
  3752. onEof(e3) {
  3753. switch (this.insertionMode) {
  3754. case De.INITIAL:
  3755. ye(this, e3);
  3756. break;
  3757. case De.BEFORE_HTML:
  3758. Ge(this, e3);
  3759. break;
  3760. case De.BEFORE_HEAD:
  3761. we(this, e3);
  3762. break;
  3763. case De.IN_HEAD:
  3764. ve(this, e3);
  3765. break;
  3766. case De.IN_HEAD_NO_SCRIPT:
  3767. Qe(this, e3);
  3768. break;
  3769. case De.AFTER_HEAD:
  3770. qe(this, e3);
  3771. break;
  3772. case De.IN_BODY:
  3773. case De.IN_TABLE:
  3774. case De.IN_CAPTION:
  3775. case De.IN_COLUMN_GROUP:
  3776. case De.IN_TABLE_BODY:
  3777. case De.IN_ROW:
  3778. case De.IN_CELL:
  3779. case De.IN_SELECT:
  3780. case De.IN_SELECT_IN_TABLE:
  3781. tt(this, e3);
  3782. break;
  3783. case De.TEXT:
  3784. !function(e4, t2) {
  3785. e4._err(t2, T.eofInElementThatCanContainOnlyText), e4.openElements.pop(), e4.insertionMode = e4.originalInsertionMode, e4.onEof(t2);
  3786. }(this, e3);
  3787. break;
  3788. case De.IN_TABLE_TEXT:
  3789. ct(this, e3);
  3790. break;
  3791. case De.IN_TEMPLATE:
  3792. ut(this, e3);
  3793. break;
  3794. case De.AFTER_BODY:
  3795. case De.IN_FRAMESET:
  3796. case De.AFTER_FRAMESET:
  3797. case De.AFTER_AFTER_BODY:
  3798. case De.AFTER_AFTER_FRAMESET:
  3799. Ue(this, e3);
  3800. }
  3801. }
  3802. onWhitespaceCharacter(e3) {
  3803. if (this.skipNextNewLine && (this.skipNextNewLine = false, e3.chars.charCodeAt(0) === a.LINE_FEED)) {
  3804. if (1 === e3.chars.length) return;
  3805. e3.chars = e3.chars.substr(1);
  3806. }
  3807. if (this.tokenizer.inForeignNode) this._insertCharacters(e3);
  3808. else switch (this.insertionMode) {
  3809. case De.IN_HEAD:
  3810. case De.IN_HEAD_NO_SCRIPT:
  3811. case De.AFTER_HEAD:
  3812. case De.TEXT:
  3813. case De.IN_COLUMN_GROUP:
  3814. case De.IN_SELECT:
  3815. case De.IN_SELECT_IN_TABLE:
  3816. case De.IN_FRAMESET:
  3817. case De.AFTER_FRAMESET:
  3818. this._insertCharacters(e3);
  3819. break;
  3820. case De.IN_BODY:
  3821. case De.IN_CAPTION:
  3822. case De.IN_CELL:
  3823. case De.IN_TEMPLATE:
  3824. case De.AFTER_BODY:
  3825. case De.AFTER_AFTER_BODY:
  3826. case De.AFTER_AFTER_FRAMESET:
  3827. Xe(this, e3);
  3828. break;
  3829. case De.IN_TABLE:
  3830. case De.IN_TABLE_BODY:
  3831. case De.IN_ROW:
  3832. st(this, e3);
  3833. break;
  3834. case De.IN_TABLE_TEXT:
  3835. it(this, e3);
  3836. }
  3837. }
  3838. }
  3839. function Me(e3, t2) {
  3840. let s2 = e3.activeFormattingElements.getElementEntryInScopeWithTagName(t2.tagName);
  3841. return s2 ? e3.openElements.contains(s2.element) ? e3.openElements.hasInScope(t2.tagID) || (s2 = null) : (e3.activeFormattingElements.removeEntry(s2), s2 = null) : $e(e3, t2), s2;
  3842. }
  3843. function ge(e3, t2) {
  3844. let s2 = null, a2 = e3.openElements.stackTop;
  3845. for (; a2 >= 0; a2--) {
  3846. const r2 = e3.openElements.items[a2];
  3847. if (r2 === t2.element) break;
  3848. e3._isSpecialElement(r2, e3.openElements.tagIDs[a2]) && (s2 = r2);
  3849. }
  3850. return s2 || (e3.openElements.shortenToLength(a2 < 0 ? 0 : a2), e3.activeFormattingElements.removeEntry(t2)), s2;
  3851. }
  3852. function Pe(e3, t2, s2) {
  3853. let a2 = t2, r2 = e3.openElements.getCommonAncestor(t2);
  3854. for (let n2 = 0, i2 = r2; i2 !== s2; n2++, i2 = r2) {
  3855. r2 = e3.openElements.getCommonAncestor(i2);
  3856. const s3 = e3.activeFormattingElements.getElementEntry(i2), o2 = s3 && n2 >= Se;
  3857. !s3 || o2 ? (o2 && e3.activeFormattingElements.removeEntry(s3), e3.openElements.remove(i2)) : (i2 = ke(e3, s3), a2 === t2 && (e3.activeFormattingElements.bookmark = s3), e3.treeAdapter.detachNode(a2), e3.treeAdapter.appendChild(i2, a2), a2 = i2);
  3858. }
  3859. return a2;
  3860. }
  3861. function ke(e3, t2) {
  3862. const s2 = e3.treeAdapter.getNamespaceURI(t2.element), a2 = e3.treeAdapter.createElement(t2.token.tagName, s2, t2.token.attrs);
  3863. return e3.openElements.replace(t2.element, a2), t2.element = a2, a2;
  3864. }
  3865. function be(e3, t2, s2) {
  3866. const a2 = O(e3.treeAdapter.getTagName(t2));
  3867. if (e3._isElementCausesFosterParenting(a2)) e3._fosterParentElement(s2);
  3868. else {
  3869. const r2 = e3.treeAdapter.getNamespaceURI(t2);
  3870. a2 === S.TEMPLATE && r2 === u.HTML && (t2 = e3.treeAdapter.getTemplateContent(t2)), e3.treeAdapter.appendChild(t2, s2);
  3871. }
  3872. }
  3873. function Be(e3, t2, s2) {
  3874. const a2 = e3.treeAdapter.getNamespaceURI(s2.element), { token: r2 } = s2, n2 = e3.treeAdapter.createElement(r2.tagName, a2, r2.attrs);
  3875. e3._adoptNodes(t2, n2), e3.treeAdapter.appendChild(t2, n2), e3.activeFormattingElements.insertElementAfterBookmark(n2, r2), e3.activeFormattingElements.removeEntry(s2), e3.openElements.remove(s2.element), e3.openElements.insertAfter(t2, n2, r2.tagID);
  3876. }
  3877. function He(e3, t2) {
  3878. for (let s2 = 0; s2 < Ce; s2++) {
  3879. const s3 = Me(e3, t2);
  3880. if (!s3) break;
  3881. const a2 = ge(e3, s3);
  3882. if (!a2) break;
  3883. e3.activeFormattingElements.bookmark = s3;
  3884. const r2 = Pe(e3, a2, s3.element), n2 = e3.openElements.getCommonAncestor(s3.element);
  3885. e3.treeAdapter.detachNode(r2), n2 && be(e3, n2, r2), Be(e3, a2, s3);
  3886. }
  3887. }
  3888. function Fe(e3, t2) {
  3889. e3._appendCommentNode(t2, e3.openElements.currentTmplContentOrNode);
  3890. }
  3891. function Ue(e3, t2) {
  3892. if (e3.stopped = true, t2.location) {
  3893. const s2 = e3.fragmentContext ? 0 : 2;
  3894. for (let a2 = e3.openElements.stackTop; a2 >= s2; a2--) e3._setEndLocation(e3.openElements.items[a2], t2);
  3895. if (!e3.fragmentContext && e3.openElements.stackTop >= 0) {
  3896. const s3 = e3.openElements.items[0], a2 = e3.treeAdapter.getNodeSourceCodeLocation(s3);
  3897. if (a2 && !a2.endTag && (e3._setEndLocation(s3, t2), e3.openElements.stackTop >= 1)) {
  3898. const s4 = e3.openElements.items[1], a3 = e3.treeAdapter.getNodeSourceCodeLocation(s4);
  3899. a3 && !a3.endTag && e3._setEndLocation(s4, t2);
  3900. }
  3901. }
  3902. }
  3903. }
  3904. function ye(e3, t2) {
  3905. e3._err(t2, T.missingDoctype, true), e3.treeAdapter.setDocumentMode(e3.document, I.QUIRKS), e3.insertionMode = De.BEFORE_HTML, e3._processToken(t2);
  3906. }
  3907. function Ge(e3, t2) {
  3908. e3._insertFakeRootElement(), e3.insertionMode = De.BEFORE_HEAD, e3._processToken(t2);
  3909. }
  3910. function we(e3, t2) {
  3911. e3._insertFakeElement(C.HEAD, S.HEAD), e3.headElement = e3.openElements.current, e3.insertionMode = De.IN_HEAD, e3._processToken(t2);
  3912. }
  3913. function xe(e3, t2) {
  3914. switch (t2.tagID) {
  3915. case S.HTML:
  3916. Ze(e3, t2);
  3917. break;
  3918. case S.BASE:
  3919. case S.BASEFONT:
  3920. case S.BGSOUND:
  3921. case S.LINK:
  3922. case S.META:
  3923. e3._appendElement(t2, u.HTML), t2.ackSelfClosing = true;
  3924. break;
  3925. case S.TITLE:
  3926. e3._switchToTextParsing(t2, k.RCDATA);
  3927. break;
  3928. case S.NOSCRIPT:
  3929. e3.options.scriptingEnabled ? e3._switchToTextParsing(t2, k.RAWTEXT) : (e3._insertElement(t2, u.HTML), e3.insertionMode = De.IN_HEAD_NO_SCRIPT);
  3930. break;
  3931. case S.NOFRAMES:
  3932. case S.STYLE:
  3933. e3._switchToTextParsing(t2, k.RAWTEXT);
  3934. break;
  3935. case S.SCRIPT:
  3936. e3._switchToTextParsing(t2, k.SCRIPT_DATA);
  3937. break;
  3938. case S.TEMPLATE:
  3939. e3._insertTemplate(t2), e3.activeFormattingElements.insertMarker(), e3.framesetOk = false, e3.insertionMode = De.IN_TEMPLATE, e3.tmplInsertionModeStack.unshift(De.IN_TEMPLATE);
  3940. break;
  3941. case S.HEAD:
  3942. e3._err(t2, T.misplacedStartTagForHeadElement);
  3943. break;
  3944. default:
  3945. ve(e3, t2);
  3946. }
  3947. }
  3948. function Ye(e3, t2) {
  3949. e3.openElements.tmplCount > 0 ? (e3.openElements.generateImpliedEndTagsThoroughly(), e3.openElements.currentTagId !== S.TEMPLATE && e3._err(t2, T.closingOfElementWithOpenChildElements), e3.openElements.popUntilTagNamePopped(S.TEMPLATE), e3.activeFormattingElements.clearToLastMarker(), e3.tmplInsertionModeStack.shift(), e3._resetInsertionMode()) : e3._err(t2, T.endTagWithoutMatchingOpenElement);
  3950. }
  3951. function ve(e3, t2) {
  3952. e3.openElements.pop(), e3.insertionMode = De.AFTER_HEAD, e3._processToken(t2);
  3953. }
  3954. function Qe(e3, t2) {
  3955. const s2 = t2.type === h.EOF ? T.openElementsLeftAfterEof : T.disallowedContentInNoscriptInHead;
  3956. e3._err(t2, s2), e3.openElements.pop(), e3.insertionMode = De.IN_HEAD, e3._processToken(t2);
  3957. }
  3958. function qe(e3, t2) {
  3959. e3._insertFakeElement(C.BODY, S.BODY), e3.insertionMode = De.IN_BODY, We(e3, t2);
  3960. }
  3961. function We(e3, t2) {
  3962. switch (t2.type) {
  3963. case h.CHARACTER:
  3964. Ke(e3, t2);
  3965. break;
  3966. case h.WHITESPACE_CHARACTER:
  3967. Xe(e3, t2);
  3968. break;
  3969. case h.COMMENT:
  3970. Fe(e3, t2);
  3971. break;
  3972. case h.START_TAG:
  3973. Ze(e3, t2);
  3974. break;
  3975. case h.END_TAG:
  3976. et(e3, t2);
  3977. break;
  3978. case h.EOF:
  3979. tt(e3, t2);
  3980. }
  3981. }
  3982. function Xe(e3, t2) {
  3983. e3._reconstructActiveFormattingElements(), e3._insertCharacters(t2);
  3984. }
  3985. function Ke(e3, t2) {
  3986. e3._reconstructActiveFormattingElements(), e3._insertCharacters(t2), e3.framesetOk = false;
  3987. }
  3988. function Ve(e3, t2) {
  3989. e3._reconstructActiveFormattingElements(), e3._appendElement(t2, u.HTML), e3.framesetOk = false, t2.ackSelfClosing = true;
  3990. }
  3991. function ze(e3) {
  3992. const t2 = A(e3, N.TYPE);
  3993. return null != t2 && t2.toLowerCase() === Ie;
  3994. }
  3995. function je(e3, t2) {
  3996. e3._switchToTextParsing(t2, k.RAWTEXT);
  3997. }
  3998. function Je(e3, t2) {
  3999. e3._reconstructActiveFormattingElements(), e3._insertElement(t2, u.HTML);
  4000. }
  4001. function Ze(e3, t2) {
  4002. switch (t2.tagID) {
  4003. case S.I:
  4004. case S.S:
  4005. case S.B:
  4006. case S.U:
  4007. case S.EM:
  4008. case S.TT:
  4009. case S.BIG:
  4010. case S.CODE:
  4011. case S.FONT:
  4012. case S.SMALL:
  4013. case S.STRIKE:
  4014. case S.STRONG:
  4015. !function(e4, t3) {
  4016. e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML), e4.activeFormattingElements.pushElement(e4.openElements.current, t3);
  4017. }(e3, t2);
  4018. break;
  4019. case S.A:
  4020. !function(e4, t3) {
  4021. const s2 = e4.activeFormattingElements.getElementEntryInScopeWithTagName(C.A);
  4022. s2 && (He(e4, t3), e4.openElements.remove(s2.element), e4.activeFormattingElements.removeEntry(s2)), e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML), e4.activeFormattingElements.pushElement(e4.openElements.current, t3);
  4023. }(e3, t2);
  4024. break;
  4025. case S.H1:
  4026. case S.H2:
  4027. case S.H3:
  4028. case S.H4:
  4029. case S.H5:
  4030. case S.H6:
  4031. !function(e4, t3) {
  4032. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), M(e4.openElements.currentTagId) && e4.openElements.pop(), e4._insertElement(t3, u.HTML);
  4033. }(e3, t2);
  4034. break;
  4035. case S.P:
  4036. case S.DL:
  4037. case S.OL:
  4038. case S.UL:
  4039. case S.DIV:
  4040. case S.DIR:
  4041. case S.NAV:
  4042. case S.MAIN:
  4043. case S.MENU:
  4044. case S.ASIDE:
  4045. case S.CENTER:
  4046. case S.FIGURE:
  4047. case S.FOOTER:
  4048. case S.HEADER:
  4049. case S.HGROUP:
  4050. case S.DIALOG:
  4051. case S.DETAILS:
  4052. case S.ADDRESS:
  4053. case S.ARTICLE:
  4054. case S.SECTION:
  4055. case S.SUMMARY:
  4056. case S.FIELDSET:
  4057. case S.BLOCKQUOTE:
  4058. case S.FIGCAPTION:
  4059. !function(e4, t3) {
  4060. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML);
  4061. }(e3, t2);
  4062. break;
  4063. case S.LI:
  4064. case S.DD:
  4065. case S.DT:
  4066. !function(e4, t3) {
  4067. e4.framesetOk = false;
  4068. const s2 = t3.tagID;
  4069. for (let t4 = e4.openElements.stackTop; t4 >= 0; t4--) {
  4070. const a2 = e4.openElements.tagIDs[t4];
  4071. if (s2 === S.LI && a2 === S.LI || (s2 === S.DD || s2 === S.DT) && (a2 === S.DD || a2 === S.DT)) {
  4072. e4.openElements.generateImpliedEndTagsWithExclusion(a2), e4.openElements.popUntilTagNamePopped(a2);
  4073. break;
  4074. }
  4075. if (a2 !== S.ADDRESS && a2 !== S.DIV && a2 !== S.P && e4._isSpecialElement(e4.openElements.items[t4], a2)) break;
  4076. }
  4077. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML);
  4078. }(e3, t2);
  4079. break;
  4080. case S.BR:
  4081. case S.IMG:
  4082. case S.WBR:
  4083. case S.AREA:
  4084. case S.EMBED:
  4085. case S.KEYGEN:
  4086. Ve(e3, t2);
  4087. break;
  4088. case S.HR:
  4089. !function(e4, t3) {
  4090. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._appendElement(t3, u.HTML), e4.framesetOk = false, t3.ackSelfClosing = true;
  4091. }(e3, t2);
  4092. break;
  4093. case S.RB:
  4094. case S.RTC:
  4095. !function(e4, t3) {
  4096. e4.openElements.hasInScope(S.RUBY) && e4.openElements.generateImpliedEndTags(), e4._insertElement(t3, u.HTML);
  4097. }(e3, t2);
  4098. break;
  4099. case S.RT:
  4100. case S.RP:
  4101. !function(e4, t3) {
  4102. e4.openElements.hasInScope(S.RUBY) && e4.openElements.generateImpliedEndTagsWithExclusion(S.RTC), e4._insertElement(t3, u.HTML);
  4103. }(e3, t2);
  4104. break;
  4105. case S.PRE:
  4106. case S.LISTING:
  4107. !function(e4, t3) {
  4108. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML), e4.skipNextNewLine = true, e4.framesetOk = false;
  4109. }(e3, t2);
  4110. break;
  4111. case S.XMP:
  4112. !function(e4, t3) {
  4113. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._reconstructActiveFormattingElements(), e4.framesetOk = false, e4._switchToTextParsing(t3, k.RAWTEXT);
  4114. }(e3, t2);
  4115. break;
  4116. case S.SVG:
  4117. !function(e4, t3) {
  4118. e4._reconstructActiveFormattingElements(), ue(t3), Ne(t3), t3.selfClosing ? e4._appendElement(t3, u.SVG) : e4._insertElement(t3, u.SVG), t3.ackSelfClosing = true;
  4119. }(e3, t2);
  4120. break;
  4121. case S.HTML:
  4122. !function(e4, t3) {
  4123. 0 === e4.openElements.tmplCount && e4.treeAdapter.adoptAttributes(e4.openElements.items[0], t3.attrs);
  4124. }(e3, t2);
  4125. break;
  4126. case S.BASE:
  4127. case S.LINK:
  4128. case S.META:
  4129. case S.STYLE:
  4130. case S.TITLE:
  4131. case S.SCRIPT:
  4132. case S.BGSOUND:
  4133. case S.BASEFONT:
  4134. case S.TEMPLATE:
  4135. xe(e3, t2);
  4136. break;
  4137. case S.BODY:
  4138. !function(e4, t3) {
  4139. const s2 = e4.openElements.tryPeekProperlyNestedBodyElement();
  4140. s2 && 0 === e4.openElements.tmplCount && (e4.framesetOk = false, e4.treeAdapter.adoptAttributes(s2, t3.attrs));
  4141. }(e3, t2);
  4142. break;
  4143. case S.FORM:
  4144. !function(e4, t3) {
  4145. const s2 = e4.openElements.tmplCount > 0;
  4146. e4.formElement && !s2 || (e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML), s2 || (e4.formElement = e4.openElements.current));
  4147. }(e3, t2);
  4148. break;
  4149. case S.NOBR:
  4150. !function(e4, t3) {
  4151. e4._reconstructActiveFormattingElements(), e4.openElements.hasInScope(S.NOBR) && (He(e4, t3), e4._reconstructActiveFormattingElements()), e4._insertElement(t3, u.HTML), e4.activeFormattingElements.pushElement(e4.openElements.current, t3);
  4152. }(e3, t2);
  4153. break;
  4154. case S.MATH:
  4155. !function(e4, t3) {
  4156. e4._reconstructActiveFormattingElements(), pe(t3), Ne(t3), t3.selfClosing ? e4._appendElement(t3, u.MATHML) : e4._insertElement(t3, u.MATHML), t3.ackSelfClosing = true;
  4157. }(e3, t2);
  4158. break;
  4159. case S.TABLE:
  4160. !function(e4, t3) {
  4161. e4.treeAdapter.getDocumentMode(e4.document) !== I.QUIRKS && e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML), e4.framesetOk = false, e4.insertionMode = De.IN_TABLE;
  4162. }(e3, t2);
  4163. break;
  4164. case S.INPUT:
  4165. !function(e4, t3) {
  4166. e4._reconstructActiveFormattingElements(), e4._appendElement(t3, u.HTML), ze(t3) || (e4.framesetOk = false), t3.ackSelfClosing = true;
  4167. }(e3, t2);
  4168. break;
  4169. case S.PARAM:
  4170. case S.TRACK:
  4171. case S.SOURCE:
  4172. !function(e4, t3) {
  4173. e4._appendElement(t3, u.HTML), t3.ackSelfClosing = true;
  4174. }(e3, t2);
  4175. break;
  4176. case S.IMAGE:
  4177. !function(e4, t3) {
  4178. t3.tagName = C.IMG, t3.tagID = S.IMG, Ve(e4, t3);
  4179. }(e3, t2);
  4180. break;
  4181. case S.BUTTON:
  4182. !function(e4, t3) {
  4183. e4.openElements.hasInScope(S.BUTTON) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(S.BUTTON)), e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML), e4.framesetOk = false;
  4184. }(e3, t2);
  4185. break;
  4186. case S.APPLET:
  4187. case S.OBJECT:
  4188. case S.MARQUEE:
  4189. !function(e4, t3) {
  4190. e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML), e4.activeFormattingElements.insertMarker(), e4.framesetOk = false;
  4191. }(e3, t2);
  4192. break;
  4193. case S.IFRAME:
  4194. !function(e4, t3) {
  4195. e4.framesetOk = false, e4._switchToTextParsing(t3, k.RAWTEXT);
  4196. }(e3, t2);
  4197. break;
  4198. case S.SELECT:
  4199. !function(e4, t3) {
  4200. e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML), e4.framesetOk = false, e4.insertionMode = e4.insertionMode === De.IN_TABLE || e4.insertionMode === De.IN_CAPTION || e4.insertionMode === De.IN_TABLE_BODY || e4.insertionMode === De.IN_ROW || e4.insertionMode === De.IN_CELL ? De.IN_SELECT_IN_TABLE : De.IN_SELECT;
  4201. }(e3, t2);
  4202. break;
  4203. case S.OPTION:
  4204. case S.OPTGROUP:
  4205. !function(e4, t3) {
  4206. e4.openElements.currentTagId === S.OPTION && e4.openElements.pop(), e4._reconstructActiveFormattingElements(), e4._insertElement(t3, u.HTML);
  4207. }(e3, t2);
  4208. break;
  4209. case S.NOEMBED:
  4210. je(e3, t2);
  4211. break;
  4212. case S.FRAMESET:
  4213. !function(e4, t3) {
  4214. const s2 = e4.openElements.tryPeekProperlyNestedBodyElement();
  4215. e4.framesetOk && s2 && (e4.treeAdapter.detachNode(s2), e4.openElements.popAllUpToHtmlElement(), e4._insertElement(t3, u.HTML), e4.insertionMode = De.IN_FRAMESET);
  4216. }(e3, t2);
  4217. break;
  4218. case S.TEXTAREA:
  4219. !function(e4, t3) {
  4220. e4._insertElement(t3, u.HTML), e4.skipNextNewLine = true, e4.tokenizer.state = k.RCDATA, e4.originalInsertionMode = e4.insertionMode, e4.framesetOk = false, e4.insertionMode = De.TEXT;
  4221. }(e3, t2);
  4222. break;
  4223. case S.NOSCRIPT:
  4224. e3.options.scriptingEnabled ? je(e3, t2) : Je(e3, t2);
  4225. break;
  4226. case S.PLAINTEXT:
  4227. !function(e4, t3) {
  4228. e4.openElements.hasInButtonScope(S.P) && e4._closePElement(), e4._insertElement(t3, u.HTML), e4.tokenizer.state = k.PLAINTEXT;
  4229. }(e3, t2);
  4230. break;
  4231. case S.COL:
  4232. case S.TH:
  4233. case S.TD:
  4234. case S.TR:
  4235. case S.HEAD:
  4236. case S.FRAME:
  4237. case S.TBODY:
  4238. case S.TFOOT:
  4239. case S.THEAD:
  4240. case S.CAPTION:
  4241. case S.COLGROUP:
  4242. break;
  4243. default:
  4244. Je(e3, t2);
  4245. }
  4246. }
  4247. function $e(e3, t2) {
  4248. const s2 = t2.tagName, a2 = t2.tagID;
  4249. for (let t3 = e3.openElements.stackTop; t3 > 0; t3--) {
  4250. const r2 = e3.openElements.items[t3], n2 = e3.openElements.tagIDs[t3];
  4251. if (a2 === n2 && (a2 !== S.UNKNOWN || e3.treeAdapter.getTagName(r2) === s2)) {
  4252. e3.openElements.generateImpliedEndTagsWithExclusion(a2), e3.openElements.stackTop >= t3 && e3.openElements.shortenToLength(t3);
  4253. break;
  4254. }
  4255. if (e3._isSpecialElement(r2, n2)) break;
  4256. }
  4257. }
  4258. function et(e3, t2) {
  4259. switch (t2.tagID) {
  4260. case S.A:
  4261. case S.B:
  4262. case S.I:
  4263. case S.S:
  4264. case S.U:
  4265. case S.EM:
  4266. case S.TT:
  4267. case S.BIG:
  4268. case S.CODE:
  4269. case S.FONT:
  4270. case S.NOBR:
  4271. case S.SMALL:
  4272. case S.STRIKE:
  4273. case S.STRONG:
  4274. He(e3, t2);
  4275. break;
  4276. case S.P:
  4277. !function(e4) {
  4278. e4.openElements.hasInButtonScope(S.P) || e4._insertFakeElement(C.P, S.P), e4._closePElement();
  4279. }(e3);
  4280. break;
  4281. case S.DL:
  4282. case S.UL:
  4283. case S.OL:
  4284. case S.DIR:
  4285. case S.DIV:
  4286. case S.NAV:
  4287. case S.PRE:
  4288. case S.MAIN:
  4289. case S.MENU:
  4290. case S.ASIDE:
  4291. case S.BUTTON:
  4292. case S.CENTER:
  4293. case S.FIGURE:
  4294. case S.FOOTER:
  4295. case S.HEADER:
  4296. case S.HGROUP:
  4297. case S.DIALOG:
  4298. case S.ADDRESS:
  4299. case S.ARTICLE:
  4300. case S.DETAILS:
  4301. case S.SECTION:
  4302. case S.SUMMARY:
  4303. case S.LISTING:
  4304. case S.FIELDSET:
  4305. case S.BLOCKQUOTE:
  4306. case S.FIGCAPTION:
  4307. !function(e4, t3) {
  4308. const s2 = t3.tagID;
  4309. e4.openElements.hasInScope(s2) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(s2));
  4310. }(e3, t2);
  4311. break;
  4312. case S.LI:
  4313. !function(e4) {
  4314. e4.openElements.hasInListItemScope(S.LI) && (e4.openElements.generateImpliedEndTagsWithExclusion(S.LI), e4.openElements.popUntilTagNamePopped(S.LI));
  4315. }(e3);
  4316. break;
  4317. case S.DD:
  4318. case S.DT:
  4319. !function(e4, t3) {
  4320. const s2 = t3.tagID;
  4321. e4.openElements.hasInScope(s2) && (e4.openElements.generateImpliedEndTagsWithExclusion(s2), e4.openElements.popUntilTagNamePopped(s2));
  4322. }(e3, t2);
  4323. break;
  4324. case S.H1:
  4325. case S.H2:
  4326. case S.H3:
  4327. case S.H4:
  4328. case S.H5:
  4329. case S.H6:
  4330. !function(e4) {
  4331. e4.openElements.hasNumberedHeaderInScope() && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilNumberedHeaderPopped());
  4332. }(e3);
  4333. break;
  4334. case S.BR:
  4335. !function(e4) {
  4336. e4._reconstructActiveFormattingElements(), e4._insertFakeElement(C.BR, S.BR), e4.openElements.pop(), e4.framesetOk = false;
  4337. }(e3);
  4338. break;
  4339. case S.BODY:
  4340. !function(e4, t3) {
  4341. if (e4.openElements.hasInScope(S.BODY) && (e4.insertionMode = De.AFTER_BODY, e4.options.sourceCodeLocationInfo)) {
  4342. const s2 = e4.openElements.tryPeekProperlyNestedBodyElement();
  4343. s2 && e4._setEndLocation(s2, t3);
  4344. }
  4345. }(e3, t2);
  4346. break;
  4347. case S.HTML:
  4348. !function(e4, t3) {
  4349. e4.openElements.hasInScope(S.BODY) && (e4.insertionMode = De.AFTER_BODY, Nt(e4, t3));
  4350. }(e3, t2);
  4351. break;
  4352. case S.FORM:
  4353. !function(e4) {
  4354. const t3 = e4.openElements.tmplCount > 0, { formElement: s2 } = e4;
  4355. t3 || (e4.formElement = null), (s2 || t3) && e4.openElements.hasInScope(S.FORM) && (e4.openElements.generateImpliedEndTags(), t3 ? e4.openElements.popUntilTagNamePopped(S.FORM) : s2 && e4.openElements.remove(s2));
  4356. }(e3);
  4357. break;
  4358. case S.APPLET:
  4359. case S.OBJECT:
  4360. case S.MARQUEE:
  4361. !function(e4, t3) {
  4362. const s2 = t3.tagID;
  4363. e4.openElements.hasInScope(s2) && (e4.openElements.generateImpliedEndTags(), e4.openElements.popUntilTagNamePopped(s2), e4.activeFormattingElements.clearToLastMarker());
  4364. }(e3, t2);
  4365. break;
  4366. case S.TEMPLATE:
  4367. Ye(e3, t2);
  4368. break;
  4369. default:
  4370. $e(e3, t2);
  4371. }
  4372. }
  4373. function tt(e3, t2) {
  4374. e3.tmplInsertionModeStack.length > 0 ? ut(e3, t2) : Ue(e3, t2);
  4375. }
  4376. function st(e3, t2) {
  4377. if (Oe.has(e3.openElements.currentTagId)) switch (e3.pendingCharacterTokens.length = 0, e3.hasNonWhitespacePendingCharacterToken = false, e3.originalInsertionMode = e3.insertionMode, e3.insertionMode = De.IN_TABLE_TEXT, t2.type) {
  4378. case h.CHARACTER:
  4379. ot(e3, t2);
  4380. break;
  4381. case h.WHITESPACE_CHARACTER:
  4382. it(e3, t2);
  4383. }
  4384. else nt(e3, t2);
  4385. }
  4386. function at(e3, t2) {
  4387. switch (t2.tagID) {
  4388. case S.TD:
  4389. case S.TH:
  4390. case S.TR:
  4391. !function(e4, t3) {
  4392. e4.openElements.clearBackToTableContext(), e4._insertFakeElement(C.TBODY, S.TBODY), e4.insertionMode = De.IN_TABLE_BODY, _t(e4, t3);
  4393. }(e3, t2);
  4394. break;
  4395. case S.STYLE:
  4396. case S.SCRIPT:
  4397. case S.TEMPLATE:
  4398. xe(e3, t2);
  4399. break;
  4400. case S.COL:
  4401. !function(e4, t3) {
  4402. e4.openElements.clearBackToTableContext(), e4._insertFakeElement(C.COLGROUP, S.COLGROUP), e4.insertionMode = De.IN_COLUMN_GROUP, Tt(e4, t3);
  4403. }(e3, t2);
  4404. break;
  4405. case S.FORM:
  4406. !function(e4, t3) {
  4407. e4.formElement || 0 !== e4.openElements.tmplCount || (e4._insertElement(t3, u.HTML), e4.formElement = e4.openElements.current, e4.openElements.pop());
  4408. }(e3, t2);
  4409. break;
  4410. case S.TABLE:
  4411. !function(e4, t3) {
  4412. e4.openElements.hasInTableScope(S.TABLE) && (e4.openElements.popUntilTagNamePopped(S.TABLE), e4._resetInsertionMode(), e4._processStartTag(t3));
  4413. }(e3, t2);
  4414. break;
  4415. case S.TBODY:
  4416. case S.TFOOT:
  4417. case S.THEAD:
  4418. !function(e4, t3) {
  4419. e4.openElements.clearBackToTableContext(), e4._insertElement(t3, u.HTML), e4.insertionMode = De.IN_TABLE_BODY;
  4420. }(e3, t2);
  4421. break;
  4422. case S.INPUT:
  4423. !function(e4, t3) {
  4424. ze(t3) ? e4._appendElement(t3, u.HTML) : nt(e4, t3), t3.ackSelfClosing = true;
  4425. }(e3, t2);
  4426. break;
  4427. case S.CAPTION:
  4428. !function(e4, t3) {
  4429. e4.openElements.clearBackToTableContext(), e4.activeFormattingElements.insertMarker(), e4._insertElement(t3, u.HTML), e4.insertionMode = De.IN_CAPTION;
  4430. }(e3, t2);
  4431. break;
  4432. case S.COLGROUP:
  4433. !function(e4, t3) {
  4434. e4.openElements.clearBackToTableContext(), e4._insertElement(t3, u.HTML), e4.insertionMode = De.IN_COLUMN_GROUP;
  4435. }(e3, t2);
  4436. break;
  4437. default:
  4438. nt(e3, t2);
  4439. }
  4440. }
  4441. function rt(e3, t2) {
  4442. switch (t2.tagID) {
  4443. case S.TABLE:
  4444. e3.openElements.hasInTableScope(S.TABLE) && (e3.openElements.popUntilTagNamePopped(S.TABLE), e3._resetInsertionMode());
  4445. break;
  4446. case S.TEMPLATE:
  4447. Ye(e3, t2);
  4448. break;
  4449. case S.BODY:
  4450. case S.CAPTION:
  4451. case S.COL:
  4452. case S.COLGROUP:
  4453. case S.HTML:
  4454. case S.TBODY:
  4455. case S.TD:
  4456. case S.TFOOT:
  4457. case S.TH:
  4458. case S.THEAD:
  4459. case S.TR:
  4460. break;
  4461. default:
  4462. nt(e3, t2);
  4463. }
  4464. }
  4465. function nt(e3, t2) {
  4466. const s2 = e3.fosterParentingEnabled;
  4467. e3.fosterParentingEnabled = true, We(e3, t2), e3.fosterParentingEnabled = s2;
  4468. }
  4469. function it(e3, t2) {
  4470. e3.pendingCharacterTokens.push(t2);
  4471. }
  4472. function ot(e3, t2) {
  4473. e3.pendingCharacterTokens.push(t2), e3.hasNonWhitespacePendingCharacterToken = true;
  4474. }
  4475. function ct(e3, t2) {
  4476. let s2 = 0;
  4477. if (e3.hasNonWhitespacePendingCharacterToken) for (; s2 < e3.pendingCharacterTokens.length; s2++) nt(e3, e3.pendingCharacterTokens[s2]);
  4478. else for (; s2 < e3.pendingCharacterTokens.length; s2++) e3._insertCharacters(e3.pendingCharacterTokens[s2]);
  4479. e3.insertionMode = e3.originalInsertionMode, e3._processToken(t2);
  4480. }
  4481. const Et = /* @__PURE__ */ new Set([S.CAPTION, S.COL, S.COLGROUP, S.TBODY, S.TD, S.TFOOT, S.TH, S.THEAD, S.TR]);
  4482. function Tt(e3, t2) {
  4483. switch (t2.tagID) {
  4484. case S.HTML:
  4485. Ze(e3, t2);
  4486. break;
  4487. case S.COL:
  4488. e3._appendElement(t2, u.HTML), t2.ackSelfClosing = true;
  4489. break;
  4490. case S.TEMPLATE:
  4491. xe(e3, t2);
  4492. break;
  4493. default:
  4494. ht(e3, t2);
  4495. }
  4496. }
  4497. function ht(e3, t2) {
  4498. e3.openElements.currentTagId === S.COLGROUP && (e3.openElements.pop(), e3.insertionMode = De.IN_TABLE, e3._processToken(t2));
  4499. }
  4500. function _t(e3, t2) {
  4501. switch (t2.tagID) {
  4502. case S.TR:
  4503. e3.openElements.clearBackToTableBodyContext(), e3._insertElement(t2, u.HTML), e3.insertionMode = De.IN_ROW;
  4504. break;
  4505. case S.TH:
  4506. case S.TD:
  4507. e3.openElements.clearBackToTableBodyContext(), e3._insertFakeElement(C.TR, S.TR), e3.insertionMode = De.IN_ROW, lt(e3, t2);
  4508. break;
  4509. case S.CAPTION:
  4510. case S.COL:
  4511. case S.COLGROUP:
  4512. case S.TBODY:
  4513. case S.TFOOT:
  4514. case S.THEAD:
  4515. e3.openElements.hasTableBodyContextInTableScope() && (e3.openElements.clearBackToTableBodyContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE, at(e3, t2));
  4516. break;
  4517. default:
  4518. at(e3, t2);
  4519. }
  4520. }
  4521. function At(e3, t2) {
  4522. const s2 = t2.tagID;
  4523. switch (t2.tagID) {
  4524. case S.TBODY:
  4525. case S.TFOOT:
  4526. case S.THEAD:
  4527. e3.openElements.hasInTableScope(s2) && (e3.openElements.clearBackToTableBodyContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE);
  4528. break;
  4529. case S.TABLE:
  4530. e3.openElements.hasTableBodyContextInTableScope() && (e3.openElements.clearBackToTableBodyContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE, rt(e3, t2));
  4531. break;
  4532. case S.BODY:
  4533. case S.CAPTION:
  4534. case S.COL:
  4535. case S.COLGROUP:
  4536. case S.HTML:
  4537. case S.TD:
  4538. case S.TH:
  4539. case S.TR:
  4540. break;
  4541. default:
  4542. rt(e3, t2);
  4543. }
  4544. }
  4545. function lt(e3, t2) {
  4546. switch (t2.tagID) {
  4547. case S.TH:
  4548. case S.TD:
  4549. e3.openElements.clearBackToTableRowContext(), e3._insertElement(t2, u.HTML), e3.insertionMode = De.IN_CELL, e3.activeFormattingElements.insertMarker();
  4550. break;
  4551. case S.CAPTION:
  4552. case S.COL:
  4553. case S.COLGROUP:
  4554. case S.TBODY:
  4555. case S.TFOOT:
  4556. case S.THEAD:
  4557. case S.TR:
  4558. e3.openElements.hasInTableScope(S.TR) && (e3.openElements.clearBackToTableRowContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE_BODY, _t(e3, t2));
  4559. break;
  4560. default:
  4561. at(e3, t2);
  4562. }
  4563. }
  4564. function mt(e3, t2) {
  4565. switch (t2.tagID) {
  4566. case S.TR:
  4567. e3.openElements.hasInTableScope(S.TR) && (e3.openElements.clearBackToTableRowContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE_BODY);
  4568. break;
  4569. case S.TABLE:
  4570. e3.openElements.hasInTableScope(S.TR) && (e3.openElements.clearBackToTableRowContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE_BODY, At(e3, t2));
  4571. break;
  4572. case S.TBODY:
  4573. case S.TFOOT:
  4574. case S.THEAD:
  4575. (e3.openElements.hasInTableScope(t2.tagID) || e3.openElements.hasInTableScope(S.TR)) && (e3.openElements.clearBackToTableRowContext(), e3.openElements.pop(), e3.insertionMode = De.IN_TABLE_BODY, At(e3, t2));
  4576. break;
  4577. case S.BODY:
  4578. case S.CAPTION:
  4579. case S.COL:
  4580. case S.COLGROUP:
  4581. case S.HTML:
  4582. case S.TD:
  4583. case S.TH:
  4584. break;
  4585. default:
  4586. rt(e3, t2);
  4587. }
  4588. }
  4589. function dt(e3, t2) {
  4590. switch (t2.tagID) {
  4591. case S.HTML:
  4592. Ze(e3, t2);
  4593. break;
  4594. case S.OPTION:
  4595. e3.openElements.currentTagId === S.OPTION && e3.openElements.pop(), e3._insertElement(t2, u.HTML);
  4596. break;
  4597. case S.OPTGROUP:
  4598. e3.openElements.currentTagId === S.OPTION && e3.openElements.pop(), e3.openElements.currentTagId === S.OPTGROUP && e3.openElements.pop(), e3._insertElement(t2, u.HTML);
  4599. break;
  4600. case S.INPUT:
  4601. case S.KEYGEN:
  4602. case S.TEXTAREA:
  4603. case S.SELECT:
  4604. e3.openElements.hasInSelectScope(S.SELECT) && (e3.openElements.popUntilTagNamePopped(S.SELECT), e3._resetInsertionMode(), t2.tagID !== S.SELECT && e3._processStartTag(t2));
  4605. break;
  4606. case S.SCRIPT:
  4607. case S.TEMPLATE:
  4608. xe(e3, t2);
  4609. }
  4610. }
  4611. function pt(e3, t2) {
  4612. switch (t2.tagID) {
  4613. case S.OPTGROUP:
  4614. e3.openElements.stackTop > 0 && e3.openElements.currentTagId === S.OPTION && e3.openElements.tagIDs[e3.openElements.stackTop - 1] === S.OPTGROUP && e3.openElements.pop(), e3.openElements.currentTagId === S.OPTGROUP && e3.openElements.pop();
  4615. break;
  4616. case S.OPTION:
  4617. e3.openElements.currentTagId === S.OPTION && e3.openElements.pop();
  4618. break;
  4619. case S.SELECT:
  4620. e3.openElements.hasInSelectScope(S.SELECT) && (e3.openElements.popUntilTagNamePopped(S.SELECT), e3._resetInsertionMode());
  4621. break;
  4622. case S.TEMPLATE:
  4623. Ye(e3, t2);
  4624. }
  4625. }
  4626. function ut(e3, t2) {
  4627. e3.openElements.tmplCount > 0 ? (e3.openElements.popUntilTagNamePopped(S.TEMPLATE), e3.activeFormattingElements.clearToLastMarker(), e3.tmplInsertionModeStack.shift(), e3._resetInsertionMode(), e3.onEof(t2)) : Ue(e3, t2);
  4628. }
  4629. function Nt(e3, t2) {
  4630. var s2;
  4631. if (t2.tagID === S.HTML) {
  4632. if (e3.fragmentContext || (e3.insertionMode = De.AFTER_AFTER_BODY), e3.options.sourceCodeLocationInfo && e3.openElements.tagIDs[0] === S.HTML) {
  4633. e3._setEndLocation(e3.openElements.items[0], t2);
  4634. const a2 = e3.openElements.items[1];
  4635. a2 && !(null === (s2 = e3.treeAdapter.getNodeSourceCodeLocation(a2)) || void 0 === s2 ? void 0 : s2.endTag) && e3._setEndLocation(a2, t2);
  4636. }
  4637. } else It(e3, t2);
  4638. }
  4639. function It(e3, t2) {
  4640. e3.insertionMode = De.IN_BODY, We(e3, t2);
  4641. }
  4642. function Ct(e3, t2) {
  4643. e3.insertionMode = De.IN_BODY, We(e3, t2);
  4644. }
  4645. function St(e3) {
  4646. for (; e3.treeAdapter.getNamespaceURI(e3.openElements.current) !== u.HTML && !e3._isIntegrationPoint(e3.openElements.currentTagId, e3.openElements.current); ) e3.openElements.pop();
  4647. }
  4648. return /* @__PURE__ */ new Set([C.AREA, C.BASE, C.BASEFONT, C.BGSOUND, C.BR, C.COL, C.EMBED, C.FRAME, C.HR, C.IMG, C.INPUT, C.KEYGEN, C.LINK, C.META, C.PARAM, C.SOURCE, C.TRACK, C.WBR]), e2.parse = function(e3, t2) {
  4649. return Le.parse(e3, t2);
  4650. }, e2.parseFragment = function(e3, t2, s2) {
  4651. "string" == typeof e3 && (s2 = t2, t2 = e3, e3 = null);
  4652. const a2 = Le.getFragmentParser(e3, s2);
  4653. return a2.tokenizer.write(t2, true), a2.getFragment();
  4654. }, Object.defineProperty(e2, "__esModule", { value: true }), e2;
  4655. }({});
  4656. var parse = e.parse;
  4657. var parseFragment = e.parseFragment;
  4658. // src/mock-doc/parse-util.ts
  4659. var docParser = /* @__PURE__ */ new WeakMap();
  4660. function parseDocumentUtil(ownerDocument, html) {
  4661. const doc = parse(html.trim(), getParser(ownerDocument));
  4662. doc.documentElement = doc.firstElementChild;
  4663. doc.head = doc.documentElement.firstElementChild;
  4664. doc.body = doc.head.nextElementSibling;
  4665. return doc;
  4666. }
  4667. function parseFragmentUtil(ownerDocument, html) {
  4668. if (typeof html === "string") {
  4669. html = html.trim();
  4670. } else {
  4671. html = "";
  4672. }
  4673. const frag = parseFragment(html, getParser(ownerDocument));
  4674. return frag;
  4675. }
  4676. function getParser(ownerDocument) {
  4677. let parseOptions = docParser.get(ownerDocument);
  4678. if (parseOptions != null) {
  4679. return parseOptions;
  4680. }
  4681. const treeAdapter = {
  4682. createDocument() {
  4683. const doc = ownerDocument.createElement("#document" /* DOCUMENT_NODE */);
  4684. doc["x-mode"] = "no-quirks";
  4685. return doc;
  4686. },
  4687. setNodeSourceCodeLocation(node, location2) {
  4688. node.sourceCodeLocation = location2;
  4689. },
  4690. getNodeSourceCodeLocation(node) {
  4691. return node.sourceCodeLocation;
  4692. },
  4693. createDocumentFragment() {
  4694. return ownerDocument.createDocumentFragment();
  4695. },
  4696. createElement(tagName, namespaceURI, attrs) {
  4697. const elm = ownerDocument.createElementNS(namespaceURI, tagName);
  4698. for (let i = 0; i < attrs.length; i++) {
  4699. const attr = attrs[i];
  4700. if (attr.namespace == null || attr.namespace === "http://www.w3.org/1999/xhtml") {
  4701. elm.setAttribute(attr.name, attr.value);
  4702. } else {
  4703. elm.setAttributeNS(attr.namespace, attr.name, attr.value);
  4704. }
  4705. }
  4706. return elm;
  4707. },
  4708. createCommentNode(data) {
  4709. return ownerDocument.createComment(data);
  4710. },
  4711. appendChild(parentNode, newNode) {
  4712. parentNode.appendChild(newNode);
  4713. },
  4714. insertBefore(parentNode, newNode, referenceNode) {
  4715. parentNode.insertBefore(newNode, referenceNode);
  4716. },
  4717. setTemplateContent(templateElement, contentElement) {
  4718. templateElement.content = contentElement;
  4719. },
  4720. getTemplateContent(templateElement) {
  4721. return templateElement.content;
  4722. },
  4723. setDocumentType(doc, name, publicId, systemId) {
  4724. let doctypeNode = doc.childNodes.find((n) => n.nodeType === 10 /* DOCUMENT_TYPE_NODE */);
  4725. if (doctypeNode == null) {
  4726. doctypeNode = ownerDocument.createDocumentTypeNode();
  4727. doc.insertBefore(doctypeNode, doc.firstChild);
  4728. }
  4729. doctypeNode.nodeValue = "!DOCTYPE";
  4730. doctypeNode["x-name"] = name;
  4731. doctypeNode["x-publicId"] = publicId;
  4732. doctypeNode["x-systemId"] = systemId;
  4733. },
  4734. setDocumentMode(doc, mode) {
  4735. doc["x-mode"] = mode;
  4736. },
  4737. getDocumentMode(doc) {
  4738. return doc["x-mode"];
  4739. },
  4740. detachNode(node) {
  4741. node.remove();
  4742. },
  4743. insertText(parentNode, text) {
  4744. const lastChild = parentNode.lastChild;
  4745. if (lastChild != null && lastChild.nodeType === 3 /* TEXT_NODE */) {
  4746. lastChild.nodeValue += text;
  4747. } else {
  4748. parentNode.appendChild(ownerDocument.createTextNode(text));
  4749. }
  4750. },
  4751. insertTextBefore(parentNode, text, referenceNode) {
  4752. const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
  4753. if (prevNode != null && prevNode.nodeType === 3 /* TEXT_NODE */) {
  4754. prevNode.nodeValue += text;
  4755. } else {
  4756. parentNode.insertBefore(ownerDocument.createTextNode(text), referenceNode);
  4757. }
  4758. },
  4759. adoptAttributes(recipient, attrs) {
  4760. for (let i = 0; i < attrs.length; i++) {
  4761. const attr = attrs[i];
  4762. if (recipient.hasAttributeNS(attr.namespace, attr.name) === false) {
  4763. recipient.setAttributeNS(attr.namespace, attr.name, attr.value);
  4764. }
  4765. }
  4766. },
  4767. getFirstChild(node) {
  4768. return node.childNodes[0];
  4769. },
  4770. getChildNodes(node) {
  4771. return node.childNodes;
  4772. },
  4773. getParentNode(node) {
  4774. return node.parentNode;
  4775. },
  4776. getAttrList(element) {
  4777. const attrs = element.attributes.__items.map((attr) => {
  4778. return {
  4779. name: attr.name,
  4780. value: attr.value,
  4781. namespace: attr.namespaceURI,
  4782. prefix: null
  4783. };
  4784. });
  4785. return attrs;
  4786. },
  4787. getTagName(element) {
  4788. if (element.namespaceURI === "http://www.w3.org/1999/xhtml") {
  4789. return element.nodeName.toLowerCase();
  4790. } else {
  4791. return element.nodeName;
  4792. }
  4793. },
  4794. getNamespaceURI(element) {
  4795. return element.namespaceURI;
  4796. },
  4797. getTextNodeContent(textNode) {
  4798. return textNode.nodeValue;
  4799. },
  4800. getCommentNodeContent(commentNode) {
  4801. return commentNode.nodeValue;
  4802. },
  4803. getDocumentTypeNodeName(doctypeNode) {
  4804. return doctypeNode["x-name"];
  4805. },
  4806. getDocumentTypeNodePublicId(doctypeNode) {
  4807. return doctypeNode["x-publicId"];
  4808. },
  4809. getDocumentTypeNodeSystemId(doctypeNode) {
  4810. return doctypeNode["x-systemId"];
  4811. },
  4812. // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['text']`. As a result, we cannot
  4813. // complete this function signature
  4814. isTextNode(node) {
  4815. return node.nodeType === 3 /* TEXT_NODE */;
  4816. },
  4817. // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['comment']`. As a result, we cannot
  4818. // complete this function signature (which requires its return type to be a type predicate)
  4819. isCommentNode(node) {
  4820. return node.nodeType === 8 /* COMMENT_NODE */;
  4821. },
  4822. // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['document']`. As a result, we cannot
  4823. // complete this function signature (which requires its return type to be a type predicate)
  4824. isDocumentTypeNode(node) {
  4825. return node.nodeType === 10 /* DOCUMENT_TYPE_NODE */;
  4826. },
  4827. // @ts-ignore - a `MockNode` will never be assignable to a `TreeAdapterTypeMap['element']`. As a result, we cannot
  4828. // complete this function signature (which requires its return type to be a type predicate)
  4829. isElementNode(node) {
  4830. return node.nodeType === 1 /* ELEMENT_NODE */;
  4831. }
  4832. };
  4833. parseOptions = {
  4834. treeAdapter
  4835. };
  4836. docParser.set(ownerDocument, parseOptions);
  4837. return parseOptions;
  4838. }
  4839. // src/mock-doc/third-party/jquery.ts
  4840. var jquery_default = (
  4841. /*!
  4842. * jQuery JavaScript Library v4.0.0-pre+9352011a7.dirty +selector
  4843. * https://jquery.com/
  4844. *
  4845. * Copyright OpenJS Foundation and other contributors
  4846. * Released under the MIT license
  4847. * https://jquery.org/license
  4848. *
  4849. * Date: 2023-12-11T17:55Z
  4850. */
  4851. function(global2, factory) {
  4852. "use strict";
  4853. if (true) {
  4854. return factory(global2, true);
  4855. } else {
  4856. factory(global2);
  4857. }
  4858. }({
  4859. document: {
  4860. createElement() {
  4861. return {};
  4862. },
  4863. nodeType: 9,
  4864. documentElement: {
  4865. nodeType: 1,
  4866. nodeName: "HTML"
  4867. }
  4868. }
  4869. }, function(window2, noGlobal) {
  4870. "use strict";
  4871. if (!window2.document) {
  4872. throw new Error("jQuery requires a window with a document");
  4873. }
  4874. var arr = [];
  4875. var getProto = Object.getPrototypeOf;
  4876. var slice = arr.slice;
  4877. var flat = arr.flat ? function(array) {
  4878. return arr.flat.call(array);
  4879. } : function(array) {
  4880. return arr.concat.apply([], array);
  4881. };
  4882. var push = arr.push;
  4883. var indexOf = arr.indexOf;
  4884. var class2type = {};
  4885. var toString = class2type.toString;
  4886. var hasOwn = class2type.hasOwnProperty;
  4887. var fnToString = hasOwn.toString;
  4888. var ObjectFunctionString = fnToString.call(Object);
  4889. var support = {};
  4890. function toType(obj) {
  4891. if (obj == null) {
  4892. return obj + "";
  4893. }
  4894. return typeof obj === "object" ? class2type[toString.call(obj)] || "object" : typeof obj;
  4895. }
  4896. function isWindow(obj) {
  4897. return obj != null && obj === obj.window;
  4898. }
  4899. function isArrayLike(obj) {
  4900. var length = !!obj && obj.length, type = toType(obj);
  4901. if (typeof obj === "function" || isWindow(obj)) {
  4902. return false;
  4903. }
  4904. return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
  4905. }
  4906. var document = window2.document;
  4907. var preservedScriptAttributes = {
  4908. type: true,
  4909. src: true,
  4910. nonce: true,
  4911. noModule: true
  4912. };
  4913. function DOMEval(code, node, doc) {
  4914. doc = doc || document;
  4915. var i2, script = doc.createElement("script");
  4916. script.text = code;
  4917. if (node) {
  4918. for (i2 in preservedScriptAttributes) {
  4919. if (node[i2]) {
  4920. script[i2] = node[i2];
  4921. }
  4922. }
  4923. }
  4924. doc.head.appendChild(script).parentNode.removeChild(script);
  4925. }
  4926. const jQuery = {};
  4927. var version = "4.0.0-pre+9352011a7.dirty +selector", rhtmlSuffix = /HTML$/i, jQueryOrig = function(selector, context) {
  4928. return new jQuery.fn.init(selector, context);
  4929. };
  4930. jQuery.fn = jQuery.prototype = {
  4931. // The current version of jQuery being used
  4932. jquery: version,
  4933. constructor: jQuery,
  4934. // The default length of a jQuery object is 0
  4935. length: 0,
  4936. toArray: function() {
  4937. return slice.call(this);
  4938. },
  4939. // Get the Nth element in the matched element set OR
  4940. // Get the whole matched element set as a clean array
  4941. get: function(num) {
  4942. if (num == null) {
  4943. return slice.call(this);
  4944. }
  4945. return num < 0 ? this[num + this.length] : this[num];
  4946. },
  4947. // Take an array of elements and push it onto the stack
  4948. // (returning the new matched element set)
  4949. pushStack: function(elems) {
  4950. var ret = jQuery.merge(this.constructor(), elems);
  4951. ret.prevObject = this;
  4952. return ret;
  4953. },
  4954. // Execute a callback for every element in the matched set.
  4955. each: function(callback) {
  4956. return jQuery.each(this, callback);
  4957. },
  4958. map: function(callback) {
  4959. return this.pushStack(jQuery.map(this, function(elem, i2) {
  4960. return callback.call(elem, i2, elem);
  4961. }));
  4962. },
  4963. slice: function() {
  4964. return this.pushStack(slice.apply(this, arguments));
  4965. },
  4966. first: function() {
  4967. return this.eq(0);
  4968. },
  4969. last: function() {
  4970. return this.eq(-1);
  4971. },
  4972. even: function() {
  4973. return this.pushStack(jQuery.grep(this, function(_elem, i2) {
  4974. return (i2 + 1) % 2;
  4975. }));
  4976. },
  4977. odd: function() {
  4978. return this.pushStack(jQuery.grep(this, function(_elem, i2) {
  4979. return i2 % 2;
  4980. }));
  4981. },
  4982. eq: function(i2) {
  4983. var len = this.length, j = +i2 + (i2 < 0 ? len : 0);
  4984. return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
  4985. },
  4986. end: function() {
  4987. return this.prevObject || this.constructor();
  4988. }
  4989. };
  4990. jQuery.extend = jQuery.fn.extend = function() {
  4991. var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i2 = 1, length = arguments.length, deep = false;
  4992. if (typeof target === "boolean") {
  4993. deep = target;
  4994. target = arguments[i2] || {};
  4995. i2++;
  4996. }
  4997. if (typeof target !== "object" && typeof target !== "function") {
  4998. target = {};
  4999. }
  5000. if (i2 === length) {
  5001. target = this;
  5002. i2--;
  5003. }
  5004. for (; i2 < length; i2++) {
  5005. if ((options = arguments[i2]) != null) {
  5006. for (name in options) {
  5007. copy = options[name];
  5008. if (name === "__proto__" || target === copy) {
  5009. continue;
  5010. }
  5011. if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
  5012. src = target[name];
  5013. if (copyIsArray && !Array.isArray(src)) {
  5014. clone = [];
  5015. } else if (!copyIsArray && !jQuery.isPlainObject(src)) {
  5016. clone = {};
  5017. } else {
  5018. clone = src;
  5019. }
  5020. copyIsArray = false;
  5021. target[name] = jQuery.extend(deep, clone, copy);
  5022. } else if (copy !== void 0) {
  5023. target[name] = copy;
  5024. }
  5025. }
  5026. }
  5027. }
  5028. return target;
  5029. };
  5030. jQuery.extend({
  5031. // Unique for each copy of jQuery on the page
  5032. expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
  5033. // Assume jQuery is ready without the ready module
  5034. isReady: true,
  5035. error: function(msg) {
  5036. throw new Error(msg);
  5037. },
  5038. noop: function() {
  5039. },
  5040. isPlainObject: function(obj) {
  5041. var proto, Ctor;
  5042. if (!obj || toString.call(obj) !== "[object Object]") {
  5043. return false;
  5044. }
  5045. proto = getProto(obj);
  5046. if (!proto) {
  5047. return true;
  5048. }
  5049. Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
  5050. return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
  5051. },
  5052. isEmptyObject: function(obj) {
  5053. var name;
  5054. for (name in obj) {
  5055. return false;
  5056. }
  5057. return true;
  5058. },
  5059. // Evaluates a script in a provided context; falls back to the global one
  5060. // if not specified.
  5061. globalEval: function(code, options, doc) {
  5062. DOMEval(code, { nonce: options && options.nonce }, doc);
  5063. },
  5064. each: function(obj, callback) {
  5065. var length, i2 = 0;
  5066. if (isArrayLike(obj)) {
  5067. length = obj.length;
  5068. for (; i2 < length; i2++) {
  5069. if (callback.call(obj[i2], i2, obj[i2]) === false) {
  5070. break;
  5071. }
  5072. }
  5073. } else {
  5074. for (i2 in obj) {
  5075. if (callback.call(obj[i2], i2, obj[i2]) === false) {
  5076. break;
  5077. }
  5078. }
  5079. }
  5080. return obj;
  5081. },
  5082. // Retrieve the text value of an array of DOM nodes
  5083. text: function(elem) {
  5084. var node, ret = "", i2 = 0, nodeType = elem.nodeType;
  5085. if (!nodeType) {
  5086. while (node = elem[i2++]) {
  5087. ret += jQuery.text(node);
  5088. }
  5089. }
  5090. if (nodeType === 1 || nodeType === 11) {
  5091. return elem.textContent;
  5092. }
  5093. if (nodeType === 9) {
  5094. return elem.documentElement.textContent;
  5095. }
  5096. if (nodeType === 3 || nodeType === 4) {
  5097. return elem.nodeValue;
  5098. }
  5099. return ret;
  5100. },
  5101. // results is for internal usage only
  5102. makeArray: function(arr2, results) {
  5103. var ret = results || [];
  5104. if (arr2 != null) {
  5105. if (isArrayLike(Object(arr2))) {
  5106. jQuery.merge(
  5107. ret,
  5108. typeof arr2 === "string" ? [arr2] : arr2
  5109. );
  5110. } else {
  5111. push.call(ret, arr2);
  5112. }
  5113. }
  5114. return ret;
  5115. },
  5116. inArray: function(elem, arr2, i2) {
  5117. return arr2 == null ? -1 : indexOf.call(arr2, elem, i2);
  5118. },
  5119. isXMLDoc: function(elem) {
  5120. var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement;
  5121. return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML");
  5122. },
  5123. // Note: an element does not contain itself
  5124. contains: function(a, b) {
  5125. var bup = b && b.parentNode;
  5126. return a === bup || !!(bup && bup.nodeType === 1 && // Support: IE 9 - 11+
  5127. // IE doesn't have `contains` on SVG.
  5128. (a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
  5129. },
  5130. merge: function(first, second) {
  5131. var len = +second.length, j = 0, i2 = first.length;
  5132. for (; j < len; j++) {
  5133. first[i2++] = second[j];
  5134. }
  5135. first.length = i2;
  5136. return first;
  5137. },
  5138. grep: function(elems, callback, invert) {
  5139. var callbackInverse, matches3 = [], i2 = 0, length = elems.length, callbackExpect = !invert;
  5140. for (; i2 < length; i2++) {
  5141. callbackInverse = !callback(elems[i2], i2);
  5142. if (callbackInverse !== callbackExpect) {
  5143. matches3.push(elems[i2]);
  5144. }
  5145. }
  5146. return matches3;
  5147. },
  5148. // arg is for internal usage only
  5149. map: function(elems, callback, arg) {
  5150. var length, value, i2 = 0, ret = [];
  5151. if (isArrayLike(elems)) {
  5152. length = elems.length;
  5153. for (; i2 < length; i2++) {
  5154. value = callback(elems[i2], i2, arg);
  5155. if (value != null) {
  5156. ret.push(value);
  5157. }
  5158. }
  5159. } else {
  5160. for (i2 in elems) {
  5161. value = callback(elems[i2], i2, arg);
  5162. if (value != null) {
  5163. ret.push(value);
  5164. }
  5165. }
  5166. }
  5167. return flat(ret);
  5168. },
  5169. // A global GUID counter for objects
  5170. guid: 1,
  5171. // jQuery.support is not used in Core but other projects attach their
  5172. // properties to it so it needs to exist.
  5173. support
  5174. });
  5175. if (typeof Symbol === "function") {
  5176. jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
  5177. }
  5178. jQuery.each(
  5179. "Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
  5180. function(_i, name) {
  5181. class2type["[object " + name + "]"] = name.toLowerCase();
  5182. }
  5183. );
  5184. function nodeName(elem, name) {
  5185. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  5186. }
  5187. var pop = arr.pop;
  5188. var whitespace = "[\\x20\\t\\r\\n\\f]";
  5189. var isIE = document.documentMode;
  5190. try {
  5191. document.querySelector(":has(*,:jqfake)");
  5192. support.cssHas = false;
  5193. } catch (e2) {
  5194. support.cssHas = true;
  5195. }
  5196. var rbuggyQSA = [];
  5197. if (isIE) {
  5198. rbuggyQSA.push(
  5199. // Support: IE 9 - 11+
  5200. // IE's :disabled selector does not pick up the children of disabled fieldsets
  5201. ":enabled",
  5202. ":disabled",
  5203. // Support: IE 11+
  5204. // IE 11 doesn't find elements on a `[name='']` query in some cases.
  5205. // Adding a temporary attribute to the document before the selection works
  5206. // around the issue.
  5207. "\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + `*(?:''|"")`
  5208. );
  5209. }
  5210. if (!support.cssHas) {
  5211. rbuggyQSA.push(":has");
  5212. }
  5213. rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
  5214. var rtrimCSS = new RegExp(
  5215. "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
  5216. "g"
  5217. );
  5218. var identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+";
  5219. var booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped";
  5220. var rleadingCombinator = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*");
  5221. var rdescend = new RegExp(whitespace + "|>");
  5222. var rsibling = /[+~]/;
  5223. var documentElement = document.documentElement;
  5224. var matches2 = documentElement.matches || documentElement.msMatchesSelector;
  5225. function createCache() {
  5226. var keys = [];
  5227. function cache(key, value) {
  5228. if (keys.push(key + " ") > jQuery.expr.cacheLength) {
  5229. delete cache[keys.shift()];
  5230. }
  5231. return cache[key + " "] = value;
  5232. }
  5233. return cache;
  5234. }
  5235. function testContext(context) {
  5236. return context && typeof context.getElementsByTagName !== "undefined" && context;
  5237. }
  5238. var attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2)
  5239. "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  5240. `*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(` + identifier + "))|)" + whitespace + "*\\]";
  5241. var pseudos = ":(" + identifier + `)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|` + attributes + ")*)|.*)\\)|)";
  5242. var filterMatchExpr = {
  5243. ID: new RegExp("^#(" + identifier + ")"),
  5244. CLASS: new RegExp("^\\.(" + identifier + ")"),
  5245. TAG: new RegExp("^(" + identifier + "|[*])"),
  5246. ATTR: new RegExp("^" + attributes),
  5247. PSEUDO: new RegExp("^" + pseudos),
  5248. CHILD: new RegExp(
  5249. "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)",
  5250. "i"
  5251. )
  5252. };
  5253. var rpseudo = new RegExp(pseudos);
  5254. var runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), funescape = function(escape, nonHex) {
  5255. var high = "0x" + escape.slice(1) - 65536;
  5256. if (nonHex) {
  5257. return nonHex;
  5258. }
  5259. return high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
  5260. };
  5261. function unescapeSelector(sel) {
  5262. return sel.replace(runescape, funescape);
  5263. }
  5264. function selectorError(msg) {
  5265. jQuery.error("Syntax error, unrecognized expression: " + msg);
  5266. }
  5267. var rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*");
  5268. var tokenCache = createCache();
  5269. function tokenize(selector, parseOnly) {
  5270. var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "];
  5271. if (cached) {
  5272. return parseOnly ? 0 : cached.slice(0);
  5273. }
  5274. soFar = selector;
  5275. groups = [];
  5276. preFilters = jQuery.expr.preFilter;
  5277. while (soFar) {
  5278. if (!matched || (match = rcomma.exec(soFar))) {
  5279. if (match) {
  5280. soFar = soFar.slice(match[0].length) || soFar;
  5281. }
  5282. groups.push(tokens = []);
  5283. }
  5284. matched = false;
  5285. if (match = rleadingCombinator.exec(soFar)) {
  5286. matched = match.shift();
  5287. tokens.push({
  5288. value: matched,
  5289. // Cast descendant combinators to space
  5290. type: match[0].replace(rtrimCSS, " ")
  5291. });
  5292. soFar = soFar.slice(matched.length);
  5293. }
  5294. for (type in filterMatchExpr) {
  5295. if ((match = jQuery.expr.match[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
  5296. matched = match.shift();
  5297. tokens.push({
  5298. value: matched,
  5299. type,
  5300. matches: match
  5301. });
  5302. soFar = soFar.slice(matched.length);
  5303. }
  5304. }
  5305. if (!matched) {
  5306. break;
  5307. }
  5308. }
  5309. if (parseOnly) {
  5310. return soFar.length;
  5311. }
  5312. return soFar ? selectorError(selector) : (
  5313. // Cache the tokens
  5314. tokenCache(selector, groups).slice(0)
  5315. );
  5316. }
  5317. var preFilter = {
  5318. ATTR: function(match) {
  5319. match[1] = unescapeSelector(match[1]);
  5320. match[3] = unescapeSelector(match[3] || match[4] || match[5] || "");
  5321. if (match[2] === "~=") {
  5322. match[3] = " " + match[3] + " ";
  5323. }
  5324. return match.slice(0, 4);
  5325. },
  5326. CHILD: function(match) {
  5327. match[1] = match[1].toLowerCase();
  5328. if (match[1].slice(0, 3) === "nth") {
  5329. if (!match[3]) {
  5330. selectorError(match[0]);
  5331. }
  5332. match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
  5333. match[5] = +(match[7] + match[8] || match[3] === "odd");
  5334. } else if (match[3]) {
  5335. selectorError(match[0]);
  5336. }
  5337. return match;
  5338. },
  5339. PSEUDO: function(match) {
  5340. var excess, unquoted = !match[6] && match[2];
  5341. if (filterMatchExpr.CHILD.test(match[0])) {
  5342. return null;
  5343. }
  5344. if (match[3]) {
  5345. match[2] = match[4] || match[5] || "";
  5346. } else if (unquoted && rpseudo.test(unquoted) && // Get excess from tokenize (recursively)
  5347. (excess = tokenize(unquoted, true)) && // advance to the next closing parenthesis
  5348. (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
  5349. match[0] = match[0].slice(0, excess);
  5350. match[2] = unquoted.slice(0, excess);
  5351. }
  5352. return match.slice(0, 3);
  5353. }
  5354. };
  5355. function toSelector(tokens) {
  5356. var i2 = 0, len = tokens.length, selector = "";
  5357. for (; i2 < len; i2++) {
  5358. selector += tokens[i2].value;
  5359. }
  5360. return selector;
  5361. }
  5362. var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  5363. function fcssescape(ch, asCodePoint) {
  5364. if (asCodePoint) {
  5365. if (ch === "\0") {
  5366. return "\uFFFD";
  5367. }
  5368. return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
  5369. }
  5370. return "\\" + ch;
  5371. }
  5372. jQuery.escapeSelector = function(sel) {
  5373. return (sel + "").replace(rcssescape, fcssescape);
  5374. };
  5375. var sort = arr.sort;
  5376. var splice = arr.splice;
  5377. var hasDuplicate;
  5378. function sortOrder(a, b) {
  5379. if (a === b) {
  5380. hasDuplicate = true;
  5381. return 0;
  5382. }
  5383. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  5384. if (compare) {
  5385. return compare;
  5386. }
  5387. compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : (
  5388. // Otherwise we know they are disconnected
  5389. 1
  5390. );
  5391. if (compare & 1) {
  5392. if (a == document || a.ownerDocument == document && jQuery.contains(document, a)) {
  5393. return -1;
  5394. }
  5395. if (b == document || b.ownerDocument == document && jQuery.contains(document, b)) {
  5396. return 1;
  5397. }
  5398. return 0;
  5399. }
  5400. return compare & 4 ? -1 : 1;
  5401. }
  5402. jQuery.uniqueSort = function(results) {
  5403. var elem, duplicates = [], j = 0, i2 = 0;
  5404. hasDuplicate = false;
  5405. sort.call(results, sortOrder);
  5406. if (hasDuplicate) {
  5407. while (elem = results[i2++]) {
  5408. if (elem === results[i2]) {
  5409. j = duplicates.push(i2);
  5410. }
  5411. }
  5412. while (j--) {
  5413. splice.call(results, duplicates[j], 1);
  5414. }
  5415. }
  5416. return results;
  5417. };
  5418. jQuery.fn.uniqueSort = function() {
  5419. return this.pushStack(jQuery.uniqueSort(slice.apply(this)));
  5420. };
  5421. var i, outermostContext, document$1, documentElement$1, documentIsHTML, dirruns = 0, done = 0, classCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), rwhitespace = new RegExp(whitespace + "+", "g"), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = jQuery.extend({
  5422. bool: new RegExp("^(?:" + booleans + ")$", "i"),
  5423. // For use in libraries implementing .is()
  5424. // We use this for POS matching in `select`
  5425. needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
  5426. }, filterMatchExpr), rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, unloadHandler = function() {
  5427. setDocument();
  5428. }, inDisabledFieldset = addCombinator(
  5429. function(elem) {
  5430. return elem.disabled === true && nodeName(elem, "fieldset");
  5431. },
  5432. { dir: "parentNode", next: "legend" }
  5433. );
  5434. function find(selector, context, results, seed) {
  5435. var m, i2, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9;
  5436. results = results || [];
  5437. if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
  5438. return results;
  5439. }
  5440. if (false) {
  5441. setDocument(context);
  5442. context = context || document$1;
  5443. if (documentIsHTML) {
  5444. if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {
  5445. if (m = match[1]) {
  5446. if (nodeType === 9) {
  5447. if (elem = context.getElementById(m)) {
  5448. push.call(results, elem);
  5449. }
  5450. return results;
  5451. } else {
  5452. if (newContext && (elem = newContext.getElementById(m)) && jQuery.contains(context, elem)) {
  5453. push.call(results, elem);
  5454. return results;
  5455. }
  5456. }
  5457. } else if (match[2]) {
  5458. push.apply(results, context.getElementsByTagName(selector));
  5459. return results;
  5460. } else if ((m = match[3]) && context.getElementsByClassName) {
  5461. push.apply(results, context.getElementsByClassName(m));
  5462. return results;
  5463. }
  5464. }
  5465. if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
  5466. newSelector = selector;
  5467. newContext = context;
  5468. if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) {
  5469. newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
  5470. if (newContext != context || isIE) {
  5471. if (nid = context.getAttribute("id")) {
  5472. nid = jQuery.escapeSelector(nid);
  5473. } else {
  5474. context.setAttribute("id", nid = jQuery.expando);
  5475. }
  5476. }
  5477. groups = tokenize(selector);
  5478. i2 = groups.length;
  5479. while (i2--) {
  5480. groups[i2] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i2]);
  5481. }
  5482. newSelector = groups.join(",");
  5483. }
  5484. try {
  5485. push.apply(
  5486. results,
  5487. newContext.querySelectorAll(newSelector)
  5488. );
  5489. return results;
  5490. } catch (qsaError) {
  5491. nonnativeSelectorCache(selector, true);
  5492. } finally {
  5493. if (nid === jQuery.expando) {
  5494. context.removeAttribute("id");
  5495. }
  5496. }
  5497. }
  5498. }
  5499. }
  5500. return select(selector.replace(rtrimCSS, "$1"), context, results, seed);
  5501. }
  5502. function markFunction(fn) {
  5503. fn[jQuery.expando] = true;
  5504. return fn;
  5505. }
  5506. function createInputPseudo(type) {
  5507. return function(elem) {
  5508. return nodeName(elem, "input") && elem.type === type;
  5509. };
  5510. }
  5511. function createButtonPseudo(type) {
  5512. return function(elem) {
  5513. return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type;
  5514. };
  5515. }
  5516. function createDisabledPseudo(disabled) {
  5517. return function(elem) {
  5518. if ("form" in elem) {
  5519. if (elem.parentNode && elem.disabled === false) {
  5520. if ("label" in elem) {
  5521. if ("label" in elem.parentNode) {
  5522. return elem.parentNode.disabled === disabled;
  5523. } else {
  5524. return elem.disabled === disabled;
  5525. }
  5526. }
  5527. return elem.isDisabled === disabled || // Where there is no isDisabled, check manually
  5528. elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;
  5529. }
  5530. return elem.disabled === disabled;
  5531. } else if ("label" in elem) {
  5532. return elem.disabled === disabled;
  5533. }
  5534. return false;
  5535. };
  5536. }
  5537. function createPositionalPseudo(fn) {
  5538. return markFunction(function(argument) {
  5539. argument = +argument;
  5540. return markFunction(function(seed, matches3) {
  5541. var j, matchIndexes = fn([], seed.length, argument), i2 = matchIndexes.length;
  5542. while (i2--) {
  5543. if (seed[j = matchIndexes[i2]]) {
  5544. seed[j] = !(matches3[j] = seed[j]);
  5545. }
  5546. }
  5547. });
  5548. });
  5549. }
  5550. function setDocument(node) {
  5551. var subWindow, doc = node ? node.ownerDocument || node : document;
  5552. if (doc == document$1 || doc.nodeType !== 9) {
  5553. return;
  5554. }
  5555. document$1 = doc;
  5556. documentElement$1 = document$1.documentElement;
  5557. documentIsHTML = !jQuery.isXMLDoc(document$1);
  5558. if (isIE && document != document$1 && (subWindow = document$1.defaultView) && subWindow.top !== subWindow) {
  5559. subWindow.addEventListener("unload", unloadHandler);
  5560. }
  5561. }
  5562. find.matches = function(expr, elements) {
  5563. return find(expr, null, null, elements);
  5564. };
  5565. find.matchesSelector = function(elem, expr) {
  5566. setDocument(elem);
  5567. if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
  5568. try {
  5569. return matches2.call(elem, expr);
  5570. } catch (e2) {
  5571. nonnativeSelectorCache(expr, true);
  5572. }
  5573. }
  5574. return find(expr, document$1, null, [elem]).length > 0;
  5575. };
  5576. jQuery.expr = {
  5577. // Can be adjusted by the user
  5578. cacheLength: 50,
  5579. createPseudo: markFunction,
  5580. match: matchExpr,
  5581. find: {
  5582. ID: function(id, context) {
  5583. if (typeof context.getElementById !== "undefined" && documentIsHTML) {
  5584. var elem = context.getElementById(id);
  5585. return elem ? [elem] : [];
  5586. }
  5587. },
  5588. TAG: function(tag, context) {
  5589. if (typeof context.getElementsByTagName !== "undefined") {
  5590. return context.getElementsByTagName(tag);
  5591. } else {
  5592. return context.querySelectorAll(tag);
  5593. }
  5594. },
  5595. CLASS: function(className, context) {
  5596. if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) {
  5597. return context.getElementsByClassName(className);
  5598. }
  5599. }
  5600. },
  5601. relative: {
  5602. ">": { dir: "parentNode", first: true },
  5603. " ": { dir: "parentNode" },
  5604. "+": { dir: "previousSibling", first: true },
  5605. "~": { dir: "previousSibling" }
  5606. },
  5607. preFilter,
  5608. filter: {
  5609. ID: function(id) {
  5610. var attrId = unescapeSelector(id);
  5611. return function(elem) {
  5612. return elem.getAttribute("id") === attrId;
  5613. };
  5614. },
  5615. TAG: function(nodeNameSelector) {
  5616. var expectedNodeName = unescapeSelector(nodeNameSelector).toLowerCase();
  5617. return nodeNameSelector === "*" ? function() {
  5618. return true;
  5619. } : function(elem) {
  5620. return nodeName(elem, expectedNodeName);
  5621. };
  5622. },
  5623. CLASS: function(className) {
  5624. var pattern = classCache[className + " "];
  5625. return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) {
  5626. return pattern.test(
  5627. typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""
  5628. );
  5629. });
  5630. },
  5631. ATTR: function(name, operator, check) {
  5632. return function(elem) {
  5633. var result = elem.getAttribute(name);
  5634. if (result == null) {
  5635. return operator === "!=";
  5636. }
  5637. if (!operator) {
  5638. return true;
  5639. }
  5640. result += "";
  5641. if (operator === "=") {
  5642. return result === check;
  5643. }
  5644. if (operator === "!=") {
  5645. return result !== check;
  5646. }
  5647. if (operator === "^=") {
  5648. return check && result.indexOf(check) === 0;
  5649. }
  5650. if (operator === "*=") {
  5651. return check && result.indexOf(check) > -1;
  5652. }
  5653. if (operator === "$=") {
  5654. return check && result.slice(-check.length) === check;
  5655. }
  5656. if (operator === "~=") {
  5657. return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1;
  5658. }
  5659. if (operator === "|=") {
  5660. return result === check || result.slice(0, check.length + 1) === check + "-";
  5661. }
  5662. return false;
  5663. };
  5664. },
  5665. CHILD: function(type, what, _argument, first, last) {
  5666. var simple = type.slice(0, 3) !== "nth", forward = type.slice(-4) !== "last", ofType = what === "of-type";
  5667. return first === 1 && last === 0 ? (
  5668. // Shortcut for :nth-*(n)
  5669. function(elem) {
  5670. return !!elem.parentNode;
  5671. }
  5672. ) : function(elem, _context, xml) {
  5673. var cache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
  5674. if (parent) {
  5675. if (simple) {
  5676. while (dir) {
  5677. node = elem;
  5678. while (node = node[dir]) {
  5679. if (ofType ? nodeName(node, name) : node.nodeType === 1) {
  5680. return false;
  5681. }
  5682. }
  5683. start = dir = type === "only" && !start && "nextSibling";
  5684. }
  5685. return true;
  5686. }
  5687. start = [forward ? parent.firstChild : parent.lastChild];
  5688. if (forward && useCache) {
  5689. outerCache = parent[jQuery.expando] || (parent[jQuery.expando] = {});
  5690. cache = outerCache[type] || [];
  5691. nodeIndex = cache[0] === dirruns && cache[1];
  5692. diff = nodeIndex && cache[2];
  5693. node = nodeIndex && parent.childNodes[nodeIndex];
  5694. while (node = ++nodeIndex && node && node[dir] || // Fallback to seeking `elem` from the start
  5695. (diff = nodeIndex = 0) || start.pop()) {
  5696. if (node.nodeType === 1 && ++diff && node === elem) {
  5697. outerCache[type] = [dirruns, nodeIndex, diff];
  5698. break;
  5699. }
  5700. }
  5701. } else {
  5702. if (useCache) {
  5703. outerCache = elem[jQuery.expando] || (elem[jQuery.expando] = {});
  5704. cache = outerCache[type] || [];
  5705. nodeIndex = cache[0] === dirruns && cache[1];
  5706. diff = nodeIndex;
  5707. }
  5708. if (diff === false) {
  5709. while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
  5710. if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) {
  5711. if (useCache) {
  5712. outerCache = node[jQuery.expando] || (node[jQuery.expando] = {});
  5713. outerCache[type] = [dirruns, diff];
  5714. }
  5715. if (node === elem) {
  5716. break;
  5717. }
  5718. }
  5719. }
  5720. }
  5721. }
  5722. diff -= last;
  5723. return diff === first || diff % first === 0 && diff / first >= 0;
  5724. }
  5725. };
  5726. },
  5727. PSEUDO: function(pseudo, argument) {
  5728. var fn = jQuery.expr.pseudos[pseudo] || jQuery.expr.setFilters[pseudo.toLowerCase()] || selectorError("unsupported pseudo: " + pseudo);
  5729. if (fn[jQuery.expando]) {
  5730. return fn(argument);
  5731. }
  5732. return fn;
  5733. }
  5734. },
  5735. pseudos: {
  5736. // Potentially complex pseudos
  5737. not: markFunction(function(selector) {
  5738. var input = [], results = [], matcher = compile(selector.replace(rtrimCSS, "$1"));
  5739. return matcher[jQuery.expando] ? markFunction(function(seed, matches3, _context, xml) {
  5740. var elem, unmatched = matcher(seed, null, xml, []), i2 = seed.length;
  5741. while (i2--) {
  5742. if (elem = unmatched[i2]) {
  5743. seed[i2] = !(matches3[i2] = elem);
  5744. }
  5745. }
  5746. }) : function(elem, _context, xml) {
  5747. input[0] = elem;
  5748. matcher(input, null, xml, results);
  5749. input[0] = null;
  5750. return !results.pop();
  5751. };
  5752. }),
  5753. has: markFunction(function(selector) {
  5754. return function(elem) {
  5755. return find(selector, elem).length > 0;
  5756. };
  5757. }),
  5758. contains: markFunction(function(text) {
  5759. text = unescapeSelector(text);
  5760. return function(elem) {
  5761. return (elem.textContent || jQuery.text(elem)).indexOf(text) > -1;
  5762. };
  5763. }),
  5764. // "Whether an element is represented by a :lang() selector
  5765. // is based solely on the element's language value
  5766. // being equal to the identifier C,
  5767. // or beginning with the identifier C immediately followed by "-".
  5768. // The matching of C against the element's language value is performed case-insensitively.
  5769. // The identifier C does not have to be a valid language name."
  5770. // https://www.w3.org/TR/selectors/#lang-pseudo
  5771. lang: markFunction(function(lang) {
  5772. if (!ridentifier.test(lang || "")) {
  5773. selectorError("unsupported lang: " + lang);
  5774. }
  5775. lang = unescapeSelector(lang).toLowerCase();
  5776. return function(elem) {
  5777. var elemLang;
  5778. do {
  5779. if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
  5780. elemLang = elemLang.toLowerCase();
  5781. return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
  5782. }
  5783. } while ((elem = elem.parentNode) && elem.nodeType === 1);
  5784. return false;
  5785. };
  5786. }),
  5787. // Miscellaneous
  5788. target: function(elem) {
  5789. var hash = window2.location && window2.location.hash;
  5790. return hash && hash.slice(1) === elem.id;
  5791. },
  5792. root: function(elem) {
  5793. return elem === documentElement$1;
  5794. },
  5795. focus: function(elem) {
  5796. return elem === document$1.activeElement && document$1.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex);
  5797. },
  5798. // Boolean properties
  5799. enabled: createDisabledPseudo(false),
  5800. disabled: createDisabledPseudo(true),
  5801. checked: function(elem) {
  5802. return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected;
  5803. },
  5804. selected: function(elem) {
  5805. if (isIE && elem.parentNode) {
  5806. elem.parentNode.selectedIndex;
  5807. }
  5808. return elem.selected === true;
  5809. },
  5810. // Contents
  5811. empty: function(elem) {
  5812. for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
  5813. if (elem.nodeType < 6) {
  5814. return false;
  5815. }
  5816. }
  5817. return true;
  5818. },
  5819. parent: function(elem) {
  5820. return !jQuery.expr.pseudos.empty(elem);
  5821. },
  5822. // Element/input types
  5823. header: function(elem) {
  5824. return rheader.test(elem.nodeName);
  5825. },
  5826. input: function(elem) {
  5827. return rinputs.test(elem.nodeName);
  5828. },
  5829. button: function(elem) {
  5830. return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button");
  5831. },
  5832. text: function(elem) {
  5833. return nodeName(elem, "input") && elem.type === "text";
  5834. },
  5835. // Position-in-collection
  5836. first: createPositionalPseudo(function() {
  5837. return [0];
  5838. }),
  5839. last: createPositionalPseudo(function(_matchIndexes, length) {
  5840. return [length - 1];
  5841. }),
  5842. eq: createPositionalPseudo(function(_matchIndexes, length, argument) {
  5843. return [argument < 0 ? argument + length : argument];
  5844. }),
  5845. even: createPositionalPseudo(function(matchIndexes, length) {
  5846. var i2 = 0;
  5847. for (; i2 < length; i2 += 2) {
  5848. matchIndexes.push(i2);
  5849. }
  5850. return matchIndexes;
  5851. }),
  5852. odd: createPositionalPseudo(function(matchIndexes, length) {
  5853. var i2 = 1;
  5854. for (; i2 < length; i2 += 2) {
  5855. matchIndexes.push(i2);
  5856. }
  5857. return matchIndexes;
  5858. }),
  5859. lt: createPositionalPseudo(function(matchIndexes, length, argument) {
  5860. var i2;
  5861. if (argument < 0) {
  5862. i2 = argument + length;
  5863. } else if (argument > length) {
  5864. i2 = length;
  5865. } else {
  5866. i2 = argument;
  5867. }
  5868. for (; --i2 >= 0; ) {
  5869. matchIndexes.push(i2);
  5870. }
  5871. return matchIndexes;
  5872. }),
  5873. gt: createPositionalPseudo(function(matchIndexes, length, argument) {
  5874. var i2 = argument < 0 ? argument + length : argument;
  5875. for (; ++i2 < length; ) {
  5876. matchIndexes.push(i2);
  5877. }
  5878. return matchIndexes;
  5879. })
  5880. }
  5881. };
  5882. jQuery.expr.pseudos.nth = jQuery.expr.pseudos.eq;
  5883. for (i in { radio: true, checkbox: true, file: true, password: true, image: true }) {
  5884. jQuery.expr.pseudos[i] = createInputPseudo(i);
  5885. }
  5886. for (i in { submit: true, reset: true }) {
  5887. jQuery.expr.pseudos[i] = createButtonPseudo(i);
  5888. }
  5889. function setFilters() {
  5890. }
  5891. setFilters.prototype = jQuery.expr.filters = jQuery.expr.pseudos;
  5892. jQuery.expr.setFilters = new setFilters();
  5893. function addCombinator(matcher, combinator, base) {
  5894. var dir = combinator.dir, skip = combinator.next, key = skip || dir, checkNonElements = base && key === "parentNode", doneName = done++;
  5895. return combinator.first ? (
  5896. // Check against closest ancestor/preceding element
  5897. function(elem, context, xml) {
  5898. while (elem = elem[dir]) {
  5899. if (elem.nodeType === 1 || checkNonElements) {
  5900. return matcher(elem, context, xml);
  5901. }
  5902. }
  5903. return false;
  5904. }
  5905. ) : (
  5906. // Check against all ancestor/preceding elements
  5907. function(elem, context, xml) {
  5908. var oldCache, outerCache, newCache = [dirruns, doneName];
  5909. if (xml) {
  5910. while (elem = elem[dir]) {
  5911. if (elem.nodeType === 1 || checkNonElements) {
  5912. if (matcher(elem, context, xml)) {
  5913. return true;
  5914. }
  5915. }
  5916. }
  5917. } else {
  5918. while (elem = elem[dir]) {
  5919. if (elem.nodeType === 1 || checkNonElements) {
  5920. outerCache = elem[jQuery.expando] || (elem[jQuery.expando] = {});
  5921. if (skip && nodeName(elem, skip)) {
  5922. elem = elem[dir] || elem;
  5923. } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
  5924. return newCache[2] = oldCache[2];
  5925. } else {
  5926. outerCache[key] = newCache;
  5927. if (newCache[2] = matcher(elem, context, xml)) {
  5928. return true;
  5929. }
  5930. }
  5931. }
  5932. }
  5933. }
  5934. return false;
  5935. }
  5936. );
  5937. }
  5938. function elementMatcher(matchers) {
  5939. return matchers.length > 1 ? function(elem, context, xml) {
  5940. var i2 = matchers.length;
  5941. while (i2--) {
  5942. if (!matchers[i2](elem, context, xml)) {
  5943. return false;
  5944. }
  5945. }
  5946. return true;
  5947. } : matchers[0];
  5948. }
  5949. function multipleContexts(selector, contexts, results) {
  5950. var i2 = 0, len = contexts.length;
  5951. for (; i2 < len; i2++) {
  5952. find(selector, contexts[i2], results);
  5953. }
  5954. return results;
  5955. }
  5956. function condense(unmatched, map, filter, context, xml) {
  5957. var elem, newUnmatched = [], i2 = 0, len = unmatched.length, mapped = map != null;
  5958. for (; i2 < len; i2++) {
  5959. if (elem = unmatched[i2]) {
  5960. if (!filter || filter(elem, context, xml)) {
  5961. newUnmatched.push(elem);
  5962. if (mapped) {
  5963. map.push(i2);
  5964. }
  5965. }
  5966. }
  5967. }
  5968. return newUnmatched;
  5969. }
  5970. function setMatcher(preFilter2, selector, matcher, postFilter, postFinder, postSelector) {
  5971. if (postFilter && !postFilter[jQuery.expando]) {
  5972. postFilter = setMatcher(postFilter);
  5973. }
  5974. if (postFinder && !postFinder[jQuery.expando]) {
  5975. postFinder = setMatcher(postFinder, postSelector);
  5976. }
  5977. return markFunction(function(seed, results, context, xml) {
  5978. var temp, i2, elem, matcherOut, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(
  5979. selector || "*",
  5980. context.nodeType ? [context] : context,
  5981. []
  5982. ), matcherIn = preFilter2 && (seed || !selector) ? condense(elems, preMap, preFilter2, context, xml) : elems;
  5983. if (matcher) {
  5984. matcherOut = postFinder || (seed ? preFilter2 : preexisting || postFilter) ? (
  5985. // ...intermediate processing is necessary
  5986. []
  5987. ) : (
  5988. // ...otherwise use results directly
  5989. results
  5990. );
  5991. matcher(matcherIn, matcherOut, context, xml);
  5992. } else {
  5993. matcherOut = matcherIn;
  5994. }
  5995. if (postFilter) {
  5996. temp = condense(matcherOut, postMap);
  5997. postFilter(temp, [], context, xml);
  5998. i2 = temp.length;
  5999. while (i2--) {
  6000. if (elem = temp[i2]) {
  6001. matcherOut[postMap[i2]] = !(matcherIn[postMap[i2]] = elem);
  6002. }
  6003. }
  6004. }
  6005. if (seed) {
  6006. if (postFinder || preFilter2) {
  6007. if (postFinder) {
  6008. temp = [];
  6009. i2 = matcherOut.length;
  6010. while (i2--) {
  6011. if (elem = matcherOut[i2]) {
  6012. temp.push(matcherIn[i2] = elem);
  6013. }
  6014. }
  6015. postFinder(null, matcherOut = [], temp, xml);
  6016. }
  6017. i2 = matcherOut.length;
  6018. while (i2--) {
  6019. if ((elem = matcherOut[i2]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i2]) > -1) {
  6020. seed[temp] = !(results[temp] = elem);
  6021. }
  6022. }
  6023. }
  6024. } else {
  6025. matcherOut = condense(
  6026. matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut
  6027. );
  6028. if (postFinder) {
  6029. postFinder(null, results, matcherOut, xml);
  6030. } else {
  6031. push.apply(results, matcherOut);
  6032. }
  6033. }
  6034. });
  6035. }
  6036. function matcherFromTokens(tokens) {
  6037. var checkContext, matcher, j, len = tokens.length, leadingRelative = jQuery.expr.relative[tokens[0].type], implicitRelative = leadingRelative || jQuery.expr.relative[" "], i2 = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) {
  6038. return elem === checkContext;
  6039. }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) {
  6040. return indexOf.call(checkContext, elem) > -1;
  6041. }, implicitRelative, true), matchers = [function(elem, context, xml) {
  6042. var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
  6043. checkContext = null;
  6044. return ret;
  6045. }];
  6046. for (; i2 < len; i2++) {
  6047. if (matcher = jQuery.expr.relative[tokens[i2].type]) {
  6048. matchers = [addCombinator(elementMatcher(matchers), matcher)];
  6049. } else {
  6050. matcher = jQuery.expr.filter[tokens[i2].type].apply(null, tokens[i2].matches);
  6051. if (matcher[jQuery.expando]) {
  6052. j = ++i2;
  6053. for (; j < len; j++) {
  6054. if (jQuery.expr.relative[tokens[j].type]) {
  6055. break;
  6056. }
  6057. }
  6058. return setMatcher(
  6059. i2 > 1 && elementMatcher(matchers),
  6060. i2 > 1 && toSelector(
  6061. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  6062. tokens.slice(0, i2 - 1).concat({ value: tokens[i2 - 2].type === " " ? "*" : "" })
  6063. ).replace(rtrimCSS, "$1"),
  6064. matcher,
  6065. i2 < j && matcherFromTokens(tokens.slice(i2, j)),
  6066. j < len && matcherFromTokens(tokens = tokens.slice(j)),
  6067. j < len && toSelector(tokens)
  6068. );
  6069. }
  6070. matchers.push(matcher);
  6071. }
  6072. }
  6073. return elementMatcher(matchers);
  6074. }
  6075. function matcherFromGroupMatchers(elementMatchers, setMatchers) {
  6076. var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context, xml, results, outermost) {
  6077. var elem, j, matcher, matchedCount = 0, i2 = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && jQuery.expr.find.TAG("*", outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1;
  6078. if (outermost) {
  6079. outermostContext = context == document$1 || context || outermost;
  6080. }
  6081. for (; (elem = elems[i2]) != null; i2++) {
  6082. if (byElement && elem) {
  6083. j = 0;
  6084. if (!context && elem.ownerDocument != document$1) {
  6085. setDocument(elem);
  6086. xml = !documentIsHTML;
  6087. }
  6088. while (matcher = elementMatchers[j++]) {
  6089. if (matcher(elem, context || document$1, xml)) {
  6090. push.call(results, elem);
  6091. break;
  6092. }
  6093. }
  6094. if (outermost) {
  6095. dirruns = dirrunsUnique;
  6096. }
  6097. }
  6098. if (bySet) {
  6099. if (elem = !matcher && elem) {
  6100. matchedCount--;
  6101. }
  6102. if (seed) {
  6103. unmatched.push(elem);
  6104. }
  6105. }
  6106. }
  6107. matchedCount += i2;
  6108. if (bySet && i2 !== matchedCount) {
  6109. j = 0;
  6110. while (matcher = setMatchers[j++]) {
  6111. matcher(unmatched, setMatched, context, xml);
  6112. }
  6113. if (seed) {
  6114. if (matchedCount > 0) {
  6115. while (i2--) {
  6116. if (!(unmatched[i2] || setMatched[i2])) {
  6117. setMatched[i2] = pop.call(results);
  6118. }
  6119. }
  6120. }
  6121. setMatched = condense(setMatched);
  6122. }
  6123. push.apply(results, setMatched);
  6124. if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
  6125. jQuery.uniqueSort(results);
  6126. }
  6127. }
  6128. if (outermost) {
  6129. dirruns = dirrunsUnique;
  6130. outermostContext = contextBackup;
  6131. }
  6132. return unmatched;
  6133. };
  6134. return bySet ? markFunction(superMatcher) : superMatcher;
  6135. }
  6136. function compile(selector, match) {
  6137. var i2, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
  6138. if (!cached) {
  6139. if (!match) {
  6140. match = tokenize(selector);
  6141. }
  6142. i2 = match.length;
  6143. while (i2--) {
  6144. cached = matcherFromTokens(match[i2]);
  6145. if (cached[jQuery.expando]) {
  6146. setMatchers.push(cached);
  6147. } else {
  6148. elementMatchers.push(cached);
  6149. }
  6150. }
  6151. cached = compilerCache(
  6152. selector,
  6153. matcherFromGroupMatchers(elementMatchers, setMatchers)
  6154. );
  6155. cached.selector = selector;
  6156. }
  6157. return cached;
  6158. }
  6159. function select(selector, context, results, seed) {
  6160. var i2, tokens, token, type, find2, compiled = typeof selector === "function" && selector, match = !seed && tokenize(selector = compiled.selector || selector);
  6161. results = results || [];
  6162. if (match.length === 1) {
  6163. tokens = match[0] = match[0].slice(0);
  6164. if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && jQuery.expr.relative[tokens[1].type]) {
  6165. context = (jQuery.expr.find.ID(
  6166. unescapeSelector(token.matches[0]),
  6167. context
  6168. ) || [])[0];
  6169. if (!context) {
  6170. return results;
  6171. } else if (compiled) {
  6172. context = context.parentNode;
  6173. }
  6174. selector = selector.slice(tokens.shift().value.length);
  6175. }
  6176. i2 = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
  6177. while (i2--) {
  6178. token = tokens[i2];
  6179. if (jQuery.expr.relative[type = token.type]) {
  6180. break;
  6181. }
  6182. if (find2 = jQuery.expr.find[type]) {
  6183. if (seed = find2(
  6184. unescapeSelector(token.matches[0]),
  6185. rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
  6186. )) {
  6187. tokens.splice(i2, 1);
  6188. selector = seed.length && toSelector(tokens);
  6189. if (!selector) {
  6190. push.apply(results, seed);
  6191. return results;
  6192. }
  6193. break;
  6194. }
  6195. }
  6196. }
  6197. }
  6198. (compiled || compile(selector, match))(
  6199. seed,
  6200. context,
  6201. !documentIsHTML,
  6202. results,
  6203. !context || rsibling.test(selector) && testContext(context.parentNode) || context
  6204. );
  6205. return results;
  6206. }
  6207. setDocument();
  6208. jQuery.find = find;
  6209. find.compile = compile;
  6210. find.select = select;
  6211. find.setDocument = setDocument;
  6212. find.tokenize = tokenize;
  6213. return jQuery;
  6214. })
  6215. );
  6216. // src/mock-doc/selector.ts
  6217. function matches(selector, elm) {
  6218. try {
  6219. const r = jquery_default.find(selector, void 0, void 0, [elm]);
  6220. return r.length > 0;
  6221. } catch (e2) {
  6222. updateSelectorError(selector, e2);
  6223. throw e2;
  6224. }
  6225. }
  6226. function selectOne(selector, elm) {
  6227. try {
  6228. const r = jquery_default.find(selector, elm, void 0, void 0);
  6229. return r[0] || null;
  6230. } catch (e2) {
  6231. updateSelectorError(selector, e2);
  6232. throw e2;
  6233. }
  6234. }
  6235. function selectAll(selector, elm) {
  6236. try {
  6237. return jquery_default.find(selector, elm, void 0, void 0);
  6238. } catch (e2) {
  6239. updateSelectorError(selector, e2);
  6240. throw e2;
  6241. }
  6242. }
  6243. var PROBLEMATIC_SELECTORS = [":scope", ":where", ":is"];
  6244. function updateSelectorError(selector, e2) {
  6245. const selectorsPresent = PROBLEMATIC_SELECTORS.filter((s) => selector.includes(s));
  6246. if (selectorsPresent.length > 0 && e2.message) {
  6247. e2.message = `At present jQuery does not support the ${humanReadableList(selectorsPresent)} ${selectorsPresent.length === 1 ? "selector" : "selectors"}.
  6248. If you need this in your test, consider writing an end-to-end test instead.
  6249. ` + e2.message;
  6250. }
  6251. }
  6252. function humanReadableList(items) {
  6253. if (items.length <= 1) {
  6254. return items.join("");
  6255. }
  6256. return `${items.slice(0, items.length - 1).join(", ")} and ${items[items.length - 1]}`;
  6257. }
  6258. // src/mock-doc/serialize-node.ts
  6259. function normalizeSerializationOptions(opts = {}) {
  6260. return {
  6261. ...opts,
  6262. outerHtml: typeof opts.outerHtml !== "boolean" ? false : opts.outerHtml,
  6263. ...opts.prettyHtml ? {
  6264. indentSpaces: typeof opts.indentSpaces !== "number" ? 2 : opts.indentSpaces,
  6265. newLines: typeof opts.newLines !== "boolean" ? true : opts.newLines
  6266. } : {
  6267. prettyHtml: false,
  6268. indentSpaces: typeof opts.indentSpaces !== "number" ? 0 : opts.indentSpaces,
  6269. newLines: typeof opts.newLines !== "boolean" ? false : opts.newLines
  6270. },
  6271. approximateLineWidth: typeof opts.approximateLineWidth !== "number" ? -1 : opts.approximateLineWidth,
  6272. removeEmptyAttributes: typeof opts.removeEmptyAttributes !== "boolean" ? true : opts.removeEmptyAttributes,
  6273. removeAttributeQuotes: typeof opts.removeAttributeQuotes !== "boolean" ? false : opts.removeAttributeQuotes,
  6274. removeBooleanAttributeQuotes: typeof opts.removeBooleanAttributeQuotes !== "boolean" ? false : opts.removeBooleanAttributeQuotes,
  6275. removeHtmlComments: typeof opts.removeHtmlComments !== "boolean" ? false : opts.removeHtmlComments,
  6276. serializeShadowRoot: typeof opts.serializeShadowRoot !== "boolean" ? true : opts.serializeShadowRoot,
  6277. fullDocument: typeof opts.fullDocument !== "boolean" ? true : opts.fullDocument
  6278. };
  6279. }
  6280. function serializeNodeToHtml(elm, serializationOptions = {}) {
  6281. const opts = normalizeSerializationOptions(serializationOptions);
  6282. const output = {
  6283. currentLineWidth: 0,
  6284. indent: 0,
  6285. isWithinBody: false,
  6286. text: []
  6287. };
  6288. let renderedNode = "";
  6289. const children = !opts.fullDocument && elm.body ? Array.from(elm.body.childNodes) : opts.outerHtml ? [elm] : Array.from(elm.childNodes);
  6290. for (let i = 0, ii = children.length; i < ii; i++) {
  6291. const child = children[i];
  6292. const chunks = Array.from(streamToHtml(child, opts, output));
  6293. renderedNode += chunks.join("");
  6294. }
  6295. return renderedNode.trim();
  6296. }
  6297. var shadowRootTag = "mock:shadow-root";
  6298. function* streamToHtml(node, opts, output) {
  6299. var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
  6300. const isShadowRoot = node.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */;
  6301. if (node.nodeType === 1 /* ELEMENT_NODE */ || isShadowRoot) {
  6302. const tagName = isShadowRoot ? shadowRootTag : getTagName(node);
  6303. if (tagName === "body") {
  6304. output.isWithinBody = true;
  6305. }
  6306. const ignoreTag = opts.excludeTags != null && opts.excludeTags.includes(tagName);
  6307. if (ignoreTag === false) {
  6308. const isWithinWhitespaceSensitiveNode = opts.newLines || ((_a = opts.indentSpaces) != null ? _a : 0) > 0 ? isWithinWhitespaceSensitive(node) : false;
  6309. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  6310. yield "\n";
  6311. output.currentLineWidth = 0;
  6312. }
  6313. if (((_b = opts.indentSpaces) != null ? _b : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
  6314. for (let i = 0; i < output.indent; i++) {
  6315. yield " ";
  6316. }
  6317. output.currentLineWidth += output.indent;
  6318. }
  6319. const tag = tagName === shadowRootTag ? "template" : tagName;
  6320. yield "<" + tag;
  6321. output.currentLineWidth += tag.length + 1;
  6322. if (tag === "template") {
  6323. const mode = ` shadowrootmode="open"`;
  6324. yield mode;
  6325. output.currentLineWidth += mode.length;
  6326. }
  6327. const attrsLength = node.attributes.length;
  6328. const attributes = opts.prettyHtml && attrsLength > 1 ? cloneAttributes(node.attributes, true) : node.attributes;
  6329. for (let i = 0; i < attrsLength; i++) {
  6330. const attr = attributes.item(i);
  6331. const attrName = attr.name;
  6332. if (attrName === "style") {
  6333. continue;
  6334. }
  6335. let attrValue = attr.value;
  6336. if (opts.removeEmptyAttributes && attrValue === "" && REMOVE_EMPTY_ATTR.has(attrName)) {
  6337. continue;
  6338. }
  6339. const attrNamespaceURI = attr.namespaceURI;
  6340. if (attrNamespaceURI == null) {
  6341. output.currentLineWidth += attrName.length + 1;
  6342. if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
  6343. yield "\n" + attrName;
  6344. output.currentLineWidth = 0;
  6345. } else {
  6346. yield " " + attrName;
  6347. }
  6348. } else if (attrNamespaceURI === "http://www.w3.org/XML/1998/namespace") {
  6349. yield " xml:" + attrName;
  6350. output.currentLineWidth += attrName.length + 5;
  6351. } else if (attrNamespaceURI === "http://www.w3.org/2000/xmlns/") {
  6352. if (attrName !== "xmlns") {
  6353. yield " xmlns:" + attrName;
  6354. output.currentLineWidth += attrName.length + 7;
  6355. } else {
  6356. yield " " + attrName;
  6357. output.currentLineWidth += attrName.length + 1;
  6358. }
  6359. } else if (attrNamespaceURI === XLINK_NS) {
  6360. yield " xlink:" + attrName;
  6361. output.currentLineWidth += attrName.length + 7;
  6362. } else {
  6363. yield " " + attrNamespaceURI + ":" + attrName;
  6364. output.currentLineWidth += attrNamespaceURI.length + attrName.length + 2;
  6365. }
  6366. if (opts.prettyHtml && attrName === "class") {
  6367. attrValue = attr.value = attrValue.split(" ").filter((t) => t !== "").sort().join(" ").trim();
  6368. }
  6369. if (attrValue === "") {
  6370. if (opts.removeBooleanAttributeQuotes && BOOLEAN_ATTR.has(attrName)) {
  6371. continue;
  6372. }
  6373. if (opts.removeEmptyAttributes && attrName.startsWith("data-")) {
  6374. continue;
  6375. }
  6376. }
  6377. if (opts.removeAttributeQuotes && CAN_REMOVE_ATTR_QUOTES.test(attrValue)) {
  6378. yield "=" + escapeString(attrValue, true);
  6379. output.currentLineWidth += attrValue.length + 1;
  6380. } else {
  6381. yield '="' + escapeString(attrValue, true) + '"';
  6382. output.currentLineWidth += attrValue.length + 3;
  6383. }
  6384. }
  6385. if (node.hasAttribute("style")) {
  6386. const cssText = node.style.cssText;
  6387. if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth + cssText.length + 10 > opts.approximateLineWidth) {
  6388. yield `
  6389. style="${cssText}">`;
  6390. output.currentLineWidth = 0;
  6391. } else {
  6392. yield ` style="${cssText}">`;
  6393. output.currentLineWidth += cssText.length + 10;
  6394. }
  6395. } else {
  6396. yield ">";
  6397. output.currentLineWidth += 1;
  6398. }
  6399. }
  6400. if (EMPTY_ELEMENTS.has(tagName) === false) {
  6401. const shadowRoot = node.shadowRoot;
  6402. if (shadowRoot != null && opts.serializeShadowRoot) {
  6403. output.indent = output.indent + ((_c = opts.indentSpaces) != null ? _c : 0);
  6404. yield* streamToHtml(shadowRoot, opts, output);
  6405. output.indent = output.indent - ((_d = opts.indentSpaces) != null ? _d : 0);
  6406. if (opts.newLines && (node.childNodes.length === 0 || node.childNodes.length === 1 && node.childNodes[0].nodeType === 3 /* TEXT_NODE */ && ((_e = node.childNodes[0].nodeValue) == null ? void 0 : _e.trim()) === "")) {
  6407. yield "\n";
  6408. output.currentLineWidth = 0;
  6409. for (let i = 0; i < output.indent; i++) {
  6410. yield " ";
  6411. }
  6412. output.currentLineWidth += output.indent;
  6413. }
  6414. }
  6415. if (opts.excludeTagContent == null || opts.excludeTagContent.includes(tagName) === false) {
  6416. const tag = tagName === shadowRootTag ? "template" : tagName;
  6417. const childNodes = tagName === "template" ? node.content.childNodes : node.childNodes;
  6418. const childNodeLength = childNodes.length;
  6419. if (childNodeLength > 0) {
  6420. if (childNodeLength === 1 && childNodes[0].nodeType === 3 /* TEXT_NODE */ && (typeof childNodes[0].nodeValue !== "string" || childNodes[0].nodeValue.trim() === "")) {
  6421. } else {
  6422. const isWithinWhitespaceSensitiveNode = opts.newLines || ((_f = opts.indentSpaces) != null ? _f : 0) > 0 ? isWithinWhitespaceSensitive(node) : false;
  6423. if (!isWithinWhitespaceSensitiveNode && ((_g = opts.indentSpaces) != null ? _g : 0) > 0 && ignoreTag === false) {
  6424. output.indent = output.indent + ((_h = opts.indentSpaces) != null ? _h : 0);
  6425. }
  6426. for (let i = 0; i < childNodeLength; i++) {
  6427. yield* streamToHtml(childNodes[i], opts, output);
  6428. }
  6429. if (ignoreTag === false) {
  6430. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  6431. yield "\n";
  6432. output.currentLineWidth = 0;
  6433. }
  6434. if (((_i = opts.indentSpaces) != null ? _i : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
  6435. output.indent = output.indent - ((_j = opts.indentSpaces) != null ? _j : 0);
  6436. for (let i = 0; i < output.indent; i++) {
  6437. yield " ";
  6438. }
  6439. output.currentLineWidth += output.indent;
  6440. }
  6441. }
  6442. }
  6443. }
  6444. if (ignoreTag === false) {
  6445. yield "</" + tag + ">";
  6446. output.currentLineWidth += tag.length + 3;
  6447. }
  6448. }
  6449. }
  6450. if (((_k = opts.approximateLineWidth) != null ? _k : 0) > 0 && STRUCTURE_ELEMENTS.has(tagName)) {
  6451. yield "\n";
  6452. output.currentLineWidth = 0;
  6453. }
  6454. if (tagName === "body") {
  6455. output.isWithinBody = false;
  6456. }
  6457. } else if (node.nodeType === 3 /* TEXT_NODE */) {
  6458. let textContent = node.nodeValue;
  6459. if (typeof textContent === "string") {
  6460. const trimmedTextContent = textContent.trim();
  6461. if (trimmedTextContent === "") {
  6462. if (isWithinWhitespaceSensitive(node)) {
  6463. yield textContent;
  6464. output.currentLineWidth += textContent.length;
  6465. } else if (((_l = opts.approximateLineWidth) != null ? _l : 0) > 0 && !output.isWithinBody) {
  6466. } else if (!opts.prettyHtml) {
  6467. output.currentLineWidth += 1;
  6468. if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
  6469. yield "\n";
  6470. output.currentLineWidth = 0;
  6471. } else {
  6472. yield " ";
  6473. }
  6474. }
  6475. } else {
  6476. const isWithinWhitespaceSensitiveNode = opts.newLines || ((_m = opts.indentSpaces) != null ? _m : 0) > 0 || opts.prettyHtml ? isWithinWhitespaceSensitive(node) : false;
  6477. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  6478. yield "\n";
  6479. output.currentLineWidth = 0;
  6480. }
  6481. if (((_n = opts.indentSpaces) != null ? _n : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
  6482. for (let i = 0; i < output.indent; i++) {
  6483. yield " ";
  6484. }
  6485. output.currentLineWidth += output.indent;
  6486. }
  6487. let textContentLength = textContent.length;
  6488. if (textContentLength > 0) {
  6489. const parentTagName = node.parentNode != null && node.parentNode.nodeType === 1 /* ELEMENT_NODE */ ? node.parentNode.nodeName : null;
  6490. if (typeof parentTagName === "string" && NON_ESCAPABLE_CONTENT.has(parentTagName)) {
  6491. if (isWithinWhitespaceSensitive(node)) {
  6492. yield textContent;
  6493. } else {
  6494. yield trimmedTextContent;
  6495. textContentLength = trimmedTextContent.length;
  6496. }
  6497. output.currentLineWidth += textContentLength;
  6498. } else {
  6499. if (opts.prettyHtml && !isWithinWhitespaceSensitiveNode) {
  6500. yield escapeString(textContent.replace(/\s\s+/g, " ").trim(), false);
  6501. output.currentLineWidth += textContentLength;
  6502. } else {
  6503. if (isWithinWhitespaceSensitive(node)) {
  6504. output.currentLineWidth += textContentLength;
  6505. } else {
  6506. if (/\s/.test(textContent.charAt(0))) {
  6507. textContent = " " + textContent.trimLeft();
  6508. }
  6509. textContentLength = textContent.length;
  6510. if (textContentLength > 1) {
  6511. if (/\s/.test(textContent.charAt(textContentLength - 1))) {
  6512. if (opts.approximateLineWidth && opts.approximateLineWidth > 0 && output.currentLineWidth + textContentLength > opts.approximateLineWidth) {
  6513. textContent = textContent.trimRight() + "\n";
  6514. output.currentLineWidth = 0;
  6515. } else {
  6516. textContent = textContent.trimRight() + " ";
  6517. }
  6518. }
  6519. }
  6520. output.currentLineWidth += textContentLength;
  6521. }
  6522. yield escapeString(textContent, false);
  6523. }
  6524. }
  6525. }
  6526. }
  6527. }
  6528. } else if (node.nodeType === 8 /* COMMENT_NODE */) {
  6529. const nodeValue = node.nodeValue;
  6530. const isHydrateAnnotation = (nodeValue == null ? void 0 : nodeValue.startsWith(CONTENT_REF_ID + ".")) || (nodeValue == null ? void 0 : nodeValue.startsWith(ORG_LOCATION_ID + ".")) || (nodeValue == null ? void 0 : nodeValue.startsWith(SLOT_NODE_ID + ".")) || (nodeValue == null ? void 0 : nodeValue.startsWith(TEXT_NODE_ID + "."));
  6531. if (opts.removeHtmlComments && !isHydrateAnnotation) {
  6532. return;
  6533. }
  6534. const isWithinWhitespaceSensitiveNode = opts.newLines || ((_o = opts.indentSpaces) != null ? _o : 0) > 0 ? isWithinWhitespaceSensitive(node) : false;
  6535. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  6536. yield "\n";
  6537. output.currentLineWidth = 0;
  6538. }
  6539. if (((_p = opts.indentSpaces) != null ? _p : 0) > 0 && !isWithinWhitespaceSensitiveNode) {
  6540. for (let i = 0; i < output.indent; i++) {
  6541. yield " ";
  6542. }
  6543. output.currentLineWidth += output.indent;
  6544. }
  6545. yield "<!--" + nodeValue + "-->";
  6546. if (nodeValue) {
  6547. output.currentLineWidth += nodeValue.length + 7;
  6548. }
  6549. } else if (node.nodeType === 10 /* DOCUMENT_TYPE_NODE */) {
  6550. yield "<!doctype html>";
  6551. }
  6552. }
  6553. var AMP_REGEX = /&/g;
  6554. var NBSP_REGEX = /\u00a0/g;
  6555. var DOUBLE_QUOTE_REGEX = /"/g;
  6556. var LT_REGEX = /</g;
  6557. var GT_REGEX = />/g;
  6558. var CAN_REMOVE_ATTR_QUOTES = /^[^ \t\n\f\r"'`=<>\/\\-]+$/;
  6559. function getTagName(element) {
  6560. if (element.namespaceURI === "http://www.w3.org/1999/xhtml") {
  6561. return element.nodeName.toLowerCase();
  6562. } else {
  6563. return element.nodeName;
  6564. }
  6565. }
  6566. function escapeString(str, attrMode) {
  6567. str = str.replace(AMP_REGEX, "&amp;").replace(NBSP_REGEX, "&nbsp;");
  6568. if (attrMode) {
  6569. return str.replace(DOUBLE_QUOTE_REGEX, "&quot;");
  6570. }
  6571. return str.replace(LT_REGEX, "&lt;").replace(GT_REGEX, "&gt;");
  6572. }
  6573. function isWithinWhitespaceSensitive(node) {
  6574. let _node = node;
  6575. while (_node == null ? void 0 : _node.nodeName) {
  6576. if (WHITESPACE_SENSITIVE.has(_node.nodeName)) {
  6577. return true;
  6578. }
  6579. _node = _node.parentNode;
  6580. }
  6581. return false;
  6582. }
  6583. var NON_ESCAPABLE_CONTENT = /* @__PURE__ */ new Set([
  6584. "STYLE",
  6585. "SCRIPT",
  6586. "IFRAME",
  6587. "NOSCRIPT",
  6588. "XMP",
  6589. "NOEMBED",
  6590. "NOFRAMES",
  6591. "PLAINTEXT"
  6592. ]);
  6593. var WHITESPACE_SENSITIVE = /* @__PURE__ */ new Set([
  6594. "CODE",
  6595. "OUTPUT",
  6596. "PLAINTEXT",
  6597. "PRE",
  6598. "SCRIPT",
  6599. "TEMPLATE",
  6600. "TEXTAREA"
  6601. ]);
  6602. var EMPTY_ELEMENTS = /* @__PURE__ */ new Set([
  6603. "area",
  6604. "base",
  6605. "basefont",
  6606. "bgsound",
  6607. "br",
  6608. "col",
  6609. "embed",
  6610. "frame",
  6611. "hr",
  6612. "img",
  6613. "input",
  6614. "keygen",
  6615. "link",
  6616. "meta",
  6617. "param",
  6618. "source",
  6619. "trace",
  6620. "track",
  6621. "wbr"
  6622. ]);
  6623. var REMOVE_EMPTY_ATTR = /* @__PURE__ */ new Set(["class", "dir", "id", "lang", "name", "title"]);
  6624. var BOOLEAN_ATTR = /* @__PURE__ */ new Set([
  6625. "allowfullscreen",
  6626. "async",
  6627. "autofocus",
  6628. "autoplay",
  6629. "checked",
  6630. "compact",
  6631. "controls",
  6632. "declare",
  6633. "default",
  6634. "defaultchecked",
  6635. "defaultmuted",
  6636. "defaultselected",
  6637. "defer",
  6638. "disabled",
  6639. "enabled",
  6640. "formnovalidate",
  6641. "hidden",
  6642. "indeterminate",
  6643. "inert",
  6644. "ismap",
  6645. "itemscope",
  6646. "loop",
  6647. "multiple",
  6648. "muted",
  6649. "nohref",
  6650. "nomodule",
  6651. "noresize",
  6652. "noshade",
  6653. "novalidate",
  6654. "nowrap",
  6655. "open",
  6656. "pauseonexit",
  6657. "readonly",
  6658. "required",
  6659. "reversed",
  6660. "scoped",
  6661. "seamless",
  6662. "selected",
  6663. "sortable",
  6664. "truespeed",
  6665. "typemustmatch",
  6666. "visible"
  6667. ]);
  6668. var STRUCTURE_ELEMENTS = /* @__PURE__ */ new Set([
  6669. "html",
  6670. "body",
  6671. "head",
  6672. "iframe",
  6673. "meta",
  6674. "link",
  6675. "base",
  6676. "title",
  6677. "script",
  6678. "style"
  6679. ]);
  6680. // src/mock-doc/node.ts
  6681. var MockNode2 = class {
  6682. constructor(ownerDocument, nodeType, nodeName, nodeValue) {
  6683. this.ownerDocument = ownerDocument;
  6684. this.nodeType = nodeType;
  6685. this.nodeName = nodeName;
  6686. this._nodeValue = nodeValue;
  6687. this.parentNode = null;
  6688. this.childNodes = [];
  6689. }
  6690. appendChild(newNode) {
  6691. if (newNode.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
  6692. const nodes = newNode.childNodes.slice();
  6693. for (const child of nodes) {
  6694. this.appendChild(child);
  6695. }
  6696. } else {
  6697. newNode.remove();
  6698. newNode.parentNode = this;
  6699. this.childNodes.push(newNode);
  6700. connectNode(this.ownerDocument, newNode);
  6701. }
  6702. return newNode;
  6703. }
  6704. append(...items) {
  6705. items.forEach((item) => {
  6706. const isNode = typeof item === "object" && item !== null && "nodeType" in item;
  6707. this.appendChild(isNode ? item : this.ownerDocument.createTextNode(String(item)));
  6708. });
  6709. }
  6710. prepend(...items) {
  6711. const firstChild = this.firstChild;
  6712. items.forEach((item) => {
  6713. const isNode = typeof item === "object" && item !== null && "nodeType" in item;
  6714. if (firstChild) {
  6715. this.insertBefore(isNode ? item : this.ownerDocument.createTextNode(String(item)), firstChild);
  6716. }
  6717. });
  6718. }
  6719. cloneNode(deep) {
  6720. throw new Error(`invalid node type to clone: ${this.nodeType}, deep: ${deep}`);
  6721. }
  6722. compareDocumentPosition(_other) {
  6723. return -1;
  6724. }
  6725. get firstChild() {
  6726. return this.childNodes[0] || null;
  6727. }
  6728. insertBefore(newNode, referenceNode) {
  6729. if (newNode.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
  6730. for (let i = 0, ii = newNode.childNodes.length; i < ii; i++) {
  6731. insertBefore(this, newNode.childNodes[i], referenceNode);
  6732. }
  6733. } else {
  6734. insertBefore(this, newNode, referenceNode);
  6735. }
  6736. return newNode;
  6737. }
  6738. get isConnected() {
  6739. let node = this;
  6740. while (node != null) {
  6741. if (node.nodeType === 9 /* DOCUMENT_NODE */) {
  6742. return true;
  6743. }
  6744. node = node.parentNode;
  6745. if (node != null && node.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
  6746. node = node.host;
  6747. }
  6748. }
  6749. return false;
  6750. }
  6751. isSameNode(node) {
  6752. return this === node;
  6753. }
  6754. get lastChild() {
  6755. return this.childNodes[this.childNodes.length - 1] || null;
  6756. }
  6757. get nextSibling() {
  6758. if (this.parentNode != null) {
  6759. const index = this.parentNode.childNodes.indexOf(this) + 1;
  6760. return this.parentNode.childNodes[index] || null;
  6761. }
  6762. return null;
  6763. }
  6764. get nodeValue() {
  6765. var _a;
  6766. return (_a = this._nodeValue) != null ? _a : "";
  6767. }
  6768. set nodeValue(value) {
  6769. this._nodeValue = value;
  6770. }
  6771. get parentElement() {
  6772. return this.parentNode || null;
  6773. }
  6774. set parentElement(value) {
  6775. this.parentNode = value;
  6776. }
  6777. get previousSibling() {
  6778. if (this.parentNode != null) {
  6779. const index = this.parentNode.childNodes.indexOf(this) - 1;
  6780. return this.parentNode.childNodes[index] || null;
  6781. }
  6782. return null;
  6783. }
  6784. contains(otherNode) {
  6785. if (otherNode === this) {
  6786. return true;
  6787. }
  6788. const childNodes = Array.from(this.childNodes);
  6789. if (childNodes.includes(otherNode)) {
  6790. return true;
  6791. }
  6792. return childNodes.some((node) => this.contains.bind(node)(otherNode));
  6793. }
  6794. removeChild(childNode) {
  6795. const index = this.childNodes.indexOf(childNode);
  6796. if (index > -1) {
  6797. this.childNodes.splice(index, 1);
  6798. if (this.nodeType === 1 /* ELEMENT_NODE */) {
  6799. const wasConnected = this.isConnected;
  6800. childNode.parentNode = null;
  6801. if (wasConnected === true) {
  6802. disconnectNode(childNode);
  6803. }
  6804. } else {
  6805. childNode.parentNode = null;
  6806. }
  6807. } else {
  6808. throw new Error(`node not found within childNodes during removeChild`);
  6809. }
  6810. return childNode;
  6811. }
  6812. remove() {
  6813. if (this.parentNode != null) {
  6814. this.parentNode.removeChild(this);
  6815. }
  6816. }
  6817. replaceChild(newChild, oldChild) {
  6818. if (oldChild.parentNode === this) {
  6819. this.insertBefore(newChild, oldChild);
  6820. oldChild.remove();
  6821. return newChild;
  6822. }
  6823. return null;
  6824. }
  6825. get textContent() {
  6826. var _a;
  6827. return (_a = this._nodeValue) != null ? _a : "";
  6828. }
  6829. set textContent(value) {
  6830. this._nodeValue = String(value);
  6831. }
  6832. };
  6833. MockNode2.ELEMENT_NODE = 1;
  6834. MockNode2.TEXT_NODE = 3;
  6835. MockNode2.PROCESSING_INSTRUCTION_NODE = 7;
  6836. MockNode2.COMMENT_NODE = 8;
  6837. MockNode2.DOCUMENT_NODE = 9;
  6838. MockNode2.DOCUMENT_TYPE_NODE = 10;
  6839. MockNode2.DOCUMENT_FRAGMENT_NODE = 11;
  6840. var MockNodeList = class {
  6841. constructor(ownerDocument, childNodes, length) {
  6842. this.ownerDocument = ownerDocument;
  6843. this.childNodes = childNodes;
  6844. this.length = length;
  6845. }
  6846. };
  6847. var MockElement = class extends MockNode2 {
  6848. attachInternals() {
  6849. return new Proxy({}, {
  6850. get: function(_target, prop, _receiver) {
  6851. console.error(
  6852. `NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
  6853. Testing components with ElementInternals is fully supported in e2e tests.`
  6854. );
  6855. }
  6856. });
  6857. }
  6858. constructor(ownerDocument, nodeName, namespaceURI = null) {
  6859. super(ownerDocument, 1 /* ELEMENT_NODE */, typeof nodeName === "string" ? nodeName : null, null);
  6860. this.__namespaceURI = namespaceURI;
  6861. this.__shadowRoot = null;
  6862. this.__attributeMap = null;
  6863. }
  6864. addEventListener(type, handler) {
  6865. addEventListener(this, type, handler);
  6866. }
  6867. attachShadow(_opts) {
  6868. const shadowRoot = this.ownerDocument.createDocumentFragment();
  6869. this.shadowRoot = shadowRoot;
  6870. return shadowRoot;
  6871. }
  6872. blur() {
  6873. dispatchEvent(
  6874. this,
  6875. new MockFocusEvent("blur", { relatedTarget: null, bubbles: true, cancelable: true, composed: true })
  6876. );
  6877. }
  6878. get localName() {
  6879. if (!this.nodeName) {
  6880. throw new Error(`Can't compute elements localName without nodeName`);
  6881. }
  6882. return this.nodeName.toLocaleLowerCase();
  6883. }
  6884. get namespaceURI() {
  6885. return this.__namespaceURI;
  6886. }
  6887. get shadowRoot() {
  6888. return this.__shadowRoot || null;
  6889. }
  6890. /**
  6891. * Set shadow root for element
  6892. * @param shadowRoot - ShadowRoot to set
  6893. */
  6894. set shadowRoot(shadowRoot) {
  6895. if (shadowRoot != null) {
  6896. shadowRoot.host = this;
  6897. this.__shadowRoot = shadowRoot;
  6898. } else {
  6899. delete this.__shadowRoot;
  6900. }
  6901. }
  6902. get attributes() {
  6903. if (this.__attributeMap == null) {
  6904. const attrMap = createAttributeProxy(false);
  6905. this.__attributeMap = attrMap;
  6906. return attrMap;
  6907. }
  6908. return this.__attributeMap;
  6909. }
  6910. set attributes(attrs) {
  6911. this.__attributeMap = attrs;
  6912. }
  6913. get children() {
  6914. return this.childNodes.filter((n) => n.nodeType === 1 /* ELEMENT_NODE */);
  6915. }
  6916. get childElementCount() {
  6917. return this.childNodes.filter((n) => n.nodeType === 1 /* ELEMENT_NODE */).length;
  6918. }
  6919. get className() {
  6920. return this.getAttributeNS(null, "class") || "";
  6921. }
  6922. set className(value) {
  6923. this.setAttributeNS(null, "class", value);
  6924. }
  6925. get classList() {
  6926. return new MockClassList(this);
  6927. }
  6928. click() {
  6929. dispatchEvent(this, new MockEvent("click", { bubbles: true, cancelable: true, composed: true }));
  6930. }
  6931. cloneNode(_deep) {
  6932. return null;
  6933. }
  6934. closest(selector) {
  6935. let elm = this;
  6936. while (elm != null) {
  6937. if (elm.matches(selector)) {
  6938. return elm;
  6939. }
  6940. elm = elm.parentNode;
  6941. }
  6942. return null;
  6943. }
  6944. get dataset() {
  6945. return dataset(this);
  6946. }
  6947. get dir() {
  6948. return this.getAttributeNS(null, "dir") || "";
  6949. }
  6950. set dir(value) {
  6951. this.setAttributeNS(null, "dir", value);
  6952. }
  6953. dispatchEvent(ev) {
  6954. return dispatchEvent(this, ev);
  6955. }
  6956. get firstElementChild() {
  6957. return this.children[0] || null;
  6958. }
  6959. focus(_options) {
  6960. dispatchEvent(
  6961. this,
  6962. new MockFocusEvent("focus", { relatedTarget: null, bubbles: true, cancelable: true, composed: true })
  6963. );
  6964. }
  6965. getAttribute(attrName) {
  6966. if (attrName === "style") {
  6967. if (this.__style != null && this.__style.length > 0) {
  6968. return this.style.cssText;
  6969. }
  6970. return null;
  6971. }
  6972. const attr = this.attributes.getNamedItem(attrName);
  6973. if (attr != null) {
  6974. return attr.value;
  6975. }
  6976. return null;
  6977. }
  6978. getAttributeNS(namespaceURI, attrName) {
  6979. const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
  6980. if (attr != null) {
  6981. return attr.value;
  6982. }
  6983. return null;
  6984. }
  6985. getAttributeNode(attrName) {
  6986. if (!this.hasAttribute(attrName)) {
  6987. return null;
  6988. }
  6989. return new MockAttr(attrName, this.getAttribute(attrName));
  6990. }
  6991. getBoundingClientRect() {
  6992. return { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0 };
  6993. }
  6994. getRootNode(opts) {
  6995. const isComposed = opts != null && opts.composed === true;
  6996. let node = this;
  6997. while (node.parentNode != null) {
  6998. node = node.parentNode;
  6999. if (isComposed === true && node.parentNode == null && node.host != null) {
  7000. node = node.host;
  7001. }
  7002. }
  7003. return node;
  7004. }
  7005. get draggable() {
  7006. return this.getAttributeNS(null, "draggable") === "true";
  7007. }
  7008. set draggable(value) {
  7009. this.setAttributeNS(null, "draggable", value);
  7010. }
  7011. hasChildNodes() {
  7012. return this.childNodes.length > 0;
  7013. }
  7014. get id() {
  7015. return this.getAttributeNS(null, "id") || "";
  7016. }
  7017. set id(value) {
  7018. this.setAttributeNS(null, "id", value);
  7019. }
  7020. get innerHTML() {
  7021. if (this.childNodes.length === 0) {
  7022. return "";
  7023. }
  7024. return serializeNodeToHtml(this, {
  7025. newLines: false,
  7026. indentSpaces: 0
  7027. });
  7028. }
  7029. set innerHTML(html) {
  7030. var _a;
  7031. if (NON_ESCAPABLE_CONTENT.has((_a = this.nodeName) != null ? _a : "") === true) {
  7032. setTextContent(this, html);
  7033. } else {
  7034. for (let i = this.childNodes.length - 1; i >= 0; i--) {
  7035. this.removeChild(this.childNodes[i]);
  7036. }
  7037. if (typeof html === "string") {
  7038. const frag = parseFragmentUtil(this.ownerDocument, html);
  7039. while (frag.childNodes.length > 0) {
  7040. this.appendChild(frag.childNodes[0]);
  7041. }
  7042. }
  7043. }
  7044. }
  7045. get innerText() {
  7046. const text = [];
  7047. getTextContent(this.childNodes, text);
  7048. return text.join("");
  7049. }
  7050. set innerText(value) {
  7051. setTextContent(this, value);
  7052. }
  7053. insertAdjacentElement(position, elm) {
  7054. if (position === "beforebegin" && this.parentNode) {
  7055. insertBefore(this.parentNode, elm, this);
  7056. } else if (position === "afterbegin") {
  7057. this.prepend(elm);
  7058. } else if (position === "beforeend") {
  7059. this.appendChild(elm);
  7060. } else if (position === "afterend" && this.parentNode) {
  7061. insertBefore(this.parentNode, elm, this.nextSibling);
  7062. }
  7063. return elm;
  7064. }
  7065. insertAdjacentHTML(position, html) {
  7066. const frag = parseFragmentUtil(this.ownerDocument, html);
  7067. if (position === "beforebegin") {
  7068. while (frag.childNodes.length > 0) {
  7069. if (this.parentNode) {
  7070. insertBefore(this.parentNode, frag.childNodes[0], this);
  7071. }
  7072. }
  7073. } else if (position === "afterbegin") {
  7074. while (frag.childNodes.length > 0) {
  7075. this.prepend(frag.childNodes[frag.childNodes.length - 1]);
  7076. }
  7077. } else if (position === "beforeend") {
  7078. while (frag.childNodes.length > 0) {
  7079. this.appendChild(frag.childNodes[0]);
  7080. }
  7081. } else if (position === "afterend") {
  7082. while (frag.childNodes.length > 0) {
  7083. if (this.parentNode) {
  7084. insertBefore(this.parentNode, frag.childNodes[frag.childNodes.length - 1], this.nextSibling);
  7085. }
  7086. }
  7087. }
  7088. }
  7089. insertAdjacentText(position, text) {
  7090. const elm = this.ownerDocument.createTextNode(text);
  7091. if (position === "beforebegin" && this.parentNode) {
  7092. insertBefore(this.parentNode, elm, this);
  7093. } else if (position === "afterbegin") {
  7094. this.prepend(elm);
  7095. } else if (position === "beforeend") {
  7096. this.appendChild(elm);
  7097. } else if (position === "afterend" && this.parentNode) {
  7098. insertBefore(this.parentNode, elm, this.nextSibling);
  7099. }
  7100. }
  7101. hasAttribute(attrName) {
  7102. if (attrName === "style") {
  7103. return this.__style != null && this.__style.length > 0;
  7104. }
  7105. return this.getAttribute(attrName) !== null;
  7106. }
  7107. hasAttributeNS(namespaceURI, name) {
  7108. return this.getAttributeNS(namespaceURI, name) !== null;
  7109. }
  7110. get hidden() {
  7111. return this.hasAttributeNS(null, "hidden");
  7112. }
  7113. set hidden(isHidden) {
  7114. if (isHidden === true) {
  7115. this.setAttributeNS(null, "hidden", "");
  7116. } else {
  7117. this.removeAttributeNS(null, "hidden");
  7118. }
  7119. }
  7120. get lang() {
  7121. return this.getAttributeNS(null, "lang") || "";
  7122. }
  7123. set lang(value) {
  7124. this.setAttributeNS(null, "lang", value);
  7125. }
  7126. get lastElementChild() {
  7127. const children = this.children;
  7128. return children[children.length - 1] || null;
  7129. }
  7130. matches(selector) {
  7131. return matches(selector, this);
  7132. }
  7133. get nextElementSibling() {
  7134. const parentElement = this.parentElement;
  7135. if (parentElement != null && (parentElement.nodeType === 1 /* ELEMENT_NODE */ || parentElement.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */ || parentElement.nodeType === 9 /* DOCUMENT_NODE */)) {
  7136. const children = parentElement.children;
  7137. const index = children.indexOf(this) + 1;
  7138. return parentElement.children[index] || null;
  7139. }
  7140. return null;
  7141. }
  7142. get outerHTML() {
  7143. return serializeNodeToHtml(this, {
  7144. newLines: false,
  7145. outerHtml: true,
  7146. indentSpaces: 0
  7147. });
  7148. }
  7149. get previousElementSibling() {
  7150. const parentElement = this.parentElement;
  7151. if (parentElement != null && (parentElement.nodeType === 1 /* ELEMENT_NODE */ || parentElement.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */ || parentElement.nodeType === 9 /* DOCUMENT_NODE */)) {
  7152. const children = parentElement.children;
  7153. const index = children.indexOf(this) - 1;
  7154. return parentElement.children[index] || null;
  7155. }
  7156. return null;
  7157. }
  7158. getElementsByClassName(classNames) {
  7159. const classes = classNames.trim().split(" ").filter((c) => c.length > 0);
  7160. const results = [];
  7161. getElementsByClassName(this, classes, results);
  7162. return results;
  7163. }
  7164. getElementsByTagName(tagName) {
  7165. const results = [];
  7166. getElementsByTagName(this, tagName.toLowerCase(), results);
  7167. return results;
  7168. }
  7169. querySelector(selector) {
  7170. return selectOne(selector, this);
  7171. }
  7172. querySelectorAll(selector) {
  7173. return selectAll(selector, this);
  7174. }
  7175. removeAttribute(attrName) {
  7176. if (attrName === "style") {
  7177. delete this.__style;
  7178. } else {
  7179. const attr = this.attributes.getNamedItem(attrName);
  7180. if (attr != null) {
  7181. this.attributes.removeNamedItemNS(attr);
  7182. if (checkAttributeChanged(this) === true) {
  7183. attributeChanged(this, attrName, attr.value, null);
  7184. }
  7185. }
  7186. }
  7187. }
  7188. removeAttributeNS(namespaceURI, attrName) {
  7189. const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
  7190. if (attr != null) {
  7191. this.attributes.removeNamedItemNS(attr);
  7192. if (checkAttributeChanged(this) === true) {
  7193. attributeChanged(this, attrName, attr.value, null);
  7194. }
  7195. }
  7196. }
  7197. removeEventListener(type, handler) {
  7198. removeEventListener(this, type, handler);
  7199. }
  7200. setAttribute(attrName, value) {
  7201. if (attrName === "style") {
  7202. this.style = value;
  7203. } else {
  7204. const attributes = this.attributes;
  7205. let attr = attributes.getNamedItem(attrName);
  7206. const checkAttrChanged = checkAttributeChanged(this);
  7207. if (attr != null) {
  7208. if (checkAttrChanged === true) {
  7209. const oldValue = attr.value;
  7210. attr.value = value;
  7211. if (oldValue !== attr.value) {
  7212. attributeChanged(this, attr.name, oldValue, attr.value);
  7213. }
  7214. } else {
  7215. attr.value = value;
  7216. }
  7217. } else {
  7218. if (attributes.caseInsensitive) {
  7219. attrName = attrName.toLowerCase();
  7220. }
  7221. attr = new MockAttr(attrName, value);
  7222. attributes.__items.push(attr);
  7223. if (checkAttrChanged === true) {
  7224. attributeChanged(this, attrName, null, attr.value);
  7225. }
  7226. }
  7227. }
  7228. }
  7229. setAttributeNS(namespaceURI, attrName, value) {
  7230. const attributes = this.attributes;
  7231. let attr = attributes.getNamedItemNS(namespaceURI, attrName);
  7232. const checkAttrChanged = checkAttributeChanged(this);
  7233. if (attr != null) {
  7234. if (checkAttrChanged === true) {
  7235. const oldValue = attr.value;
  7236. attr.value = value;
  7237. if (oldValue !== attr.value) {
  7238. attributeChanged(this, attr.name, oldValue, attr.value);
  7239. }
  7240. } else {
  7241. attr.value = value;
  7242. }
  7243. } else {
  7244. attr = new MockAttr(attrName, value, namespaceURI);
  7245. attributes.__items.push(attr);
  7246. if (checkAttrChanged === true) {
  7247. attributeChanged(this, attrName, null, attr.value);
  7248. }
  7249. }
  7250. }
  7251. get style() {
  7252. if (this.__style == null) {
  7253. this.__style = createCSSStyleDeclaration();
  7254. }
  7255. return this.__style;
  7256. }
  7257. set style(val) {
  7258. if (typeof val === "string") {
  7259. if (this.__style == null) {
  7260. this.__style = createCSSStyleDeclaration();
  7261. }
  7262. this.__style.cssText = val;
  7263. } else {
  7264. this.__style = val;
  7265. }
  7266. }
  7267. get tabIndex() {
  7268. return parseInt(this.getAttributeNS(null, "tabindex") || "-1", 10);
  7269. }
  7270. set tabIndex(value) {
  7271. this.setAttributeNS(null, "tabindex", value);
  7272. }
  7273. get tagName() {
  7274. var _a;
  7275. return (_a = this.nodeName) != null ? _a : "";
  7276. }
  7277. set tagName(value) {
  7278. this.nodeName = value;
  7279. }
  7280. get textContent() {
  7281. const text = [];
  7282. getTextContent(this.childNodes, text);
  7283. return text.join("");
  7284. }
  7285. set textContent(value) {
  7286. setTextContent(this, value);
  7287. }
  7288. get title() {
  7289. return this.getAttributeNS(null, "title") || "";
  7290. }
  7291. set title(value) {
  7292. this.setAttributeNS(null, "title", value);
  7293. }
  7294. animate() {
  7295. }
  7296. onanimationstart() {
  7297. }
  7298. onanimationend() {
  7299. }
  7300. onanimationiteration() {
  7301. }
  7302. onabort() {
  7303. }
  7304. onauxclick() {
  7305. }
  7306. onbeforecopy() {
  7307. }
  7308. onbeforecut() {
  7309. }
  7310. onbeforepaste() {
  7311. }
  7312. onblur() {
  7313. }
  7314. oncancel() {
  7315. }
  7316. oncanplay() {
  7317. }
  7318. oncanplaythrough() {
  7319. }
  7320. onchange() {
  7321. }
  7322. onclick() {
  7323. }
  7324. onclose() {
  7325. }
  7326. oncontextmenu() {
  7327. }
  7328. oncopy() {
  7329. }
  7330. oncuechange() {
  7331. }
  7332. oncut() {
  7333. }
  7334. ondblclick() {
  7335. }
  7336. ondrag() {
  7337. }
  7338. ondragend() {
  7339. }
  7340. ondragenter() {
  7341. }
  7342. ondragleave() {
  7343. }
  7344. ondragover() {
  7345. }
  7346. ondragstart() {
  7347. }
  7348. ondrop() {
  7349. }
  7350. ondurationchange() {
  7351. }
  7352. onemptied() {
  7353. }
  7354. onended() {
  7355. }
  7356. onerror() {
  7357. }
  7358. onfocus() {
  7359. }
  7360. onfocusin() {
  7361. }
  7362. onfocusout() {
  7363. }
  7364. onformdata() {
  7365. }
  7366. onfullscreenchange() {
  7367. }
  7368. onfullscreenerror() {
  7369. }
  7370. ongotpointercapture() {
  7371. }
  7372. oninput() {
  7373. }
  7374. oninvalid() {
  7375. }
  7376. onkeydown() {
  7377. }
  7378. onkeypress() {
  7379. }
  7380. onkeyup() {
  7381. }
  7382. onload() {
  7383. }
  7384. onloadeddata() {
  7385. }
  7386. onloadedmetadata() {
  7387. }
  7388. onloadstart() {
  7389. }
  7390. onlostpointercapture() {
  7391. }
  7392. onmousedown() {
  7393. }
  7394. onmouseenter() {
  7395. }
  7396. onmouseleave() {
  7397. }
  7398. onmousemove() {
  7399. }
  7400. onmouseout() {
  7401. }
  7402. onmouseover() {
  7403. }
  7404. onmouseup() {
  7405. }
  7406. onmousewheel() {
  7407. }
  7408. onpaste() {
  7409. }
  7410. onpause() {
  7411. }
  7412. onplay() {
  7413. }
  7414. onplaying() {
  7415. }
  7416. onpointercancel() {
  7417. }
  7418. onpointerdown() {
  7419. }
  7420. onpointerenter() {
  7421. }
  7422. onpointerleave() {
  7423. }
  7424. onpointermove() {
  7425. }
  7426. onpointerout() {
  7427. }
  7428. onpointerover() {
  7429. }
  7430. onpointerup() {
  7431. }
  7432. onprogress() {
  7433. }
  7434. onratechange() {
  7435. }
  7436. onreset() {
  7437. }
  7438. onresize() {
  7439. }
  7440. onscroll() {
  7441. }
  7442. onsearch() {
  7443. }
  7444. onseeked() {
  7445. }
  7446. onseeking() {
  7447. }
  7448. onselect() {
  7449. }
  7450. onselectstart() {
  7451. }
  7452. onstalled() {
  7453. }
  7454. onsubmit() {
  7455. }
  7456. onsuspend() {
  7457. }
  7458. ontimeupdate() {
  7459. }
  7460. ontoggle() {
  7461. }
  7462. onvolumechange() {
  7463. }
  7464. onwaiting() {
  7465. }
  7466. onwebkitfullscreenchange() {
  7467. }
  7468. onwebkitfullscreenerror() {
  7469. }
  7470. onwheel() {
  7471. }
  7472. requestFullscreen() {
  7473. }
  7474. scrollBy() {
  7475. }
  7476. scrollTo() {
  7477. }
  7478. scrollIntoView() {
  7479. }
  7480. toString(opts) {
  7481. return serializeNodeToHtml(this, opts);
  7482. }
  7483. };
  7484. function getElementsByClassName(elm, classNames, foundElms) {
  7485. const children = elm.children;
  7486. for (let i = 0, ii = children.length; i < ii; i++) {
  7487. const childElm = children[i];
  7488. for (let j = 0, jj = classNames.length; j < jj; j++) {
  7489. if (childElm.classList.contains(classNames[j])) {
  7490. foundElms.push(childElm);
  7491. }
  7492. }
  7493. getElementsByClassName(childElm, classNames, foundElms);
  7494. }
  7495. }
  7496. function getElementsByTagName(elm, tagName, foundElms) {
  7497. var _a;
  7498. const children = elm.children;
  7499. for (let i = 0, ii = children.length; i < ii; i++) {
  7500. const childElm = children[i];
  7501. if (tagName === "*" || ((_a = childElm.nodeName) != null ? _a : "").toLowerCase() === tagName) {
  7502. foundElms.push(childElm);
  7503. }
  7504. getElementsByTagName(childElm, tagName, foundElms);
  7505. }
  7506. }
  7507. function resetElement(elm) {
  7508. resetEventListeners(elm);
  7509. delete elm.__attributeMap;
  7510. delete elm.__shadowRoot;
  7511. delete elm.__style;
  7512. }
  7513. function insertBefore(parentNode, newNode, referenceNode) {
  7514. if (newNode !== referenceNode) {
  7515. newNode.remove();
  7516. newNode.parentNode = parentNode;
  7517. newNode.ownerDocument = parentNode.ownerDocument;
  7518. if (referenceNode != null) {
  7519. const index = parentNode.childNodes.indexOf(referenceNode);
  7520. if (index > -1) {
  7521. parentNode.childNodes.splice(index, 0, newNode);
  7522. } else {
  7523. throw new Error(`referenceNode not found in parentNode.childNodes`);
  7524. }
  7525. } else {
  7526. parentNode.childNodes.push(newNode);
  7527. }
  7528. connectNode(parentNode.ownerDocument, newNode);
  7529. }
  7530. return newNode;
  7531. }
  7532. var MockHTMLElement = class extends MockElement {
  7533. constructor(ownerDocument, nodeName) {
  7534. super(ownerDocument, typeof nodeName === "string" ? nodeName.toUpperCase() : null);
  7535. this.__namespaceURI = "http://www.w3.org/1999/xhtml";
  7536. }
  7537. get tagName() {
  7538. var _a;
  7539. return (_a = this.nodeName) != null ? _a : "";
  7540. }
  7541. set tagName(value) {
  7542. this.nodeName = value;
  7543. }
  7544. /**
  7545. * A node’s parent of type Element is known as its parent element.
  7546. * If the node has a parent of a different type, its parent element
  7547. * is null.
  7548. * @returns MockElement
  7549. */
  7550. get parentElement() {
  7551. if (this.nodeName === "HTML") {
  7552. return null;
  7553. }
  7554. return super.parentElement;
  7555. }
  7556. get attributes() {
  7557. if (this.__attributeMap == null) {
  7558. const attrMap = createAttributeProxy(true);
  7559. this.__attributeMap = attrMap;
  7560. return attrMap;
  7561. }
  7562. return this.__attributeMap;
  7563. }
  7564. set attributes(attrs) {
  7565. this.__attributeMap = attrs;
  7566. }
  7567. };
  7568. var MockTextNode = class _MockTextNode extends MockNode2 {
  7569. constructor(ownerDocument, text) {
  7570. super(ownerDocument, 3 /* TEXT_NODE */, "#text" /* TEXT_NODE */, text);
  7571. }
  7572. cloneNode(_deep) {
  7573. return new _MockTextNode(null, this.nodeValue);
  7574. }
  7575. get textContent() {
  7576. return this.nodeValue;
  7577. }
  7578. set textContent(text) {
  7579. this.nodeValue = text;
  7580. }
  7581. get data() {
  7582. return this.nodeValue;
  7583. }
  7584. set data(text) {
  7585. this.nodeValue = text;
  7586. }
  7587. get wholeText() {
  7588. if (this.parentNode != null) {
  7589. const text = [];
  7590. for (let i = 0, ii = this.parentNode.childNodes.length; i < ii; i++) {
  7591. const childNode = this.parentNode.childNodes[i];
  7592. if (childNode.nodeType === 3 /* TEXT_NODE */) {
  7593. text.push(childNode.nodeValue);
  7594. }
  7595. }
  7596. return text.join("");
  7597. }
  7598. return this.nodeValue;
  7599. }
  7600. };
  7601. function getTextContent(childNodes, text) {
  7602. for (let i = 0, ii = childNodes.length; i < ii; i++) {
  7603. const childNode = childNodes[i];
  7604. if (childNode.nodeType === 3 /* TEXT_NODE */) {
  7605. text.push(childNode.nodeValue);
  7606. } else if (childNode.nodeType === 1 /* ELEMENT_NODE */) {
  7607. getTextContent(childNode.childNodes, text);
  7608. }
  7609. }
  7610. }
  7611. function setTextContent(elm, text) {
  7612. for (let i = elm.childNodes.length - 1; i >= 0; i--) {
  7613. elm.removeChild(elm.childNodes[i]);
  7614. }
  7615. const textNode = new MockTextNode(elm.ownerDocument, text);
  7616. elm.appendChild(textNode);
  7617. }
  7618. // src/mock-doc/comment-node.ts
  7619. var MockComment = class _MockComment extends MockNode2 {
  7620. constructor(ownerDocument, data) {
  7621. super(ownerDocument, 8 /* COMMENT_NODE */, "#comment" /* COMMENT_NODE */, data);
  7622. }
  7623. cloneNode(_deep) {
  7624. return new _MockComment(null, this.nodeValue);
  7625. }
  7626. get textContent() {
  7627. return this.nodeValue;
  7628. }
  7629. set textContent(text) {
  7630. this.nodeValue = text;
  7631. }
  7632. };
  7633. // src/mock-doc/document-fragment.ts
  7634. var MockDocumentFragment = class _MockDocumentFragment extends MockHTMLElement {
  7635. constructor(ownerDocument) {
  7636. super(ownerDocument, null);
  7637. this.nodeName = "#document-fragment" /* DOCUMENT_FRAGMENT_NODE */;
  7638. this.nodeType = 11 /* DOCUMENT_FRAGMENT_NODE */;
  7639. }
  7640. getElementById(id) {
  7641. return getElementById(this, id);
  7642. }
  7643. cloneNode(deep) {
  7644. const cloned = new _MockDocumentFragment(null);
  7645. if (deep) {
  7646. for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
  7647. const childNode = this.childNodes[i];
  7648. if (childNode.nodeType === 1 /* ELEMENT_NODE */ || childNode.nodeType === 3 /* TEXT_NODE */ || childNode.nodeType === 8 /* COMMENT_NODE */) {
  7649. const clonedChildNode = this.childNodes[i].cloneNode(true);
  7650. cloned.appendChild(clonedChildNode);
  7651. }
  7652. }
  7653. }
  7654. return cloned;
  7655. }
  7656. };
  7657. // src/mock-doc/document-type-node.ts
  7658. var MockDocumentTypeNode = class extends MockHTMLElement {
  7659. constructor(ownerDocument) {
  7660. super(ownerDocument, "!DOCTYPE");
  7661. this.nodeType = 10 /* DOCUMENT_TYPE_NODE */;
  7662. this.setAttribute("html", "");
  7663. }
  7664. };
  7665. // src/mock-doc/css-style-sheet.ts
  7666. var MockCSSRule = class {
  7667. constructor(parentStyleSheet) {
  7668. this.parentStyleSheet = parentStyleSheet;
  7669. this.cssText = "";
  7670. this.type = 0;
  7671. }
  7672. };
  7673. var MockCSSStyleSheet = class {
  7674. constructor(ownerNode) {
  7675. this.type = "text/css";
  7676. this.parentStyleSheet = null;
  7677. this.cssRules = [];
  7678. this.ownerNode = ownerNode;
  7679. }
  7680. get rules() {
  7681. return this.cssRules;
  7682. }
  7683. set rules(rules) {
  7684. this.cssRules = rules;
  7685. }
  7686. deleteRule(index) {
  7687. if (index >= 0 && index < this.cssRules.length) {
  7688. this.cssRules.splice(index, 1);
  7689. updateStyleTextNode(this.ownerNode);
  7690. }
  7691. }
  7692. insertRule(rule, index = 0) {
  7693. if (typeof index !== "number") {
  7694. index = 0;
  7695. }
  7696. if (index < 0) {
  7697. index = 0;
  7698. }
  7699. if (index > this.cssRules.length) {
  7700. index = this.cssRules.length;
  7701. }
  7702. const cssRule = new MockCSSRule(this);
  7703. cssRule.cssText = rule;
  7704. this.cssRules.splice(index, 0, cssRule);
  7705. updateStyleTextNode(this.ownerNode);
  7706. return index;
  7707. }
  7708. };
  7709. function getStyleElementText(styleElm) {
  7710. const output = [];
  7711. for (let i = 0; i < styleElm.childNodes.length; i++) {
  7712. output.push(styleElm.childNodes[i].nodeValue);
  7713. }
  7714. return output.join("");
  7715. }
  7716. function setStyleElementText(styleElm, text) {
  7717. const sheet = styleElm.sheet;
  7718. sheet.cssRules.length = 0;
  7719. sheet.insertRule(text);
  7720. updateStyleTextNode(styleElm);
  7721. }
  7722. function updateStyleTextNode(styleElm) {
  7723. const childNodeLen = styleElm.childNodes.length;
  7724. if (childNodeLen > 1) {
  7725. for (let i = childNodeLen - 1; i >= 1; i--) {
  7726. styleElm.removeChild(styleElm.childNodes[i]);
  7727. }
  7728. } else if (childNodeLen < 1) {
  7729. styleElm.appendChild(styleElm.ownerDocument.createTextNode(""));
  7730. }
  7731. const textNode = styleElm.childNodes[0];
  7732. textNode.nodeValue = styleElm.sheet.cssRules.map((r) => r.cssText).join("\n");
  7733. }
  7734. // src/mock-doc/element.ts
  7735. function createElement(ownerDocument, tagName) {
  7736. if (typeof tagName !== "string" || tagName === "" || !/^[a-z0-9-_:]+$/i.test(tagName)) {
  7737. throw new Error(`The tag name provided (${tagName}) is not a valid name.`);
  7738. }
  7739. tagName = tagName.toLowerCase();
  7740. switch (tagName) {
  7741. case "a":
  7742. return new MockAnchorElement(ownerDocument);
  7743. case "base":
  7744. return new MockBaseElement(ownerDocument);
  7745. case "button":
  7746. return new MockButtonElement(ownerDocument);
  7747. case "canvas":
  7748. return new MockCanvasElement(ownerDocument);
  7749. case "form":
  7750. return new MockFormElement(ownerDocument);
  7751. case "img":
  7752. return new MockImageElement(ownerDocument);
  7753. case "input":
  7754. return new MockInputElement(ownerDocument);
  7755. case "link":
  7756. return new MockLinkElement(ownerDocument);
  7757. case "meta":
  7758. return new MockMetaElement(ownerDocument);
  7759. case "script":
  7760. return new MockScriptElement(ownerDocument);
  7761. case "style":
  7762. return new MockStyleElement(ownerDocument);
  7763. case "template":
  7764. return new MockTemplateElement(ownerDocument);
  7765. case "title":
  7766. return new MockTitleElement(ownerDocument);
  7767. case "ul":
  7768. return new MockUListElement(ownerDocument);
  7769. }
  7770. if (ownerDocument != null && tagName.includes("-")) {
  7771. const win = ownerDocument.defaultView;
  7772. if (win != null && win.customElements != null) {
  7773. return createCustomElement(win.customElements, ownerDocument, tagName);
  7774. }
  7775. }
  7776. return new MockHTMLElement(ownerDocument, tagName);
  7777. }
  7778. function createElementNS(ownerDocument, namespaceURI, tagName) {
  7779. if (namespaceURI === "http://www.w3.org/1999/xhtml") {
  7780. return createElement(ownerDocument, tagName);
  7781. } else if (namespaceURI === "http://www.w3.org/2000/svg") {
  7782. switch (tagName.toLowerCase()) {
  7783. case "text":
  7784. case "tspan":
  7785. case "tref":
  7786. case "altglyph":
  7787. case "textpath":
  7788. return new MockSVGTextContentElement(ownerDocument, tagName);
  7789. case "circle":
  7790. case "ellipse":
  7791. case "image":
  7792. case "line":
  7793. case "path":
  7794. case "polygon":
  7795. case "polyline":
  7796. case "rect":
  7797. case "use":
  7798. return new MockSVGGraphicsElement(ownerDocument, tagName);
  7799. case "svg":
  7800. return new MockSVGSVGElement(ownerDocument, tagName);
  7801. default:
  7802. return new MockSVGElement(ownerDocument, tagName);
  7803. }
  7804. } else {
  7805. return new MockElement(ownerDocument, tagName, namespaceURI);
  7806. }
  7807. }
  7808. var MockAnchorElement = class extends MockHTMLElement {
  7809. constructor(ownerDocument) {
  7810. super(ownerDocument, "a");
  7811. }
  7812. get href() {
  7813. return fullUrl(this, "href");
  7814. }
  7815. set href(value) {
  7816. this.setAttribute("href", value);
  7817. }
  7818. get pathname() {
  7819. return new URL(this.href).pathname;
  7820. }
  7821. };
  7822. var MockButtonElement = class extends MockHTMLElement {
  7823. constructor(ownerDocument) {
  7824. super(ownerDocument, "button");
  7825. }
  7826. };
  7827. patchPropAttributes(
  7828. MockButtonElement.prototype,
  7829. {
  7830. type: String
  7831. },
  7832. {
  7833. type: "submit"
  7834. }
  7835. );
  7836. var MockImageElement = class extends MockHTMLElement {
  7837. constructor(ownerDocument) {
  7838. super(ownerDocument, "img");
  7839. }
  7840. get draggable() {
  7841. return this.getAttributeNS(null, "draggable") !== "false";
  7842. }
  7843. set draggable(value) {
  7844. this.setAttributeNS(null, "draggable", value);
  7845. }
  7846. get src() {
  7847. return fullUrl(this, "src");
  7848. }
  7849. set src(value) {
  7850. this.setAttribute("src", value);
  7851. }
  7852. };
  7853. patchPropAttributes(MockImageElement.prototype, {
  7854. height: Number,
  7855. width: Number
  7856. });
  7857. var MockInputElement = class extends MockHTMLElement {
  7858. constructor(ownerDocument) {
  7859. super(ownerDocument, "input");
  7860. }
  7861. get list() {
  7862. const listId = this.getAttribute("list");
  7863. if (listId) {
  7864. return this.ownerDocument.getElementById(listId);
  7865. }
  7866. return null;
  7867. }
  7868. };
  7869. patchPropAttributes(
  7870. MockInputElement.prototype,
  7871. {
  7872. accept: String,
  7873. autocomplete: String,
  7874. autofocus: Boolean,
  7875. capture: String,
  7876. checked: Boolean,
  7877. disabled: Boolean,
  7878. form: String,
  7879. formaction: String,
  7880. formenctype: String,
  7881. formmethod: String,
  7882. formnovalidate: String,
  7883. formtarget: String,
  7884. height: Number,
  7885. inputmode: String,
  7886. max: String,
  7887. maxLength: Number,
  7888. min: String,
  7889. minLength: Number,
  7890. multiple: Boolean,
  7891. name: String,
  7892. pattern: String,
  7893. placeholder: String,
  7894. required: Boolean,
  7895. readOnly: Boolean,
  7896. size: Number,
  7897. spellCheck: Boolean,
  7898. src: String,
  7899. step: String,
  7900. type: String,
  7901. value: String,
  7902. width: Number
  7903. },
  7904. {
  7905. type: "text"
  7906. }
  7907. );
  7908. var MockFormElement = class extends MockHTMLElement {
  7909. constructor(ownerDocument) {
  7910. super(ownerDocument, "form");
  7911. }
  7912. };
  7913. patchPropAttributes(MockFormElement.prototype, {
  7914. name: String
  7915. });
  7916. var MockLinkElement = class extends MockHTMLElement {
  7917. constructor(ownerDocument) {
  7918. super(ownerDocument, "link");
  7919. }
  7920. get href() {
  7921. return fullUrl(this, "href");
  7922. }
  7923. set href(value) {
  7924. this.setAttribute("href", value);
  7925. }
  7926. };
  7927. patchPropAttributes(MockLinkElement.prototype, {
  7928. crossorigin: String,
  7929. media: String,
  7930. rel: String,
  7931. type: String
  7932. });
  7933. var MockMetaElement = class extends MockHTMLElement {
  7934. constructor(ownerDocument) {
  7935. super(ownerDocument, "meta");
  7936. }
  7937. };
  7938. patchPropAttributes(MockMetaElement.prototype, {
  7939. charset: String,
  7940. content: String,
  7941. name: String
  7942. });
  7943. var MockScriptElement = class extends MockHTMLElement {
  7944. constructor(ownerDocument) {
  7945. super(ownerDocument, "script");
  7946. }
  7947. get src() {
  7948. return fullUrl(this, "src");
  7949. }
  7950. set src(value) {
  7951. this.setAttribute("src", value);
  7952. }
  7953. };
  7954. patchPropAttributes(MockScriptElement.prototype, {
  7955. type: String
  7956. });
  7957. var MockDOMMatrix = class _MockDOMMatrix {
  7958. constructor() {
  7959. this.a = 1;
  7960. this.b = 0;
  7961. this.c = 0;
  7962. this.d = 1;
  7963. this.e = 0;
  7964. this.f = 0;
  7965. this.m11 = 1;
  7966. this.m12 = 0;
  7967. this.m13 = 0;
  7968. this.m14 = 0;
  7969. this.m21 = 0;
  7970. this.m22 = 1;
  7971. this.m23 = 0;
  7972. this.m24 = 0;
  7973. this.m31 = 0;
  7974. this.m32 = 0;
  7975. this.m33 = 1;
  7976. this.m34 = 0;
  7977. this.m41 = 0;
  7978. this.m42 = 0;
  7979. this.m43 = 0;
  7980. this.m44 = 1;
  7981. this.is2D = true;
  7982. this.isIdentity = true;
  7983. }
  7984. static fromMatrix() {
  7985. return new _MockDOMMatrix();
  7986. }
  7987. inverse() {
  7988. return new _MockDOMMatrix();
  7989. }
  7990. flipX() {
  7991. return new _MockDOMMatrix();
  7992. }
  7993. flipY() {
  7994. return new _MockDOMMatrix();
  7995. }
  7996. multiply() {
  7997. return new _MockDOMMatrix();
  7998. }
  7999. rotate() {
  8000. return new _MockDOMMatrix();
  8001. }
  8002. rotateAxisAngle() {
  8003. return new _MockDOMMatrix();
  8004. }
  8005. rotateFromVector() {
  8006. return new _MockDOMMatrix();
  8007. }
  8008. scale() {
  8009. return new _MockDOMMatrix();
  8010. }
  8011. scaleNonUniform() {
  8012. return new _MockDOMMatrix();
  8013. }
  8014. skewX() {
  8015. return new _MockDOMMatrix();
  8016. }
  8017. skewY() {
  8018. return new _MockDOMMatrix();
  8019. }
  8020. toJSON() {
  8021. }
  8022. toString() {
  8023. }
  8024. transformPoint() {
  8025. return new MockDOMPoint();
  8026. }
  8027. translate() {
  8028. return new _MockDOMMatrix();
  8029. }
  8030. };
  8031. var MockDOMPoint = class {
  8032. constructor() {
  8033. this.w = 1;
  8034. this.x = 0;
  8035. this.y = 0;
  8036. this.z = 0;
  8037. }
  8038. toJSON() {
  8039. }
  8040. matrixTransform() {
  8041. return new MockDOMMatrix();
  8042. }
  8043. };
  8044. var MockSVGRect = class {
  8045. constructor() {
  8046. this.height = 10;
  8047. this.width = 10;
  8048. this.x = 0;
  8049. this.y = 0;
  8050. }
  8051. };
  8052. var MockStyleElement = class extends MockHTMLElement {
  8053. constructor(ownerDocument) {
  8054. super(ownerDocument, "style");
  8055. this.sheet = new MockCSSStyleSheet(this);
  8056. }
  8057. get innerHTML() {
  8058. return getStyleElementText(this);
  8059. }
  8060. set innerHTML(value) {
  8061. setStyleElementText(this, value);
  8062. }
  8063. get innerText() {
  8064. return getStyleElementText(this);
  8065. }
  8066. set innerText(value) {
  8067. setStyleElementText(this, value);
  8068. }
  8069. get textContent() {
  8070. return getStyleElementText(this);
  8071. }
  8072. set textContent(value) {
  8073. setStyleElementText(this, value);
  8074. }
  8075. };
  8076. var MockSVGElement = class extends MockElement {
  8077. constructor() {
  8078. super(...arguments);
  8079. this.__namespaceURI = "http://www.w3.org/2000/svg";
  8080. }
  8081. // SVGElement properties and methods
  8082. get ownerSVGElement() {
  8083. return null;
  8084. }
  8085. get viewportElement() {
  8086. return null;
  8087. }
  8088. onunload() {
  8089. }
  8090. // SVGGeometryElement properties and methods
  8091. get pathLength() {
  8092. return 0;
  8093. }
  8094. isPointInFill(_pt) {
  8095. return false;
  8096. }
  8097. isPointInStroke(_pt) {
  8098. return false;
  8099. }
  8100. getTotalLength() {
  8101. return 0;
  8102. }
  8103. };
  8104. var MockSVGGraphicsElement = class extends MockSVGElement {
  8105. getBBox(_options) {
  8106. return new MockSVGRect();
  8107. }
  8108. getCTM() {
  8109. return new MockDOMMatrix();
  8110. }
  8111. getScreenCTM() {
  8112. return new MockDOMMatrix();
  8113. }
  8114. };
  8115. var MockSVGSVGElement = class extends MockSVGGraphicsElement {
  8116. createSVGPoint() {
  8117. return new MockDOMPoint();
  8118. }
  8119. };
  8120. var MockSVGTextContentElement = class extends MockSVGGraphicsElement {
  8121. getComputedTextLength() {
  8122. return 0;
  8123. }
  8124. };
  8125. var MockBaseElement = class extends MockHTMLElement {
  8126. constructor(ownerDocument) {
  8127. super(ownerDocument, "base");
  8128. }
  8129. get href() {
  8130. return fullUrl(this, "href");
  8131. }
  8132. set href(value) {
  8133. this.setAttribute("href", value);
  8134. }
  8135. };
  8136. var MockTemplateElement = class _MockTemplateElement extends MockHTMLElement {
  8137. constructor(ownerDocument) {
  8138. super(ownerDocument, "template");
  8139. this.content = new MockDocumentFragment(ownerDocument);
  8140. }
  8141. get innerHTML() {
  8142. return this.content.innerHTML;
  8143. }
  8144. set innerHTML(html) {
  8145. this.content.innerHTML = html;
  8146. }
  8147. cloneNode(deep) {
  8148. const cloned = new _MockTemplateElement(null);
  8149. cloned.attributes = cloneAttributes(this.attributes);
  8150. const styleCssText = this.getAttribute("style");
  8151. if (styleCssText != null && styleCssText.length > 0) {
  8152. cloned.setAttribute("style", styleCssText);
  8153. }
  8154. cloned.content = this.content.cloneNode(deep);
  8155. if (deep) {
  8156. for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
  8157. const clonedChildNode = this.childNodes[i].cloneNode(true);
  8158. cloned.appendChild(clonedChildNode);
  8159. }
  8160. }
  8161. return cloned;
  8162. }
  8163. };
  8164. var MockTitleElement = class extends MockHTMLElement {
  8165. constructor(ownerDocument) {
  8166. super(ownerDocument, "title");
  8167. }
  8168. get text() {
  8169. return this.textContent;
  8170. }
  8171. set text(value) {
  8172. this.textContent = value;
  8173. }
  8174. };
  8175. var MockUListElement = class extends MockHTMLElement {
  8176. constructor(ownerDocument) {
  8177. super(ownerDocument, "ul");
  8178. }
  8179. };
  8180. var CanvasRenderingContext = class {
  8181. constructor(context, contextAttributes) {
  8182. this.context = context;
  8183. this.contextAttributes = contextAttributes;
  8184. }
  8185. fillRect() {
  8186. return;
  8187. }
  8188. clearRect() {
  8189. }
  8190. getImageData(_, __, w, h) {
  8191. return {
  8192. data: new Array(w * h * 4)
  8193. };
  8194. }
  8195. toDataURL() {
  8196. return "data:,";
  8197. }
  8198. putImageData() {
  8199. }
  8200. createImageData() {
  8201. return {};
  8202. }
  8203. setTransform() {
  8204. }
  8205. drawImage() {
  8206. }
  8207. save() {
  8208. }
  8209. fillText() {
  8210. }
  8211. restore() {
  8212. }
  8213. beginPath() {
  8214. }
  8215. moveTo() {
  8216. }
  8217. lineTo() {
  8218. }
  8219. closePath() {
  8220. }
  8221. stroke() {
  8222. }
  8223. translate() {
  8224. }
  8225. scale() {
  8226. }
  8227. rotate() {
  8228. }
  8229. arc() {
  8230. }
  8231. fill() {
  8232. }
  8233. measureText() {
  8234. return { width: 0 };
  8235. }
  8236. transform() {
  8237. }
  8238. rect() {
  8239. }
  8240. clip() {
  8241. }
  8242. };
  8243. var MockCanvasElement = class extends MockHTMLElement {
  8244. constructor(ownerDocument) {
  8245. super(ownerDocument, "canvas");
  8246. }
  8247. getContext(context, contextAttributes) {
  8248. return new CanvasRenderingContext(context, contextAttributes);
  8249. }
  8250. };
  8251. function fullUrl(elm, attrName) {
  8252. const val = elm.getAttribute(attrName) || "";
  8253. if (elm.ownerDocument != null) {
  8254. const win = elm.ownerDocument.defaultView;
  8255. if (win != null) {
  8256. const loc = win.location;
  8257. if (loc != null) {
  8258. try {
  8259. const url = new URL(val, loc.href);
  8260. return url.href;
  8261. } catch (e2) {
  8262. }
  8263. }
  8264. }
  8265. }
  8266. return val.replace(/\'|\"/g, "").trim();
  8267. }
  8268. function patchPropAttributes(prototype, attrs, defaults = {}) {
  8269. Object.keys(attrs).forEach((propName) => {
  8270. const attr = attrs[propName];
  8271. const defaultValue = defaults[propName];
  8272. if (attr === Boolean) {
  8273. Object.defineProperty(prototype, propName, {
  8274. get() {
  8275. return this.hasAttribute(propName);
  8276. },
  8277. set(value) {
  8278. if (value) {
  8279. this.setAttribute(propName, "");
  8280. } else {
  8281. this.removeAttribute(propName);
  8282. }
  8283. }
  8284. });
  8285. } else if (attr === Number) {
  8286. Object.defineProperty(prototype, propName, {
  8287. get() {
  8288. const value = this.getAttribute(propName);
  8289. return value ? parseInt(value, 10) : defaultValue === void 0 ? 0 : defaultValue;
  8290. },
  8291. set(value) {
  8292. this.setAttribute(propName, value);
  8293. }
  8294. });
  8295. } else {
  8296. Object.defineProperty(prototype, propName, {
  8297. get() {
  8298. return this.hasAttribute(propName) ? this.getAttribute(propName) : defaultValue || "";
  8299. },
  8300. set(value) {
  8301. this.setAttribute(propName, value);
  8302. }
  8303. });
  8304. }
  8305. });
  8306. }
  8307. MockElement.prototype.cloneNode = function(deep) {
  8308. const cloned = createElement(this.ownerDocument, this.nodeName);
  8309. cloned.attributes = cloneAttributes(this.attributes);
  8310. const styleCssText = this.getAttribute("style");
  8311. if (styleCssText != null && styleCssText.length > 0) {
  8312. cloned.setAttribute("style", styleCssText);
  8313. }
  8314. if (deep) {
  8315. for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
  8316. const clonedChildNode = this.childNodes[i].cloneNode(true);
  8317. cloned.appendChild(clonedChildNode);
  8318. }
  8319. }
  8320. return cloned;
  8321. };
  8322. // src/mock-doc/parse-html.ts
  8323. var sharedDocument;
  8324. function parseHtmlToDocument(html, ownerDocument = null) {
  8325. if (ownerDocument == null) {
  8326. if (sharedDocument == null) {
  8327. sharedDocument = new MockDocument();
  8328. }
  8329. ownerDocument = sharedDocument;
  8330. }
  8331. return parseDocumentUtil(ownerDocument, html);
  8332. }
  8333. function parseHtmlToFragment(html, ownerDocument = null) {
  8334. if (ownerDocument == null) {
  8335. if (sharedDocument == null) {
  8336. sharedDocument = new MockDocument();
  8337. }
  8338. ownerDocument = sharedDocument;
  8339. }
  8340. return parseFragmentUtil(ownerDocument, html);
  8341. }
  8342. // src/mock-doc/console.ts
  8343. var consoleNoop = () => {
  8344. };
  8345. function createConsole() {
  8346. return {
  8347. debug: consoleNoop,
  8348. error: consoleNoop,
  8349. info: consoleNoop,
  8350. log: consoleNoop,
  8351. warn: consoleNoop,
  8352. dir: consoleNoop,
  8353. dirxml: consoleNoop,
  8354. table: consoleNoop,
  8355. trace: consoleNoop,
  8356. group: consoleNoop,
  8357. groupCollapsed: consoleNoop,
  8358. groupEnd: consoleNoop,
  8359. clear: consoleNoop,
  8360. count: consoleNoop,
  8361. countReset: consoleNoop,
  8362. assert: consoleNoop,
  8363. profile: consoleNoop,
  8364. profileEnd: consoleNoop,
  8365. time: consoleNoop,
  8366. timeLog: consoleNoop,
  8367. timeEnd: consoleNoop,
  8368. timeStamp: consoleNoop,
  8369. context: consoleNoop,
  8370. memory: consoleNoop
  8371. };
  8372. }
  8373. // src/mock-doc/headers.ts
  8374. var MockHeaders = class {
  8375. constructor(init) {
  8376. this._values = [];
  8377. if (typeof init === "object") {
  8378. if (typeof init[Symbol.iterator] === "function") {
  8379. const kvs = [];
  8380. for (const kv of init) {
  8381. if (typeof kv[Symbol.iterator] === "function") {
  8382. kvs.push([...kv]);
  8383. }
  8384. }
  8385. for (const kv of kvs) {
  8386. this.append(kv[0], kv[1]);
  8387. }
  8388. } else {
  8389. for (const key in init) {
  8390. this.append(key, init[key]);
  8391. }
  8392. }
  8393. }
  8394. }
  8395. append(key, value) {
  8396. this._values.push([key, value + ""]);
  8397. }
  8398. delete(key) {
  8399. key = key.toLowerCase();
  8400. for (let i = this._values.length - 1; i >= 0; i--) {
  8401. if (this._values[i][0].toLowerCase() === key) {
  8402. this._values.splice(i, 1);
  8403. }
  8404. }
  8405. }
  8406. entries() {
  8407. const entries = [];
  8408. for (const kv of this.keys()) {
  8409. entries.push([kv, this.get(kv)]);
  8410. }
  8411. let index = -1;
  8412. return {
  8413. next() {
  8414. index++;
  8415. return {
  8416. value: entries[index],
  8417. done: !entries[index]
  8418. };
  8419. },
  8420. [Symbol.iterator]() {
  8421. return this;
  8422. }
  8423. };
  8424. }
  8425. forEach(cb) {
  8426. for (const kv of this.entries()) {
  8427. cb(kv[1], kv[0]);
  8428. }
  8429. }
  8430. get(key) {
  8431. const rtn = [];
  8432. key = key.toLowerCase();
  8433. for (const kv of this._values) {
  8434. if (kv[0].toLowerCase() === key) {
  8435. rtn.push(kv[1]);
  8436. }
  8437. }
  8438. return rtn.length > 0 ? rtn.join(", ") : null;
  8439. }
  8440. has(key) {
  8441. key = key.toLowerCase();
  8442. for (const kv of this._values) {
  8443. if (kv[0].toLowerCase() === key) {
  8444. return true;
  8445. }
  8446. }
  8447. return false;
  8448. }
  8449. keys() {
  8450. const keys = [];
  8451. for (const kv of this._values) {
  8452. const key = kv[0].toLowerCase();
  8453. if (!keys.includes(key)) {
  8454. keys.push(key);
  8455. }
  8456. }
  8457. let index = -1;
  8458. return {
  8459. next() {
  8460. index++;
  8461. return {
  8462. value: keys[index],
  8463. done: !keys[index]
  8464. };
  8465. },
  8466. [Symbol.iterator]() {
  8467. return this;
  8468. }
  8469. };
  8470. }
  8471. set(key, value) {
  8472. for (const kv of this._values) {
  8473. if (kv[0].toLowerCase() === key.toLowerCase()) {
  8474. kv[1] = value + "";
  8475. return;
  8476. }
  8477. }
  8478. this.append(key, value);
  8479. }
  8480. values() {
  8481. const values = this._values;
  8482. let index = -1;
  8483. return {
  8484. next() {
  8485. index++;
  8486. const done = !values[index];
  8487. return {
  8488. value: done ? void 0 : values[index][1],
  8489. done
  8490. };
  8491. },
  8492. [Symbol.iterator]() {
  8493. return this;
  8494. }
  8495. };
  8496. }
  8497. [Symbol.iterator]() {
  8498. return this.entries();
  8499. }
  8500. };
  8501. // src/mock-doc/parser.ts
  8502. var MockDOMParser = class {
  8503. parseFromString(htmlToParse, mimeType) {
  8504. if (mimeType !== "text/html") {
  8505. console.error("XML parsing not implemented yet, continuing as html");
  8506. }
  8507. return parseHtmlToDocument(htmlToParse);
  8508. }
  8509. };
  8510. // src/mock-doc/request-response.ts
  8511. var MockRequest = class _MockRequest {
  8512. constructor(input, init = {}) {
  8513. this._method = "GET";
  8514. this._url = "/";
  8515. this.bodyUsed = false;
  8516. this.cache = "default";
  8517. this.credentials = "same-origin";
  8518. this.integrity = "";
  8519. this.keepalive = false;
  8520. this.mode = "cors";
  8521. this.redirect = "follow";
  8522. this.referrer = "about:client";
  8523. this.referrerPolicy = "";
  8524. if (typeof input === "string") {
  8525. this.url = input;
  8526. } else if (input) {
  8527. Object.assign(this, input);
  8528. this.headers = new MockHeaders(input.headers);
  8529. }
  8530. Object.assign(this, init);
  8531. if (init.headers) {
  8532. this.headers = new MockHeaders(init.headers);
  8533. }
  8534. if (!this.headers) {
  8535. this.headers = new MockHeaders();
  8536. }
  8537. }
  8538. get url() {
  8539. if (typeof this._url === "string") {
  8540. return new URL(this._url, location.href).href;
  8541. }
  8542. return new URL("/", location.href).href;
  8543. }
  8544. set url(value) {
  8545. this._url = value;
  8546. }
  8547. get method() {
  8548. if (typeof this._method === "string") {
  8549. return this._method.toUpperCase();
  8550. }
  8551. return "GET";
  8552. }
  8553. set method(value) {
  8554. this._method = value;
  8555. }
  8556. clone() {
  8557. const clone = { ...this };
  8558. clone.headers = new MockHeaders(this.headers);
  8559. return new _MockRequest(clone);
  8560. }
  8561. };
  8562. var MockResponse = class _MockResponse {
  8563. constructor(body, init = {}) {
  8564. this.ok = true;
  8565. this.status = 200;
  8566. this.statusText = "";
  8567. this.type = "default";
  8568. this.url = "";
  8569. this._body = body;
  8570. if (init) {
  8571. Object.assign(this, init);
  8572. }
  8573. this.headers = new MockHeaders(init.headers);
  8574. }
  8575. async json() {
  8576. return JSON.parse(this._body);
  8577. }
  8578. async text() {
  8579. return this._body;
  8580. }
  8581. clone() {
  8582. const initClone = { ...this };
  8583. initClone.headers = new MockHeaders(this.headers);
  8584. return new _MockResponse(this._body, initClone);
  8585. }
  8586. };
  8587. // src/mock-doc/global.ts
  8588. function setupGlobal(gbl) {
  8589. if (gbl.window == null) {
  8590. const win = gbl.window = new MockWindow();
  8591. WINDOW_FUNCTIONS.forEach((fnName) => {
  8592. if (!(fnName in gbl)) {
  8593. gbl[fnName] = win[fnName].bind(win);
  8594. }
  8595. });
  8596. WINDOW_PROPS.forEach((propName) => {
  8597. if (!(propName in gbl)) {
  8598. Object.defineProperty(gbl, propName, {
  8599. get() {
  8600. return win[propName];
  8601. },
  8602. set(val) {
  8603. win[propName] = val;
  8604. },
  8605. configurable: true,
  8606. enumerable: true
  8607. });
  8608. }
  8609. });
  8610. GLOBAL_CONSTRUCTORS.forEach(([cstrName]) => {
  8611. gbl[cstrName] = win[cstrName];
  8612. });
  8613. }
  8614. return gbl.window;
  8615. }
  8616. function teardownGlobal(gbl) {
  8617. const win = gbl.window;
  8618. if (win && typeof win.close === "function") {
  8619. win.close();
  8620. }
  8621. }
  8622. function patchWindow(winToBePatched) {
  8623. const mockWin = new MockWindow(false);
  8624. WINDOW_FUNCTIONS.forEach((fnName) => {
  8625. if (typeof winToBePatched[fnName] !== "function") {
  8626. winToBePatched[fnName] = mockWin[fnName].bind(mockWin);
  8627. }
  8628. });
  8629. WINDOW_PROPS.forEach((propName) => {
  8630. if (winToBePatched === void 0) {
  8631. Object.defineProperty(winToBePatched, propName, {
  8632. get() {
  8633. return mockWin[propName];
  8634. },
  8635. set(val) {
  8636. mockWin[propName] = val;
  8637. },
  8638. configurable: true,
  8639. enumerable: true
  8640. });
  8641. }
  8642. });
  8643. }
  8644. function addGlobalsToWindowPrototype(mockWinPrototype) {
  8645. GLOBAL_CONSTRUCTORS.forEach(([cstrName, Cstr]) => {
  8646. Object.defineProperty(mockWinPrototype, cstrName, {
  8647. get() {
  8648. return this["__" + cstrName] || Cstr;
  8649. },
  8650. set(cstr) {
  8651. this["__" + cstrName] = cstr;
  8652. },
  8653. configurable: true,
  8654. enumerable: true
  8655. });
  8656. });
  8657. }
  8658. var WINDOW_FUNCTIONS = [
  8659. "addEventListener",
  8660. "alert",
  8661. "blur",
  8662. "cancelAnimationFrame",
  8663. "cancelIdleCallback",
  8664. "clearInterval",
  8665. "clearTimeout",
  8666. "close",
  8667. "confirm",
  8668. "dispatchEvent",
  8669. "focus",
  8670. "getComputedStyle",
  8671. "matchMedia",
  8672. "open",
  8673. "prompt",
  8674. "removeEventListener",
  8675. "requestAnimationFrame",
  8676. "requestIdleCallback",
  8677. "URL"
  8678. ];
  8679. var WINDOW_PROPS = [
  8680. "customElements",
  8681. "devicePixelRatio",
  8682. "document",
  8683. "history",
  8684. "innerHeight",
  8685. "innerWidth",
  8686. "localStorage",
  8687. "location",
  8688. "navigator",
  8689. "pageXOffset",
  8690. "pageYOffset",
  8691. "performance",
  8692. "screenLeft",
  8693. "screenTop",
  8694. "screenX",
  8695. "screenY",
  8696. "scrollX",
  8697. "scrollY",
  8698. "sessionStorage",
  8699. "CSS",
  8700. "CustomEvent",
  8701. "Event",
  8702. "Element",
  8703. "HTMLElement",
  8704. "Node",
  8705. "NodeList",
  8706. "FocusEvent",
  8707. "KeyboardEvent",
  8708. "MouseEvent"
  8709. ];
  8710. var GLOBAL_CONSTRUCTORS = [
  8711. ["CustomEvent", MockCustomEvent],
  8712. ["DocumentFragment", MockDocumentFragment],
  8713. ["DOMParser", MockDOMParser],
  8714. ["Event", MockEvent],
  8715. ["FocusEvent", MockFocusEvent],
  8716. ["Headers", MockHeaders],
  8717. ["KeyboardEvent", MockKeyboardEvent],
  8718. ["MouseEvent", MockMouseEvent],
  8719. ["Request", MockRequest],
  8720. ["Response", MockResponse],
  8721. ["ShadowRoot", MockDocumentFragment],
  8722. ["HTMLAnchorElement", MockAnchorElement],
  8723. ["HTMLBaseElement", MockBaseElement],
  8724. ["HTMLButtonElement", MockButtonElement],
  8725. ["HTMLCanvasElement", MockCanvasElement],
  8726. ["HTMLFormElement", MockFormElement],
  8727. ["HTMLImageElement", MockImageElement],
  8728. ["HTMLInputElement", MockInputElement],
  8729. ["HTMLLinkElement", MockLinkElement],
  8730. ["HTMLMetaElement", MockMetaElement],
  8731. ["HTMLScriptElement", MockScriptElement],
  8732. ["HTMLStyleElement", MockStyleElement],
  8733. ["HTMLTemplateElement", MockTemplateElement],
  8734. ["HTMLTitleElement", MockTitleElement],
  8735. ["HTMLUListElement", MockUListElement]
  8736. ];
  8737. // src/mock-doc/history.ts
  8738. var MockHistory = class {
  8739. constructor() {
  8740. this.items = [];
  8741. }
  8742. get length() {
  8743. return this.items.length;
  8744. }
  8745. back() {
  8746. this.go(-1);
  8747. }
  8748. forward() {
  8749. this.go(1);
  8750. }
  8751. go(_value) {
  8752. }
  8753. pushState(_state, _title, _url) {
  8754. }
  8755. replaceState(_state, _title, _url) {
  8756. }
  8757. };
  8758. // src/mock-doc/intersection-observer.ts
  8759. var MockIntersectionObserver = class {
  8760. constructor() {
  8761. }
  8762. disconnect() {
  8763. }
  8764. observe() {
  8765. }
  8766. takeRecords() {
  8767. return [];
  8768. }
  8769. unobserve() {
  8770. }
  8771. };
  8772. // src/mock-doc/location.ts
  8773. var MockLocation = class {
  8774. constructor() {
  8775. this.ancestorOrigins = null;
  8776. this.protocol = "";
  8777. this.host = "";
  8778. this.hostname = "";
  8779. this.port = "";
  8780. this.pathname = "";
  8781. this.search = "";
  8782. this.hash = "";
  8783. this.username = "";
  8784. this.password = "";
  8785. this.origin = "";
  8786. this._href = "";
  8787. }
  8788. get href() {
  8789. return this._href;
  8790. }
  8791. set href(value) {
  8792. const url = new URL(value, "http://mockdoc.stenciljs.com");
  8793. this._href = url.href;
  8794. this.protocol = url.protocol;
  8795. this.host = url.host;
  8796. this.hostname = url.hostname;
  8797. this.port = url.port;
  8798. this.pathname = url.pathname;
  8799. this.search = url.search;
  8800. this.hash = url.hash;
  8801. this.username = url.username;
  8802. this.password = url.password;
  8803. this.origin = url.origin;
  8804. }
  8805. assign(_url) {
  8806. }
  8807. reload(_forcedReload) {
  8808. }
  8809. replace(_url) {
  8810. }
  8811. toString() {
  8812. return this.href;
  8813. }
  8814. };
  8815. // src/mock-doc/navigator.ts
  8816. var MockNavigator = class {
  8817. constructor() {
  8818. this.appCodeName = "MockNavigator";
  8819. this.appName = "MockNavigator";
  8820. this.appVersion = "MockNavigator";
  8821. this.platform = "MockNavigator";
  8822. this.userAgent = "MockNavigator";
  8823. }
  8824. };
  8825. // src/mock-doc/performance.ts
  8826. var MockPerformance = class {
  8827. constructor() {
  8828. this.timeOrigin = Date.now();
  8829. this.eventCounts = /* @__PURE__ */ new Map();
  8830. }
  8831. addEventListener() {
  8832. }
  8833. clearMarks() {
  8834. }
  8835. clearMeasures() {
  8836. }
  8837. clearResourceTimings() {
  8838. }
  8839. dispatchEvent() {
  8840. return true;
  8841. }
  8842. getEntries() {
  8843. return [];
  8844. }
  8845. getEntriesByName() {
  8846. return [];
  8847. }
  8848. getEntriesByType() {
  8849. return [];
  8850. }
  8851. // Stencil's implementation of `mark` is non-compliant with the `Performance` interface. Because Stencil will
  8852. // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return
  8853. // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the
  8854. // associated errors returned by the type checker)
  8855. // @ts-ignore
  8856. mark() {
  8857. }
  8858. // Stencil's implementation of `measure` is non-compliant with the `Performance` interface. Because Stencil will
  8859. // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return
  8860. // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the
  8861. // associated errors returned by the type checker)
  8862. // @ts-ignore
  8863. measure() {
  8864. }
  8865. get navigation() {
  8866. return {};
  8867. }
  8868. now() {
  8869. return Date.now() - this.timeOrigin;
  8870. }
  8871. get onresourcetimingbufferfull() {
  8872. return null;
  8873. }
  8874. removeEventListener() {
  8875. }
  8876. setResourceTimingBufferSize() {
  8877. }
  8878. get timing() {
  8879. return {};
  8880. }
  8881. toJSON() {
  8882. }
  8883. };
  8884. function resetPerformance(perf) {
  8885. if (perf != null) {
  8886. try {
  8887. perf.timeOrigin = Date.now();
  8888. } catch (e2) {
  8889. }
  8890. }
  8891. }
  8892. // src/mock-doc/storage.ts
  8893. var MockStorage = class {
  8894. constructor() {
  8895. this.items = /* @__PURE__ */ new Map();
  8896. }
  8897. key(_value) {
  8898. }
  8899. getItem(key) {
  8900. key = String(key);
  8901. if (this.items.has(key)) {
  8902. return this.items.get(key);
  8903. }
  8904. return null;
  8905. }
  8906. setItem(key, value) {
  8907. if (value == null) {
  8908. value = "null";
  8909. }
  8910. this.items.set(String(key), String(value));
  8911. }
  8912. removeItem(key) {
  8913. this.items.delete(String(key));
  8914. }
  8915. clear() {
  8916. this.items.clear();
  8917. }
  8918. };
  8919. // src/mock-doc/window.ts
  8920. var nativeClearInterval = clearInterval;
  8921. var nativeClearTimeout = clearTimeout;
  8922. var nativeSetInterval = setInterval;
  8923. var nativeSetTimeout = setTimeout;
  8924. var nativeURL = URL;
  8925. var nativeWindow = globalThis.window;
  8926. var MockWindow = class {
  8927. constructor(html = null) {
  8928. if (html !== false) {
  8929. this.document = new MockDocument(html, this);
  8930. } else {
  8931. this.document = null;
  8932. }
  8933. this.performance = new MockPerformance();
  8934. this.customElements = new MockCustomElementRegistry(this);
  8935. this.console = createConsole();
  8936. resetWindowDefaults(this);
  8937. resetWindowDimensions(this);
  8938. }
  8939. addEventListener(type, handler) {
  8940. addEventListener(this, type, handler);
  8941. }
  8942. alert(msg) {
  8943. if (this.console) {
  8944. this.console.debug(msg);
  8945. } else {
  8946. console.debug(msg);
  8947. }
  8948. }
  8949. blur() {
  8950. }
  8951. cancelAnimationFrame(id) {
  8952. this.__clearTimeout.call(nativeWindow || this, id);
  8953. }
  8954. cancelIdleCallback(id) {
  8955. this.__clearTimeout.call(nativeWindow || this, id);
  8956. }
  8957. get CharacterData() {
  8958. if (this.__charDataCstr == null) {
  8959. const ownerDocument = this.document;
  8960. this.__charDataCstr = class extends MockNode2 {
  8961. constructor() {
  8962. super(ownerDocument, 0, "test", "");
  8963. throw new Error("Illegal constructor: cannot construct CharacterData");
  8964. }
  8965. };
  8966. }
  8967. return this.__charDataCstr;
  8968. }
  8969. set CharacterData(charDataCstr) {
  8970. this.__charDataCstr = charDataCstr;
  8971. }
  8972. clearInterval(id) {
  8973. this.__clearInterval.call(nativeWindow || this, id);
  8974. }
  8975. clearTimeout(id) {
  8976. this.__clearTimeout.call(nativeWindow || this, id);
  8977. }
  8978. close() {
  8979. resetWindow(this);
  8980. }
  8981. confirm() {
  8982. return false;
  8983. }
  8984. get CSS() {
  8985. return {
  8986. supports: () => true
  8987. };
  8988. }
  8989. get Document() {
  8990. if (this.__docCstr == null) {
  8991. const win = this;
  8992. this.__docCstr = class extends MockDocument {
  8993. constructor() {
  8994. super(false, win);
  8995. throw new Error("Illegal constructor: cannot construct Document");
  8996. }
  8997. };
  8998. }
  8999. return this.__docCstr;
  9000. }
  9001. set Document(docCstr) {
  9002. this.__docCstr = docCstr;
  9003. }
  9004. get DocumentFragment() {
  9005. if (this.__docFragCstr == null) {
  9006. const ownerDocument = this.document;
  9007. this.__docFragCstr = class extends MockDocumentFragment {
  9008. constructor() {
  9009. super(ownerDocument);
  9010. throw new Error("Illegal constructor: cannot construct DocumentFragment");
  9011. }
  9012. };
  9013. }
  9014. return this.__docFragCstr;
  9015. }
  9016. set DocumentFragment(docFragCstr) {
  9017. this.__docFragCstr = docFragCstr;
  9018. }
  9019. get DocumentType() {
  9020. if (this.__docTypeCstr == null) {
  9021. const ownerDocument = this.document;
  9022. this.__docTypeCstr = class extends MockNode2 {
  9023. constructor() {
  9024. super(ownerDocument, 0, "test", "");
  9025. throw new Error("Illegal constructor: cannot construct DocumentType");
  9026. }
  9027. };
  9028. }
  9029. return this.__docTypeCstr;
  9030. }
  9031. set DocumentType(docTypeCstr) {
  9032. this.__docTypeCstr = docTypeCstr;
  9033. }
  9034. get DOMTokenList() {
  9035. if (this.__domTokenListCstr == null) {
  9036. this.__domTokenListCstr = class MockDOMTokenList {
  9037. };
  9038. }
  9039. return this.__domTokenListCstr;
  9040. }
  9041. set DOMTokenList(domTokenListCstr) {
  9042. this.__domTokenListCstr = domTokenListCstr;
  9043. }
  9044. dispatchEvent(ev) {
  9045. return dispatchEvent(this, ev);
  9046. }
  9047. get Element() {
  9048. if (this.__elementCstr == null) {
  9049. const ownerDocument = this.document;
  9050. this.__elementCstr = class extends MockElement {
  9051. constructor() {
  9052. super(ownerDocument, "");
  9053. throw new Error("Illegal constructor: cannot construct Element");
  9054. }
  9055. };
  9056. }
  9057. return this.__elementCstr;
  9058. }
  9059. fetch(input, init) {
  9060. if (typeof fetch === "function") {
  9061. return fetch(input, init);
  9062. }
  9063. throw new Error(`fetch() not implemented`);
  9064. }
  9065. focus() {
  9066. }
  9067. getComputedStyle(_) {
  9068. return {
  9069. cssText: "",
  9070. length: 0,
  9071. parentRule: null,
  9072. getPropertyPriority() {
  9073. return null;
  9074. },
  9075. getPropertyValue() {
  9076. return "";
  9077. },
  9078. item() {
  9079. return null;
  9080. },
  9081. removeProperty() {
  9082. return null;
  9083. },
  9084. setProperty() {
  9085. return null;
  9086. }
  9087. };
  9088. }
  9089. get globalThis() {
  9090. return this;
  9091. }
  9092. get history() {
  9093. if (this.__history == null) {
  9094. this.__history = new MockHistory();
  9095. }
  9096. return this.__history;
  9097. }
  9098. set history(hsty) {
  9099. this.__history = hsty;
  9100. }
  9101. get JSON() {
  9102. return JSON;
  9103. }
  9104. get HTMLElement() {
  9105. if (this.__htmlElementCstr == null) {
  9106. const ownerDocument = this.document;
  9107. this.__htmlElementCstr = class extends MockHTMLElement {
  9108. constructor() {
  9109. super(ownerDocument, "");
  9110. const observedAttributes = this.constructor.observedAttributes;
  9111. if (Array.isArray(observedAttributes) && typeof this.attributeChangedCallback === "function") {
  9112. observedAttributes.forEach((attrName) => {
  9113. const attrValue = this.getAttribute(attrName);
  9114. if (attrValue != null) {
  9115. this.attributeChangedCallback(attrName, null, attrValue);
  9116. }
  9117. });
  9118. }
  9119. }
  9120. };
  9121. }
  9122. return this.__htmlElementCstr;
  9123. }
  9124. set HTMLElement(htmlElementCstr) {
  9125. this.__htmlElementCstr = htmlElementCstr;
  9126. }
  9127. get IntersectionObserver() {
  9128. return MockIntersectionObserver;
  9129. }
  9130. get localStorage() {
  9131. if (this.__localStorage == null) {
  9132. this.__localStorage = new MockStorage();
  9133. }
  9134. return this.__localStorage;
  9135. }
  9136. set localStorage(locStorage) {
  9137. this.__localStorage = locStorage;
  9138. }
  9139. get location() {
  9140. if (this.__location == null) {
  9141. this.__location = new MockLocation();
  9142. }
  9143. return this.__location;
  9144. }
  9145. set location(val) {
  9146. if (typeof val === "string") {
  9147. if (this.__location == null) {
  9148. this.__location = new MockLocation();
  9149. }
  9150. this.__location.href = val;
  9151. } else {
  9152. this.__location = val;
  9153. }
  9154. }
  9155. matchMedia(media) {
  9156. return {
  9157. media,
  9158. matches: false,
  9159. addListener: (_handler) => {
  9160. },
  9161. removeListener: (_handler) => {
  9162. },
  9163. addEventListener: (_type, _handler) => {
  9164. },
  9165. removeEventListener: (_type, _handler) => {
  9166. },
  9167. dispatchEvent: (_ev) => {
  9168. },
  9169. onchange: null
  9170. };
  9171. }
  9172. get Node() {
  9173. if (this.__nodeCstr == null) {
  9174. const ownerDocument = this.document;
  9175. this.__nodeCstr = class extends MockNode2 {
  9176. constructor() {
  9177. super(ownerDocument, 0, "test", "");
  9178. throw new Error("Illegal constructor: cannot construct Node");
  9179. }
  9180. };
  9181. }
  9182. return this.__nodeCstr;
  9183. }
  9184. get NodeList() {
  9185. if (this.__nodeListCstr == null) {
  9186. const ownerDocument = this.document;
  9187. this.__nodeListCstr = class extends MockNodeList {
  9188. constructor() {
  9189. super(ownerDocument, [], 0);
  9190. throw new Error("Illegal constructor: cannot construct NodeList");
  9191. }
  9192. };
  9193. }
  9194. return this.__nodeListCstr;
  9195. }
  9196. get navigator() {
  9197. if (this.__navigator == null) {
  9198. this.__navigator = new MockNavigator();
  9199. }
  9200. return this.__navigator;
  9201. }
  9202. set navigator(nav) {
  9203. this.__navigator = nav;
  9204. }
  9205. get parent() {
  9206. return null;
  9207. }
  9208. prompt() {
  9209. return "";
  9210. }
  9211. open() {
  9212. return null;
  9213. }
  9214. get origin() {
  9215. return this.location.origin;
  9216. }
  9217. removeEventListener(type, handler) {
  9218. removeEventListener(this, type, handler);
  9219. }
  9220. requestAnimationFrame(callback) {
  9221. return this.setTimeout(() => {
  9222. callback(Date.now());
  9223. }, 0);
  9224. }
  9225. requestIdleCallback(callback) {
  9226. return this.setTimeout(() => {
  9227. callback({
  9228. didTimeout: false,
  9229. timeRemaining: () => 0
  9230. });
  9231. }, 0);
  9232. }
  9233. scroll(_x, _y) {
  9234. }
  9235. scrollBy(_x, _y) {
  9236. }
  9237. scrollTo(_x, _y) {
  9238. }
  9239. get self() {
  9240. return this;
  9241. }
  9242. get sessionStorage() {
  9243. if (this.__sessionStorage == null) {
  9244. this.__sessionStorage = new MockStorage();
  9245. }
  9246. return this.__sessionStorage;
  9247. }
  9248. set sessionStorage(locStorage) {
  9249. this.__sessionStorage = locStorage;
  9250. }
  9251. setInterval(callback, ms, ...args) {
  9252. if (this.__timeouts == null) {
  9253. this.__timeouts = /* @__PURE__ */ new Set();
  9254. }
  9255. ms = Math.min(ms, this.__maxTimeout);
  9256. if (this.__allowInterval) {
  9257. const intervalId = this.__setInterval(() => {
  9258. if (this.__timeouts) {
  9259. this.__timeouts.delete(intervalId);
  9260. try {
  9261. callback(...args);
  9262. } catch (e2) {
  9263. if (this.console) {
  9264. this.console.error(e2);
  9265. } else {
  9266. console.error(e2);
  9267. }
  9268. }
  9269. }
  9270. }, ms);
  9271. if (this.__timeouts) {
  9272. this.__timeouts.add(intervalId);
  9273. }
  9274. return intervalId;
  9275. }
  9276. const timeoutId = this.__setTimeout.call(
  9277. nativeWindow || this,
  9278. () => {
  9279. if (this.__timeouts) {
  9280. this.__timeouts.delete(timeoutId);
  9281. try {
  9282. callback(...args);
  9283. } catch (e2) {
  9284. if (this.console) {
  9285. this.console.error(e2);
  9286. } else {
  9287. console.error(e2);
  9288. }
  9289. }
  9290. }
  9291. },
  9292. ms
  9293. );
  9294. if (this.__timeouts) {
  9295. this.__timeouts.add(timeoutId);
  9296. }
  9297. return timeoutId;
  9298. }
  9299. setTimeout(callback, ms, ...args) {
  9300. if (this.__timeouts == null) {
  9301. this.__timeouts = /* @__PURE__ */ new Set();
  9302. }
  9303. ms = Math.min(ms, this.__maxTimeout);
  9304. const timeoutId = this.__setTimeout.call(
  9305. nativeWindow || this,
  9306. () => {
  9307. if (this.__timeouts) {
  9308. this.__timeouts.delete(timeoutId);
  9309. try {
  9310. callback(...args);
  9311. } catch (e2) {
  9312. if (this.console) {
  9313. this.console.error(e2);
  9314. } else {
  9315. console.error(e2);
  9316. }
  9317. }
  9318. }
  9319. },
  9320. ms
  9321. );
  9322. if (this.__timeouts) {
  9323. this.__timeouts.add(timeoutId);
  9324. }
  9325. return timeoutId;
  9326. }
  9327. get top() {
  9328. return this;
  9329. }
  9330. get window() {
  9331. return this;
  9332. }
  9333. onanimationstart() {
  9334. }
  9335. onanimationend() {
  9336. }
  9337. onanimationiteration() {
  9338. }
  9339. onabort() {
  9340. }
  9341. onauxclick() {
  9342. }
  9343. onbeforecopy() {
  9344. }
  9345. onbeforecut() {
  9346. }
  9347. onbeforepaste() {
  9348. }
  9349. onblur() {
  9350. }
  9351. oncancel() {
  9352. }
  9353. oncanplay() {
  9354. }
  9355. oncanplaythrough() {
  9356. }
  9357. onchange() {
  9358. }
  9359. onclick() {
  9360. }
  9361. onclose() {
  9362. }
  9363. oncontextmenu() {
  9364. }
  9365. oncopy() {
  9366. }
  9367. oncuechange() {
  9368. }
  9369. oncut() {
  9370. }
  9371. ondblclick() {
  9372. }
  9373. ondrag() {
  9374. }
  9375. ondragend() {
  9376. }
  9377. ondragenter() {
  9378. }
  9379. ondragleave() {
  9380. }
  9381. ondragover() {
  9382. }
  9383. ondragstart() {
  9384. }
  9385. ondrop() {
  9386. }
  9387. ondurationchange() {
  9388. }
  9389. onemptied() {
  9390. }
  9391. onended() {
  9392. }
  9393. onerror() {
  9394. }
  9395. onfocus() {
  9396. }
  9397. onfocusin() {
  9398. }
  9399. onfocusout() {
  9400. }
  9401. onformdata() {
  9402. }
  9403. onfullscreenchange() {
  9404. }
  9405. onfullscreenerror() {
  9406. }
  9407. ongotpointercapture() {
  9408. }
  9409. oninput() {
  9410. }
  9411. oninvalid() {
  9412. }
  9413. onkeydown() {
  9414. }
  9415. onkeypress() {
  9416. }
  9417. onkeyup() {
  9418. }
  9419. onload() {
  9420. }
  9421. onloadeddata() {
  9422. }
  9423. onloadedmetadata() {
  9424. }
  9425. onloadstart() {
  9426. }
  9427. onlostpointercapture() {
  9428. }
  9429. onmousedown() {
  9430. }
  9431. onmouseenter() {
  9432. }
  9433. onmouseleave() {
  9434. }
  9435. onmousemove() {
  9436. }
  9437. onmouseout() {
  9438. }
  9439. onmouseover() {
  9440. }
  9441. onmouseup() {
  9442. }
  9443. onmousewheel() {
  9444. }
  9445. onpaste() {
  9446. }
  9447. onpause() {
  9448. }
  9449. onplay() {
  9450. }
  9451. onplaying() {
  9452. }
  9453. onpointercancel() {
  9454. }
  9455. onpointerdown() {
  9456. }
  9457. onpointerenter() {
  9458. }
  9459. onpointerleave() {
  9460. }
  9461. onpointermove() {
  9462. }
  9463. onpointerout() {
  9464. }
  9465. onpointerover() {
  9466. }
  9467. onpointerup() {
  9468. }
  9469. onprogress() {
  9470. }
  9471. onratechange() {
  9472. }
  9473. onreset() {
  9474. }
  9475. onresize() {
  9476. }
  9477. onscroll() {
  9478. }
  9479. onsearch() {
  9480. }
  9481. onseeked() {
  9482. }
  9483. onseeking() {
  9484. }
  9485. onselect() {
  9486. }
  9487. onselectstart() {
  9488. }
  9489. onstalled() {
  9490. }
  9491. onsubmit() {
  9492. }
  9493. onsuspend() {
  9494. }
  9495. ontimeupdate() {
  9496. }
  9497. ontoggle() {
  9498. }
  9499. onvolumechange() {
  9500. }
  9501. onwaiting() {
  9502. }
  9503. onwebkitfullscreenchange() {
  9504. }
  9505. onwebkitfullscreenerror() {
  9506. }
  9507. onwheel() {
  9508. }
  9509. };
  9510. addGlobalsToWindowPrototype(MockWindow.prototype);
  9511. function resetWindowDefaults(win) {
  9512. win.__clearInterval = nativeClearInterval;
  9513. win.__clearTimeout = nativeClearTimeout;
  9514. win.__setInterval = nativeSetInterval;
  9515. win.__setTimeout = nativeSetTimeout;
  9516. win.__maxTimeout = 3e4;
  9517. win.__allowInterval = true;
  9518. win.URL = nativeURL;
  9519. }
  9520. function cloneWindow(srcWin, opts = {}) {
  9521. if (srcWin == null) {
  9522. return null;
  9523. }
  9524. const clonedWin = new MockWindow(false);
  9525. if (!opts.customElementProxy) {
  9526. srcWin.customElements = null;
  9527. }
  9528. if (srcWin.document != null) {
  9529. const clonedDoc = new MockDocument(false, clonedWin);
  9530. clonedWin.document = clonedDoc;
  9531. clonedDoc.documentElement = srcWin.document.documentElement.cloneNode(true);
  9532. } else {
  9533. clonedWin.document = new MockDocument(null, clonedWin);
  9534. }
  9535. return clonedWin;
  9536. }
  9537. function cloneDocument(srcDoc) {
  9538. if (srcDoc == null || !srcDoc.defaultView) {
  9539. return null;
  9540. }
  9541. const dstWin = cloneWindow(srcDoc.defaultView);
  9542. return (dstWin == null ? void 0 : dstWin.document) || null;
  9543. }
  9544. function constrainTimeouts(win) {
  9545. win.__allowInterval = false;
  9546. win.__maxTimeout = 0;
  9547. }
  9548. function resetWindow(win) {
  9549. if (win != null) {
  9550. if (win.__timeouts) {
  9551. win.__timeouts.forEach((timeoutId) => {
  9552. nativeClearInterval(timeoutId);
  9553. nativeClearTimeout(timeoutId);
  9554. });
  9555. win.__timeouts.clear();
  9556. }
  9557. if (win.customElements && win.customElements.clear) {
  9558. win.customElements.clear();
  9559. }
  9560. resetDocument(win.document);
  9561. resetPerformance(win.performance);
  9562. for (const key in win) {
  9563. if (win.hasOwnProperty(key) && key !== "document" && key !== "performance" && key !== "customElements") {
  9564. delete win[key];
  9565. }
  9566. }
  9567. resetWindowDefaults(win);
  9568. resetWindowDimensions(win);
  9569. resetEventListeners(win);
  9570. if (win.document != null) {
  9571. try {
  9572. win.document.defaultView = win;
  9573. } catch (e2) {
  9574. }
  9575. }
  9576. win.fetch = null;
  9577. win.Headers = null;
  9578. win.Request = null;
  9579. win.Response = null;
  9580. win.FetchError = null;
  9581. }
  9582. }
  9583. function resetWindowDimensions(win) {
  9584. try {
  9585. win.devicePixelRatio = 1;
  9586. win.innerHeight = 768;
  9587. win.innerWidth = 1366;
  9588. win.pageXOffset = 0;
  9589. win.pageYOffset = 0;
  9590. win.screenLeft = 0;
  9591. win.screenTop = 0;
  9592. win.screenX = 0;
  9593. win.screenY = 0;
  9594. win.scrollX = 0;
  9595. win.scrollY = 0;
  9596. win.screen = {
  9597. availHeight: win.innerHeight,
  9598. availLeft: 0,
  9599. availTop: 0,
  9600. availWidth: win.innerWidth,
  9601. colorDepth: 24,
  9602. height: win.innerHeight,
  9603. keepAwake: false,
  9604. orientation: {
  9605. angle: 0,
  9606. type: "portrait-primary"
  9607. },
  9608. pixelDepth: 24,
  9609. width: win.innerWidth
  9610. };
  9611. } catch (e2) {
  9612. }
  9613. }
  9614. // src/mock-doc/document.ts
  9615. var MockDocument = class _MockDocument extends MockHTMLElement {
  9616. constructor(html = null, win = null) {
  9617. super(null, null);
  9618. this.nodeName = "#document" /* DOCUMENT_NODE */;
  9619. this.nodeType = 9 /* DOCUMENT_NODE */;
  9620. this.defaultView = win;
  9621. this.cookie = "";
  9622. this.referrer = "";
  9623. this.appendChild(this.createDocumentTypeNode());
  9624. if (typeof html === "string") {
  9625. const parsedDoc = parseDocumentUtil(this, html);
  9626. const documentElement = parsedDoc.children.find((elm) => elm.nodeName === "HTML");
  9627. if (documentElement != null) {
  9628. this.appendChild(documentElement);
  9629. setOwnerDocument(documentElement, this);
  9630. }
  9631. } else if (html !== false) {
  9632. const documentElement = new MockHTMLElement(this, "html");
  9633. this.appendChild(documentElement);
  9634. documentElement.appendChild(new MockHTMLElement(this, "head"));
  9635. documentElement.appendChild(new MockHTMLElement(this, "body"));
  9636. }
  9637. }
  9638. get dir() {
  9639. return this.documentElement.dir;
  9640. }
  9641. set dir(value) {
  9642. this.documentElement.dir = value;
  9643. }
  9644. get localName() {
  9645. throw new Error("Unimplemented");
  9646. }
  9647. get location() {
  9648. if (this.defaultView != null) {
  9649. return this.defaultView.location;
  9650. }
  9651. return null;
  9652. }
  9653. set location(val) {
  9654. if (this.defaultView != null) {
  9655. this.defaultView.location = val;
  9656. }
  9657. }
  9658. get baseURI() {
  9659. const baseNode = this.head.childNodes.find((node) => node.nodeName === "BASE");
  9660. if (baseNode) {
  9661. return baseNode.href;
  9662. }
  9663. return this.URL;
  9664. }
  9665. get URL() {
  9666. return this.location.href;
  9667. }
  9668. get styleSheets() {
  9669. return this.querySelectorAll("style");
  9670. }
  9671. get scripts() {
  9672. return this.querySelectorAll("script");
  9673. }
  9674. get forms() {
  9675. return this.querySelectorAll("form");
  9676. }
  9677. get images() {
  9678. return this.querySelectorAll("img");
  9679. }
  9680. get scrollingElement() {
  9681. return this.documentElement;
  9682. }
  9683. get documentElement() {
  9684. for (let i = this.childNodes.length - 1; i >= 0; i--) {
  9685. if (this.childNodes[i].nodeName === "HTML") {
  9686. return this.childNodes[i];
  9687. }
  9688. }
  9689. const documentElement = new MockHTMLElement(this, "html");
  9690. this.appendChild(documentElement);
  9691. return documentElement;
  9692. }
  9693. set documentElement(documentElement) {
  9694. for (let i = this.childNodes.length - 1; i >= 0; i--) {
  9695. if (this.childNodes[i].nodeType !== 10 /* DOCUMENT_TYPE_NODE */) {
  9696. this.childNodes[i].remove();
  9697. }
  9698. }
  9699. if (documentElement != null) {
  9700. this.appendChild(documentElement);
  9701. setOwnerDocument(documentElement, this);
  9702. }
  9703. }
  9704. get head() {
  9705. const documentElement = this.documentElement;
  9706. for (let i = 0; i < documentElement.childNodes.length; i++) {
  9707. if (documentElement.childNodes[i].nodeName === "HEAD") {
  9708. return documentElement.childNodes[i];
  9709. }
  9710. }
  9711. const head = new MockHTMLElement(this, "head");
  9712. documentElement.insertBefore(head, documentElement.firstChild);
  9713. return head;
  9714. }
  9715. set head(head) {
  9716. const documentElement = this.documentElement;
  9717. for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
  9718. if (documentElement.childNodes[i].nodeName === "HEAD") {
  9719. documentElement.childNodes[i].remove();
  9720. }
  9721. }
  9722. if (head != null) {
  9723. documentElement.insertBefore(head, documentElement.firstChild);
  9724. setOwnerDocument(head, this);
  9725. }
  9726. }
  9727. get body() {
  9728. const documentElement = this.documentElement;
  9729. for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
  9730. if (documentElement.childNodes[i].nodeName === "BODY") {
  9731. return documentElement.childNodes[i];
  9732. }
  9733. }
  9734. const body = new MockHTMLElement(this, "body");
  9735. documentElement.appendChild(body);
  9736. return body;
  9737. }
  9738. set body(body) {
  9739. const documentElement = this.documentElement;
  9740. for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
  9741. if (documentElement.childNodes[i].nodeName === "BODY") {
  9742. documentElement.childNodes[i].remove();
  9743. }
  9744. }
  9745. if (body != null) {
  9746. documentElement.appendChild(body);
  9747. setOwnerDocument(body, this);
  9748. }
  9749. }
  9750. appendChild(newNode) {
  9751. newNode.remove();
  9752. newNode.parentNode = this;
  9753. this.childNodes.push(newNode);
  9754. return newNode;
  9755. }
  9756. createComment(data) {
  9757. return new MockComment(this, data);
  9758. }
  9759. createAttribute(attrName) {
  9760. return new MockAttr(attrName.toLowerCase(), "");
  9761. }
  9762. createAttributeNS(namespaceURI, attrName) {
  9763. return new MockAttr(attrName, "", namespaceURI);
  9764. }
  9765. createElement(tagName) {
  9766. if (tagName === "#document" /* DOCUMENT_NODE */) {
  9767. const doc = new _MockDocument(false);
  9768. doc.nodeName = tagName;
  9769. doc.parentNode = null;
  9770. return doc;
  9771. }
  9772. return createElement(this, tagName);
  9773. }
  9774. createElementNS(namespaceURI, tagName) {
  9775. const elmNs = createElementNS(this, namespaceURI, tagName);
  9776. return elmNs;
  9777. }
  9778. createTextNode(text) {
  9779. return new MockTextNode(this, text);
  9780. }
  9781. createDocumentFragment() {
  9782. return new MockDocumentFragment(this);
  9783. }
  9784. createDocumentTypeNode() {
  9785. return new MockDocumentTypeNode(this);
  9786. }
  9787. getElementById(id) {
  9788. return getElementById(this, id);
  9789. }
  9790. getElementsByName(elmName) {
  9791. return getElementsByName(this, elmName.toLowerCase());
  9792. }
  9793. get title() {
  9794. const title = this.head.childNodes.find((elm) => elm.nodeName === "TITLE");
  9795. if (title != null && typeof title.textContent === "string") {
  9796. return title.textContent.trim();
  9797. }
  9798. return "";
  9799. }
  9800. set title(value) {
  9801. const head = this.head;
  9802. let title = head.childNodes.find((elm) => elm.nodeName === "TITLE");
  9803. if (title == null) {
  9804. title = this.createElement("title");
  9805. head.appendChild(title);
  9806. }
  9807. title.textContent = value;
  9808. }
  9809. };
  9810. function createDocument(html = null) {
  9811. return new MockWindow(html).document;
  9812. }
  9813. function createFragment(html) {
  9814. return parseHtmlToFragment(html, null);
  9815. }
  9816. function resetDocument(doc) {
  9817. if (doc != null) {
  9818. resetEventListeners(doc);
  9819. const documentElement = doc.documentElement;
  9820. if (documentElement != null) {
  9821. resetElement(documentElement);
  9822. for (let i = 0, ii = documentElement.childNodes.length; i < ii; i++) {
  9823. const childNode = documentElement.childNodes[i];
  9824. resetElement(childNode);
  9825. childNode.childNodes.length = 0;
  9826. }
  9827. }
  9828. for (const key in doc) {
  9829. if (doc.hasOwnProperty(key) && !DOC_KEY_KEEPERS.has(key)) {
  9830. delete doc[key];
  9831. }
  9832. }
  9833. try {
  9834. doc.nodeName = "#document" /* DOCUMENT_NODE */;
  9835. } catch (e2) {
  9836. }
  9837. try {
  9838. doc.nodeType = 9 /* DOCUMENT_NODE */;
  9839. } catch (e2) {
  9840. }
  9841. try {
  9842. doc.cookie = "";
  9843. } catch (e2) {
  9844. }
  9845. try {
  9846. doc.referrer = "";
  9847. } catch (e2) {
  9848. }
  9849. }
  9850. }
  9851. var DOC_KEY_KEEPERS = /* @__PURE__ */ new Set([
  9852. "nodeName",
  9853. "nodeType",
  9854. "nodeValue",
  9855. "ownerDocument",
  9856. "parentNode",
  9857. "childNodes",
  9858. "_shadowRoot"
  9859. ]);
  9860. function getElementById(elm, id) {
  9861. const children = elm.children;
  9862. for (let i = 0, ii = children.length; i < ii; i++) {
  9863. const childElm = children[i];
  9864. if (childElm.id === id) {
  9865. return childElm;
  9866. }
  9867. const childElmFound = getElementById(childElm, id);
  9868. if (childElmFound != null) {
  9869. return childElmFound;
  9870. }
  9871. }
  9872. return null;
  9873. }
  9874. function getElementsByName(elm, elmName, foundElms = []) {
  9875. const children = elm.children;
  9876. for (let i = 0, ii = children.length; i < ii; i++) {
  9877. const childElm = children[i];
  9878. if (childElm.name && childElm.name.toLowerCase() === elmName) {
  9879. foundElms.push(childElm);
  9880. }
  9881. getElementsByName(childElm, elmName, foundElms);
  9882. }
  9883. return foundElms;
  9884. }
  9885. function setOwnerDocument(elm, ownerDocument) {
  9886. for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
  9887. elm.childNodes[i].ownerDocument = ownerDocument;
  9888. if (elm.childNodes[i].nodeType === 1 /* ELEMENT_NODE */) {
  9889. setOwnerDocument(elm.childNodes[i], ownerDocument);
  9890. }
  9891. }
  9892. }