axe.js 1005 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035
  1. /*! axe v4.7.0
  2. * Copyright (c) 2023 Deque Systems, Inc.
  3. *
  4. * Your use of this Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. *
  8. * This entire copyright notice must appear in every copy of this file you
  9. * distribute or in any file that contains substantial portions of this source
  10. * code.
  11. */
  12. (function axeFunction(window) {
  13. var global = window;
  14. var document = window.document;
  15. 'use strict';
  16. function _typeof(obj) {
  17. '@babel/helpers - typeof';
  18. return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(obj) {
  19. return typeof obj;
  20. } : function(obj) {
  21. return obj && 'function' == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
  22. }, _typeof(obj);
  23. }
  24. var axe = axe || {};
  25. axe.version = '4.7.0';
  26. if (typeof define === 'function' && define.amd) {
  27. define('axe-core', [], function() {
  28. return axe;
  29. });
  30. }
  31. if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports && typeof axeFunction.toString === 'function') {
  32. axe.source = '(' + axeFunction.toString() + ')(typeof window === "object" ? window : this);';
  33. module.exports = axe;
  34. }
  35. if (typeof window.getComputedStyle === 'function') {
  36. window.axe = axe;
  37. }
  38. var commons;
  39. function SupportError(error) {
  40. this.name = 'SupportError';
  41. this.cause = error.cause;
  42. this.message = '`'.concat(error.cause, '` - feature unsupported in your environment.');
  43. if (error.ruleId) {
  44. this.ruleId = error.ruleId;
  45. this.message += ' Skipping '.concat(this.ruleId, ' rule.');
  46. }
  47. this.stack = new Error().stack;
  48. }
  49. SupportError.prototype = Object.create(Error.prototype);
  50. SupportError.prototype.constructor = SupportError;
  51. 'use strict';
  52. var _excluded = [ 'node' ], _excluded2 = [ 'variant' ], _excluded3 = [ 'matches' ], _excluded4 = [ 'chromium' ], _excluded5 = [ 'noImplicit' ], _excluded6 = [ 'noPresentational' ], _excluded7 = [ 'node' ], _excluded8 = [ 'nodes' ], _excluded9 = [ 'node' ], _excluded10 = [ 'relatedNodes' ], _excluded11 = [ 'environmentData' ], _excluded12 = [ 'environmentData' ], _excluded13 = [ 'node' ], _excluded14 = [ 'environmentData' ], _excluded15 = [ 'environmentData' ], _excluded16 = [ 'environmentData' ];
  53. function _toArray(arr) {
  54. return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
  55. }
  56. function _defineProperty(obj, key, value) {
  57. key = _toPropertyKey(key);
  58. if (key in obj) {
  59. Object.defineProperty(obj, key, {
  60. value: value,
  61. enumerable: true,
  62. configurable: true,
  63. writable: true
  64. });
  65. } else {
  66. obj[key] = value;
  67. }
  68. return obj;
  69. }
  70. function _inherits(subClass, superClass) {
  71. if (typeof superClass !== 'function' && superClass !== null) {
  72. throw new TypeError('Super expression must either be null or a function');
  73. }
  74. subClass.prototype = Object.create(superClass && superClass.prototype, {
  75. constructor: {
  76. value: subClass,
  77. writable: true,
  78. configurable: true
  79. }
  80. });
  81. Object.defineProperty(subClass, 'prototype', {
  82. writable: false
  83. });
  84. if (superClass) {
  85. _setPrototypeOf(subClass, superClass);
  86. }
  87. }
  88. function _setPrototypeOf(o, p) {
  89. _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  90. o.__proto__ = p;
  91. return o;
  92. };
  93. return _setPrototypeOf(o, p);
  94. }
  95. function _createSuper(Derived) {
  96. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  97. return function _createSuperInternal() {
  98. var Super = _getPrototypeOf(Derived), result;
  99. if (hasNativeReflectConstruct) {
  100. var NewTarget = _getPrototypeOf(this).constructor;
  101. result = Reflect.construct(Super, arguments, NewTarget);
  102. } else {
  103. result = Super.apply(this, arguments);
  104. }
  105. return _possibleConstructorReturn(this, result);
  106. };
  107. }
  108. function _possibleConstructorReturn(self, call) {
  109. if (call && (_typeof(call) === 'object' || typeof call === 'function')) {
  110. return call;
  111. } else if (call !== void 0) {
  112. throw new TypeError('Derived constructors may only return object or undefined');
  113. }
  114. return _assertThisInitialized(self);
  115. }
  116. function _assertThisInitialized(self) {
  117. if (self === void 0) {
  118. throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
  119. }
  120. return self;
  121. }
  122. function _isNativeReflectConstruct() {
  123. if (typeof Reflect === 'undefined' || !Reflect.construct) {
  124. return false;
  125. }
  126. if (Reflect.construct.sham) {
  127. return false;
  128. }
  129. if (typeof Proxy === 'function') {
  130. return true;
  131. }
  132. try {
  133. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
  134. return true;
  135. } catch (e) {
  136. return false;
  137. }
  138. }
  139. function _getPrototypeOf(o) {
  140. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  141. return o.__proto__ || Object.getPrototypeOf(o);
  142. };
  143. return _getPrototypeOf(o);
  144. }
  145. function _objectWithoutProperties(source, excluded) {
  146. if (source == null) {
  147. return {};
  148. }
  149. var target = _objectWithoutPropertiesLoose(source, excluded);
  150. var key, i;
  151. if (Object.getOwnPropertySymbols) {
  152. var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
  153. for (i = 0; i < sourceSymbolKeys.length; i++) {
  154. key = sourceSymbolKeys[i];
  155. if (excluded.indexOf(key) >= 0) {
  156. continue;
  157. }
  158. if (!Object.prototype.propertyIsEnumerable.call(source, key)) {
  159. continue;
  160. }
  161. target[key] = source[key];
  162. }
  163. }
  164. return target;
  165. }
  166. function _objectWithoutPropertiesLoose(source, excluded) {
  167. if (source == null) {
  168. return {};
  169. }
  170. var target = {};
  171. var sourceKeys = Object.keys(source);
  172. var key, i;
  173. for (i = 0; i < sourceKeys.length; i++) {
  174. key = sourceKeys[i];
  175. if (excluded.indexOf(key) >= 0) {
  176. continue;
  177. }
  178. target[key] = source[key];
  179. }
  180. return target;
  181. }
  182. function _toConsumableArray(arr) {
  183. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  184. }
  185. function _nonIterableSpread() {
  186. throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
  187. }
  188. function _iterableToArray(iter) {
  189. if (typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null || iter['@@iterator'] != null) {
  190. return Array.from(iter);
  191. }
  192. }
  193. function _arrayWithoutHoles(arr) {
  194. if (Array.isArray(arr)) {
  195. return _arrayLikeToArray(arr);
  196. }
  197. }
  198. function _extends() {
  199. _extends = Object.assign ? Object.assign.bind() : function(target) {
  200. for (var i = 1; i < arguments.length; i++) {
  201. var source = arguments[i];
  202. for (var key in source) {
  203. if (Object.prototype.hasOwnProperty.call(source, key)) {
  204. target[key] = source[key];
  205. }
  206. }
  207. }
  208. return target;
  209. };
  210. return _extends.apply(this, arguments);
  211. }
  212. function _slicedToArray(arr, i) {
  213. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  214. }
  215. function _nonIterableRest() {
  216. throw new TypeError('Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
  217. }
  218. function _iterableToArrayLimit(arr, i) {
  219. var _i = null == arr ? null : 'undefined' != typeof Symbol && arr[Symbol.iterator] || arr['@@iterator'];
  220. if (null != _i) {
  221. var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1;
  222. try {
  223. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  224. if (Object(_i) !== _i) {
  225. return;
  226. }
  227. _n = !1;
  228. } else {
  229. for (;!(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  230. }
  231. }
  232. } catch (err) {
  233. _d = !0, _e = err;
  234. } finally {
  235. try {
  236. if (!_n && null != _i['return'] && (_r = _i['return'](), Object(_r) !== _r)) {
  237. return;
  238. }
  239. } finally {
  240. if (_d) {
  241. throw _e;
  242. }
  243. }
  244. }
  245. return _arr;
  246. }
  247. }
  248. function _arrayWithHoles(arr) {
  249. if (Array.isArray(arr)) {
  250. return arr;
  251. }
  252. }
  253. function _classCallCheck(instance, Constructor) {
  254. if (!(instance instanceof Constructor)) {
  255. throw new TypeError('Cannot call a class as a function');
  256. }
  257. }
  258. function _defineProperties(target, props) {
  259. for (var i = 0; i < props.length; i++) {
  260. var descriptor = props[i];
  261. descriptor.enumerable = descriptor.enumerable || false;
  262. descriptor.configurable = true;
  263. if ('value' in descriptor) {
  264. descriptor.writable = true;
  265. }
  266. Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
  267. }
  268. }
  269. function _createClass(Constructor, protoProps, staticProps) {
  270. if (protoProps) {
  271. _defineProperties(Constructor.prototype, protoProps);
  272. }
  273. if (staticProps) {
  274. _defineProperties(Constructor, staticProps);
  275. }
  276. Object.defineProperty(Constructor, 'prototype', {
  277. writable: false
  278. });
  279. return Constructor;
  280. }
  281. function _toPropertyKey(arg) {
  282. var key = _toPrimitive(arg, 'string');
  283. return _typeof(key) === 'symbol' ? key : String(key);
  284. }
  285. function _toPrimitive(input, hint) {
  286. if (_typeof(input) !== 'object' || input === null) {
  287. return input;
  288. }
  289. var prim = input[Symbol.toPrimitive];
  290. if (prim !== undefined) {
  291. var res = prim.call(input, hint || 'default');
  292. if (_typeof(res) !== 'object') {
  293. return res;
  294. }
  295. throw new TypeError('@@toPrimitive must return a primitive value.');
  296. }
  297. return (hint === 'string' ? String : Number)(input);
  298. }
  299. function _createForOfIteratorHelper(o, allowArrayLike) {
  300. var it = typeof Symbol !== 'undefined' && o[Symbol.iterator] || o['@@iterator'];
  301. if (!it) {
  302. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === 'number') {
  303. if (it) {
  304. o = it;
  305. }
  306. var i = 0;
  307. var F = function F() {};
  308. return {
  309. s: F,
  310. n: function n() {
  311. if (i >= o.length) {
  312. return {
  313. done: true
  314. };
  315. }
  316. return {
  317. done: false,
  318. value: o[i++]
  319. };
  320. },
  321. e: function e(_e2) {
  322. throw _e2;
  323. },
  324. f: F
  325. };
  326. }
  327. throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
  328. }
  329. var normalCompletion = true, didErr = false, err;
  330. return {
  331. s: function s() {
  332. it = it.call(o);
  333. },
  334. n: function n() {
  335. var step = it.next();
  336. normalCompletion = step.done;
  337. return step;
  338. },
  339. e: function e(_e3) {
  340. didErr = true;
  341. err = _e3;
  342. },
  343. f: function f() {
  344. try {
  345. if (!normalCompletion && it['return'] != null) {
  346. it['return']();
  347. }
  348. } finally {
  349. if (didErr) {
  350. throw err;
  351. }
  352. }
  353. }
  354. };
  355. }
  356. function _unsupportedIterableToArray(o, minLen) {
  357. if (!o) {
  358. return;
  359. }
  360. if (typeof o === 'string') {
  361. return _arrayLikeToArray(o, minLen);
  362. }
  363. var n = Object.prototype.toString.call(o).slice(8, -1);
  364. if (n === 'Object' && o.constructor) {
  365. n = o.constructor.name;
  366. }
  367. if (n === 'Map' || n === 'Set') {
  368. return Array.from(o);
  369. }
  370. if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
  371. return _arrayLikeToArray(o, minLen);
  372. }
  373. }
  374. function _arrayLikeToArray(arr, len) {
  375. if (len == null || len > arr.length) {
  376. len = arr.length;
  377. }
  378. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  379. arr2[i] = arr[i];
  380. }
  381. return arr2;
  382. }
  383. function _typeof(obj) {
  384. '@babel/helpers - typeof';
  385. return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(obj) {
  386. return typeof obj;
  387. } : function(obj) {
  388. return obj && 'function' == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
  389. }, _typeof(obj);
  390. }
  391. (function() {
  392. var __create = Object.create;
  393. var __defProp = Object.defineProperty;
  394. var __getProtoOf = Object.getPrototypeOf;
  395. var __hasOwnProp = Object.prototype.hasOwnProperty;
  396. var __getOwnPropNames = Object.getOwnPropertyNames;
  397. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  398. var __markAsModule = function __markAsModule(target) {
  399. return __defProp(target, '__esModule', {
  400. value: true
  401. });
  402. };
  403. var __commonJS = function __commonJS(cb, mod) {
  404. return function() {
  405. return mod || cb((mod = {
  406. exports: {}
  407. }).exports, mod), mod.exports;
  408. };
  409. };
  410. var __export = function __export(target, all) {
  411. for (var name in all) {
  412. __defProp(target, name, {
  413. get: all[name],
  414. enumerable: true
  415. });
  416. }
  417. };
  418. var __exportStar = function __exportStar(target, module, desc) {
  419. if (module && _typeof(module) === 'object' || typeof module === 'function') {
  420. var _iterator = _createForOfIteratorHelper(__getOwnPropNames(module)), _step;
  421. try {
  422. var _loop = function _loop() {
  423. var key = _step.value;
  424. if (!__hasOwnProp.call(target, key) && key !== 'default') {
  425. __defProp(target, key, {
  426. get: function get() {
  427. return module[key];
  428. },
  429. enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable
  430. });
  431. }
  432. };
  433. for (_iterator.s(); !(_step = _iterator.n()).done; ) {
  434. _loop();
  435. }
  436. } catch (err) {
  437. _iterator.e(err);
  438. } finally {
  439. _iterator.f();
  440. }
  441. }
  442. return target;
  443. };
  444. var __toModule = function __toModule(module) {
  445. return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, 'default', module && module.__esModule && 'default' in module ? {
  446. get: function get() {
  447. return module['default'];
  448. },
  449. enumerable: true
  450. } : {
  451. value: module,
  452. enumerable: true
  453. })), module);
  454. };
  455. var require_utils = __commonJS(function(exports) {
  456. 'use strict';
  457. Object.defineProperty(exports, '__esModule', {
  458. value: true
  459. });
  460. function isIdentStart(c) {
  461. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '-' || c === '_';
  462. }
  463. exports.isIdentStart = isIdentStart;
  464. function isIdent(c) {
  465. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c === '-' || c === '_';
  466. }
  467. exports.isIdent = isIdent;
  468. function isHex(c) {
  469. return c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F' || c >= '0' && c <= '9';
  470. }
  471. exports.isHex = isHex;
  472. function escapeIdentifier(s) {
  473. var len = s.length;
  474. var result = '';
  475. var i = 0;
  476. while (i < len) {
  477. var chr = s.charAt(i);
  478. if (exports.identSpecialChars[chr]) {
  479. result += '\\' + chr;
  480. } else {
  481. if (!(chr === '_' || chr === '-' || chr >= 'A' && chr <= 'Z' || chr >= 'a' && chr <= 'z' || i !== 0 && chr >= '0' && chr <= '9')) {
  482. var charCode = chr.charCodeAt(0);
  483. if ((charCode & 63488) === 55296) {
  484. var extraCharCode = s.charCodeAt(i++);
  485. if ((charCode & 64512) !== 55296 || (extraCharCode & 64512) !== 56320) {
  486. throw Error('UCS-2(decode): illegal sequence');
  487. }
  488. charCode = ((charCode & 1023) << 10) + (extraCharCode & 1023) + 65536;
  489. }
  490. result += '\\' + charCode.toString(16) + ' ';
  491. } else {
  492. result += chr;
  493. }
  494. }
  495. i++;
  496. }
  497. return result;
  498. }
  499. exports.escapeIdentifier = escapeIdentifier;
  500. function escapeStr(s) {
  501. var len = s.length;
  502. var result = '';
  503. var i = 0;
  504. var replacement;
  505. while (i < len) {
  506. var chr = s.charAt(i);
  507. if (chr === '"') {
  508. chr = '\\"';
  509. } else if (chr === '\\') {
  510. chr = '\\\\';
  511. } else if ((replacement = exports.strReplacementsRev[chr]) !== void 0) {
  512. chr = replacement;
  513. }
  514. result += chr;
  515. i++;
  516. }
  517. return '"' + result + '"';
  518. }
  519. exports.escapeStr = escapeStr;
  520. exports.identSpecialChars = {
  521. '!': true,
  522. '"': true,
  523. '#': true,
  524. $: true,
  525. '%': true,
  526. '&': true,
  527. '\'': true,
  528. '(': true,
  529. ')': true,
  530. '*': true,
  531. '+': true,
  532. ',': true,
  533. '.': true,
  534. '/': true,
  535. ';': true,
  536. '<': true,
  537. '=': true,
  538. '>': true,
  539. '?': true,
  540. '@': true,
  541. '[': true,
  542. '\\': true,
  543. ']': true,
  544. '^': true,
  545. '`': true,
  546. '{': true,
  547. '|': true,
  548. '}': true,
  549. '~': true
  550. };
  551. exports.strReplacementsRev = {
  552. '\n': '\\n',
  553. '\r': '\\r',
  554. '\t': '\\t',
  555. '\f': '\\f',
  556. '\v': '\\v'
  557. };
  558. exports.singleQuoteEscapeChars = {
  559. n: '\n',
  560. r: '\r',
  561. t: '\t',
  562. f: '\f',
  563. '\\': '\\',
  564. '\'': '\''
  565. };
  566. exports.doubleQuotesEscapeChars = {
  567. n: '\n',
  568. r: '\r',
  569. t: '\t',
  570. f: '\f',
  571. '\\': '\\',
  572. '"': '"'
  573. };
  574. });
  575. var require_parser_context = __commonJS(function(exports) {
  576. 'use strict';
  577. Object.defineProperty(exports, '__esModule', {
  578. value: true
  579. });
  580. var utils_1 = require_utils();
  581. function parseCssSelector(str, pos, pseudos, attrEqualityMods, ruleNestingOperators, substitutesEnabled) {
  582. var l = str.length;
  583. var chr = '';
  584. function getStr(quote, escapeTable) {
  585. var result = '';
  586. pos++;
  587. chr = str.charAt(pos);
  588. while (pos < l) {
  589. if (chr === quote) {
  590. pos++;
  591. return result;
  592. } else if (chr === '\\') {
  593. pos++;
  594. chr = str.charAt(pos);
  595. var esc = void 0;
  596. if (chr === quote) {
  597. result += quote;
  598. } else if ((esc = escapeTable[chr]) !== void 0) {
  599. result += esc;
  600. } else if (utils_1.isHex(chr)) {
  601. var hex = chr;
  602. pos++;
  603. chr = str.charAt(pos);
  604. while (utils_1.isHex(chr)) {
  605. hex += chr;
  606. pos++;
  607. chr = str.charAt(pos);
  608. }
  609. if (chr === ' ') {
  610. pos++;
  611. chr = str.charAt(pos);
  612. }
  613. result += String.fromCharCode(parseInt(hex, 16));
  614. continue;
  615. } else {
  616. result += chr;
  617. }
  618. } else {
  619. result += chr;
  620. }
  621. pos++;
  622. chr = str.charAt(pos);
  623. }
  624. return result;
  625. }
  626. function getIdent() {
  627. var result = '';
  628. chr = str.charAt(pos);
  629. while (pos < l) {
  630. if (utils_1.isIdent(chr)) {
  631. result += chr;
  632. } else if (chr === '\\') {
  633. pos++;
  634. if (pos >= l) {
  635. throw Error('Expected symbol but end of file reached.');
  636. }
  637. chr = str.charAt(pos);
  638. if (utils_1.identSpecialChars[chr]) {
  639. result += chr;
  640. } else if (utils_1.isHex(chr)) {
  641. var hex = chr;
  642. pos++;
  643. chr = str.charAt(pos);
  644. while (utils_1.isHex(chr)) {
  645. hex += chr;
  646. pos++;
  647. chr = str.charAt(pos);
  648. }
  649. if (chr === ' ') {
  650. pos++;
  651. chr = str.charAt(pos);
  652. }
  653. result += String.fromCharCode(parseInt(hex, 16));
  654. continue;
  655. } else {
  656. result += chr;
  657. }
  658. } else {
  659. return result;
  660. }
  661. pos++;
  662. chr = str.charAt(pos);
  663. }
  664. return result;
  665. }
  666. function skipWhitespace() {
  667. chr = str.charAt(pos);
  668. var result = false;
  669. while (chr === ' ' || chr === '\t' || chr === '\n' || chr === '\r' || chr === '\f') {
  670. result = true;
  671. pos++;
  672. chr = str.charAt(pos);
  673. }
  674. return result;
  675. }
  676. function parse2() {
  677. var res = parseSelector();
  678. if (pos < l) {
  679. throw Error('Rule expected but "' + str.charAt(pos) + '" found.');
  680. }
  681. return res;
  682. }
  683. function parseSelector() {
  684. var selector = parseSingleSelector();
  685. if (!selector) {
  686. return null;
  687. }
  688. var res = selector;
  689. chr = str.charAt(pos);
  690. while (chr === ',') {
  691. pos++;
  692. skipWhitespace();
  693. if (res.type !== 'selectors') {
  694. res = {
  695. type: 'selectors',
  696. selectors: [ selector ]
  697. };
  698. }
  699. selector = parseSingleSelector();
  700. if (!selector) {
  701. throw Error('Rule expected after ",".');
  702. }
  703. res.selectors.push(selector);
  704. }
  705. return res;
  706. }
  707. function parseSingleSelector() {
  708. skipWhitespace();
  709. var selector = {
  710. type: 'ruleSet'
  711. };
  712. var rule = parseRule();
  713. if (!rule) {
  714. return null;
  715. }
  716. var currentRule = selector;
  717. while (rule) {
  718. rule.type = 'rule';
  719. currentRule.rule = rule;
  720. currentRule = rule;
  721. skipWhitespace();
  722. chr = str.charAt(pos);
  723. if (pos >= l || chr === ',' || chr === ')') {
  724. break;
  725. }
  726. if (ruleNestingOperators[chr]) {
  727. var op = chr;
  728. pos++;
  729. skipWhitespace();
  730. rule = parseRule();
  731. if (!rule) {
  732. throw Error('Rule expected after "' + op + '".');
  733. }
  734. rule.nestingOperator = op;
  735. } else {
  736. rule = parseRule();
  737. if (rule) {
  738. rule.nestingOperator = null;
  739. }
  740. }
  741. }
  742. return selector;
  743. }
  744. function parseRule() {
  745. var rule = null;
  746. while (pos < l) {
  747. chr = str.charAt(pos);
  748. if (chr === '*') {
  749. pos++;
  750. (rule = rule || {}).tagName = '*';
  751. } else if (utils_1.isIdentStart(chr) || chr === '\\') {
  752. (rule = rule || {}).tagName = getIdent();
  753. } else if (chr === '.') {
  754. pos++;
  755. rule = rule || {};
  756. (rule.classNames = rule.classNames || []).push(getIdent());
  757. } else if (chr === '#') {
  758. pos++;
  759. (rule = rule || {}).id = getIdent();
  760. } else if (chr === '[') {
  761. pos++;
  762. skipWhitespace();
  763. var attr = {
  764. name: getIdent()
  765. };
  766. skipWhitespace();
  767. if (chr === ']') {
  768. pos++;
  769. } else {
  770. var operator = '';
  771. if (attrEqualityMods[chr]) {
  772. operator = chr;
  773. pos++;
  774. chr = str.charAt(pos);
  775. }
  776. if (pos >= l) {
  777. throw Error('Expected "=" but end of file reached.');
  778. }
  779. if (chr !== '=') {
  780. throw Error('Expected "=" but "' + chr + '" found.');
  781. }
  782. attr.operator = operator + '=';
  783. pos++;
  784. skipWhitespace();
  785. var attrValue = '';
  786. attr.valueType = 'string';
  787. if (chr === '"') {
  788. attrValue = getStr('"', utils_1.doubleQuotesEscapeChars);
  789. } else if (chr === '\'') {
  790. attrValue = getStr('\'', utils_1.singleQuoteEscapeChars);
  791. } else if (substitutesEnabled && chr === '$') {
  792. pos++;
  793. attrValue = getIdent();
  794. attr.valueType = 'substitute';
  795. } else {
  796. while (pos < l) {
  797. if (chr === ']') {
  798. break;
  799. }
  800. attrValue += chr;
  801. pos++;
  802. chr = str.charAt(pos);
  803. }
  804. attrValue = attrValue.trim();
  805. }
  806. skipWhitespace();
  807. if (pos >= l) {
  808. throw Error('Expected "]" but end of file reached.');
  809. }
  810. if (chr !== ']') {
  811. throw Error('Expected "]" but "' + chr + '" found.');
  812. }
  813. pos++;
  814. attr.value = attrValue;
  815. }
  816. rule = rule || {};
  817. (rule.attrs = rule.attrs || []).push(attr);
  818. } else if (chr === ':') {
  819. pos++;
  820. var pseudoName = getIdent();
  821. var pseudo = {
  822. name: pseudoName
  823. };
  824. if (chr === '(') {
  825. pos++;
  826. var value = '';
  827. skipWhitespace();
  828. if (pseudos[pseudoName] === 'selector') {
  829. pseudo.valueType = 'selector';
  830. value = parseSelector();
  831. } else {
  832. pseudo.valueType = pseudos[pseudoName] || 'string';
  833. if (chr === '"') {
  834. value = getStr('"', utils_1.doubleQuotesEscapeChars);
  835. } else if (chr === '\'') {
  836. value = getStr('\'', utils_1.singleQuoteEscapeChars);
  837. } else if (substitutesEnabled && chr === '$') {
  838. pos++;
  839. value = getIdent();
  840. pseudo.valueType = 'substitute';
  841. } else {
  842. while (pos < l) {
  843. if (chr === ')') {
  844. break;
  845. }
  846. value += chr;
  847. pos++;
  848. chr = str.charAt(pos);
  849. }
  850. value = value.trim();
  851. }
  852. skipWhitespace();
  853. }
  854. if (pos >= l) {
  855. throw Error('Expected ")" but end of file reached.');
  856. }
  857. if (chr !== ')') {
  858. throw Error('Expected ")" but "' + chr + '" found.');
  859. }
  860. pos++;
  861. pseudo.value = value;
  862. }
  863. rule = rule || {};
  864. (rule.pseudos = rule.pseudos || []).push(pseudo);
  865. } else {
  866. break;
  867. }
  868. }
  869. return rule;
  870. }
  871. return parse2();
  872. }
  873. exports.parseCssSelector = parseCssSelector;
  874. });
  875. var require_render = __commonJS(function(exports) {
  876. 'use strict';
  877. Object.defineProperty(exports, '__esModule', {
  878. value: true
  879. });
  880. var utils_1 = require_utils();
  881. function renderEntity(entity) {
  882. var res = '';
  883. switch (entity.type) {
  884. case 'ruleSet':
  885. var currentEntity = entity.rule;
  886. var parts = [];
  887. while (currentEntity) {
  888. if (currentEntity.nestingOperator) {
  889. parts.push(currentEntity.nestingOperator);
  890. }
  891. parts.push(renderEntity(currentEntity));
  892. currentEntity = currentEntity.rule;
  893. }
  894. res = parts.join(' ');
  895. break;
  896. case 'selectors':
  897. res = entity.selectors.map(renderEntity).join(', ');
  898. break;
  899. case 'rule':
  900. if (entity.tagName) {
  901. if (entity.tagName === '*') {
  902. res = '*';
  903. } else {
  904. res = utils_1.escapeIdentifier(entity.tagName);
  905. }
  906. }
  907. if (entity.id) {
  908. res += '#' + utils_1.escapeIdentifier(entity.id);
  909. }
  910. if (entity.classNames) {
  911. res += entity.classNames.map(function(cn) {
  912. return '.' + utils_1.escapeIdentifier(cn);
  913. }).join('');
  914. }
  915. if (entity.attrs) {
  916. res += entity.attrs.map(function(attr) {
  917. if ('operator' in attr) {
  918. if (attr.valueType === 'substitute') {
  919. return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + '$' + attr.value + ']';
  920. } else {
  921. return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + utils_1.escapeStr(attr.value) + ']';
  922. }
  923. } else {
  924. return '[' + utils_1.escapeIdentifier(attr.name) + ']';
  925. }
  926. }).join('');
  927. }
  928. if (entity.pseudos) {
  929. res += entity.pseudos.map(function(pseudo) {
  930. if (pseudo.valueType) {
  931. if (pseudo.valueType === 'selector') {
  932. return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + renderEntity(pseudo.value) + ')';
  933. } else if (pseudo.valueType === 'substitute') {
  934. return ':' + utils_1.escapeIdentifier(pseudo.name) + '($' + pseudo.value + ')';
  935. } else if (pseudo.valueType === 'numeric') {
  936. return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + pseudo.value + ')';
  937. } else {
  938. return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + utils_1.escapeIdentifier(pseudo.value) + ')';
  939. }
  940. } else {
  941. return ':' + utils_1.escapeIdentifier(pseudo.name);
  942. }
  943. }).join('');
  944. }
  945. break;
  946. default:
  947. throw Error('Unknown entity type: "' + entity.type + '".');
  948. }
  949. return res;
  950. }
  951. exports.renderEntity = renderEntity;
  952. });
  953. var require_lib = __commonJS(function(exports) {
  954. 'use strict';
  955. Object.defineProperty(exports, '__esModule', {
  956. value: true
  957. });
  958. var parser_context_1 = require_parser_context();
  959. var render_1 = require_render();
  960. var CssSelectorParser3 = function() {
  961. function CssSelectorParser4() {
  962. this.pseudos = {};
  963. this.attrEqualityMods = {};
  964. this.ruleNestingOperators = {};
  965. this.substitutesEnabled = false;
  966. }
  967. CssSelectorParser4.prototype.registerSelectorPseudos = function() {
  968. var pseudos = [];
  969. for (var _i = 0; _i < arguments.length; _i++) {
  970. pseudos[_i] = arguments[_i];
  971. }
  972. for (var _a = 0, pseudos_1 = pseudos; _a < pseudos_1.length; _a++) {
  973. var pseudo = pseudos_1[_a];
  974. this.pseudos[pseudo] = 'selector';
  975. }
  976. return this;
  977. };
  978. CssSelectorParser4.prototype.unregisterSelectorPseudos = function() {
  979. var pseudos = [];
  980. for (var _i = 0; _i < arguments.length; _i++) {
  981. pseudos[_i] = arguments[_i];
  982. }
  983. for (var _a = 0, pseudos_2 = pseudos; _a < pseudos_2.length; _a++) {
  984. var pseudo = pseudos_2[_a];
  985. delete this.pseudos[pseudo];
  986. }
  987. return this;
  988. };
  989. CssSelectorParser4.prototype.registerNumericPseudos = function() {
  990. var pseudos = [];
  991. for (var _i = 0; _i < arguments.length; _i++) {
  992. pseudos[_i] = arguments[_i];
  993. }
  994. for (var _a = 0, pseudos_3 = pseudos; _a < pseudos_3.length; _a++) {
  995. var pseudo = pseudos_3[_a];
  996. this.pseudos[pseudo] = 'numeric';
  997. }
  998. return this;
  999. };
  1000. CssSelectorParser4.prototype.unregisterNumericPseudos = function() {
  1001. var pseudos = [];
  1002. for (var _i = 0; _i < arguments.length; _i++) {
  1003. pseudos[_i] = arguments[_i];
  1004. }
  1005. for (var _a = 0, pseudos_4 = pseudos; _a < pseudos_4.length; _a++) {
  1006. var pseudo = pseudos_4[_a];
  1007. delete this.pseudos[pseudo];
  1008. }
  1009. return this;
  1010. };
  1011. CssSelectorParser4.prototype.registerNestingOperators = function() {
  1012. var operators = [];
  1013. for (var _i = 0; _i < arguments.length; _i++) {
  1014. operators[_i] = arguments[_i];
  1015. }
  1016. for (var _a = 0, operators_1 = operators; _a < operators_1.length; _a++) {
  1017. var operator = operators_1[_a];
  1018. this.ruleNestingOperators[operator] = true;
  1019. }
  1020. return this;
  1021. };
  1022. CssSelectorParser4.prototype.unregisterNestingOperators = function() {
  1023. var operators = [];
  1024. for (var _i = 0; _i < arguments.length; _i++) {
  1025. operators[_i] = arguments[_i];
  1026. }
  1027. for (var _a = 0, operators_2 = operators; _a < operators_2.length; _a++) {
  1028. var operator = operators_2[_a];
  1029. delete this.ruleNestingOperators[operator];
  1030. }
  1031. return this;
  1032. };
  1033. CssSelectorParser4.prototype.registerAttrEqualityMods = function() {
  1034. var mods = [];
  1035. for (var _i = 0; _i < arguments.length; _i++) {
  1036. mods[_i] = arguments[_i];
  1037. }
  1038. for (var _a = 0, mods_1 = mods; _a < mods_1.length; _a++) {
  1039. var mod = mods_1[_a];
  1040. this.attrEqualityMods[mod] = true;
  1041. }
  1042. return this;
  1043. };
  1044. CssSelectorParser4.prototype.unregisterAttrEqualityMods = function() {
  1045. var mods = [];
  1046. for (var _i = 0; _i < arguments.length; _i++) {
  1047. mods[_i] = arguments[_i];
  1048. }
  1049. for (var _a = 0, mods_2 = mods; _a < mods_2.length; _a++) {
  1050. var mod = mods_2[_a];
  1051. delete this.attrEqualityMods[mod];
  1052. }
  1053. return this;
  1054. };
  1055. CssSelectorParser4.prototype.enableSubstitutes = function() {
  1056. this.substitutesEnabled = true;
  1057. return this;
  1058. };
  1059. CssSelectorParser4.prototype.disableSubstitutes = function() {
  1060. this.substitutesEnabled = false;
  1061. return this;
  1062. };
  1063. CssSelectorParser4.prototype.parse = function(str) {
  1064. return parser_context_1.parseCssSelector(str, 0, this.pseudos, this.attrEqualityMods, this.ruleNestingOperators, this.substitutesEnabled);
  1065. };
  1066. CssSelectorParser4.prototype.render = function(path) {
  1067. return render_1.renderEntity(path).trim();
  1068. };
  1069. return CssSelectorParser4;
  1070. }();
  1071. exports.CssSelectorParser = CssSelectorParser3;
  1072. });
  1073. var require_noop = __commonJS(function(exports, module) {
  1074. 'use strict';
  1075. module.exports = function() {};
  1076. });
  1077. var require_is_value = __commonJS(function(exports, module) {
  1078. 'use strict';
  1079. var _undefined = require_noop()();
  1080. module.exports = function(val) {
  1081. return val !== _undefined && val !== null;
  1082. };
  1083. });
  1084. var require_normalize_options = __commonJS(function(exports, module) {
  1085. 'use strict';
  1086. var isValue = require_is_value();
  1087. var forEach = Array.prototype.forEach;
  1088. var create = Object.create;
  1089. var process2 = function process2(src, obj) {
  1090. var key;
  1091. for (key in src) {
  1092. obj[key] = src[key];
  1093. }
  1094. };
  1095. module.exports = function(opts1) {
  1096. var result = create(null);
  1097. forEach.call(arguments, function(options) {
  1098. if (!isValue(options)) {
  1099. return;
  1100. }
  1101. process2(Object(options), result);
  1102. });
  1103. return result;
  1104. };
  1105. });
  1106. var require_is_implemented = __commonJS(function(exports, module) {
  1107. 'use strict';
  1108. module.exports = function() {
  1109. var sign = Math.sign;
  1110. if (typeof sign !== 'function') {
  1111. return false;
  1112. }
  1113. return sign(10) === 1 && sign(-20) === -1;
  1114. };
  1115. });
  1116. var require_shim = __commonJS(function(exports, module) {
  1117. 'use strict';
  1118. module.exports = function(value) {
  1119. value = Number(value);
  1120. if (isNaN(value) || value === 0) {
  1121. return value;
  1122. }
  1123. return value > 0 ? 1 : -1;
  1124. };
  1125. });
  1126. var require_sign = __commonJS(function(exports, module) {
  1127. 'use strict';
  1128. module.exports = require_is_implemented()() ? Math.sign : require_shim();
  1129. });
  1130. var require_to_integer = __commonJS(function(exports, module) {
  1131. 'use strict';
  1132. var sign = require_sign();
  1133. var abs = Math.abs;
  1134. var floor = Math.floor;
  1135. module.exports = function(value) {
  1136. if (isNaN(value)) {
  1137. return 0;
  1138. }
  1139. value = Number(value);
  1140. if (value === 0 || !isFinite(value)) {
  1141. return value;
  1142. }
  1143. return sign(value) * floor(abs(value));
  1144. };
  1145. });
  1146. var require_to_pos_integer = __commonJS(function(exports, module) {
  1147. 'use strict';
  1148. var toInteger = require_to_integer();
  1149. var max = Math.max;
  1150. module.exports = function(value) {
  1151. return max(0, toInteger(value));
  1152. };
  1153. });
  1154. var require_resolve_length = __commonJS(function(exports, module) {
  1155. 'use strict';
  1156. var toPosInt = require_to_pos_integer();
  1157. module.exports = function(optsLength, fnLength, isAsync) {
  1158. var length;
  1159. if (isNaN(optsLength)) {
  1160. length = fnLength;
  1161. if (!(length >= 0)) {
  1162. return 1;
  1163. }
  1164. if (isAsync && length) {
  1165. return length - 1;
  1166. }
  1167. return length;
  1168. }
  1169. if (optsLength === false) {
  1170. return false;
  1171. }
  1172. return toPosInt(optsLength);
  1173. };
  1174. });
  1175. var require_valid_callable = __commonJS(function(exports, module) {
  1176. 'use strict';
  1177. module.exports = function(fn) {
  1178. if (typeof fn !== 'function') {
  1179. throw new TypeError(fn + ' is not a function');
  1180. }
  1181. return fn;
  1182. };
  1183. });
  1184. var require_valid_value = __commonJS(function(exports, module) {
  1185. 'use strict';
  1186. var isValue = require_is_value();
  1187. module.exports = function(value) {
  1188. if (!isValue(value)) {
  1189. throw new TypeError('Cannot use null or undefined');
  1190. }
  1191. return value;
  1192. };
  1193. });
  1194. var require_iterate = __commonJS(function(exports, module) {
  1195. 'use strict';
  1196. var callable = require_valid_callable();
  1197. var value = require_valid_value();
  1198. var bind = Function.prototype.bind;
  1199. var call = Function.prototype.call;
  1200. var keys = Object.keys;
  1201. var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
  1202. module.exports = function(method, defVal) {
  1203. return function(obj, cb) {
  1204. var list, thisArg = arguments[2], compareFn = arguments[3];
  1205. obj = Object(value(obj));
  1206. callable(cb);
  1207. list = keys(obj);
  1208. if (compareFn) {
  1209. list.sort(typeof compareFn === 'function' ? bind.call(compareFn, obj) : void 0);
  1210. }
  1211. if (typeof method !== 'function') {
  1212. method = list[method];
  1213. }
  1214. return call.call(method, list, function(key, index) {
  1215. if (!objPropertyIsEnumerable.call(obj, key)) {
  1216. return defVal;
  1217. }
  1218. return call.call(cb, thisArg, obj[key], key, obj, index);
  1219. });
  1220. };
  1221. };
  1222. });
  1223. var require_for_each = __commonJS(function(exports, module) {
  1224. 'use strict';
  1225. module.exports = require_iterate()('forEach');
  1226. });
  1227. var require_registered_extensions = __commonJS(function() {
  1228. 'use strict';
  1229. });
  1230. var require_is_implemented2 = __commonJS(function(exports, module) {
  1231. 'use strict';
  1232. module.exports = function() {
  1233. var assign = Object.assign, obj;
  1234. if (typeof assign !== 'function') {
  1235. return false;
  1236. }
  1237. obj = {
  1238. foo: 'raz'
  1239. };
  1240. assign(obj, {
  1241. bar: 'dwa'
  1242. }, {
  1243. trzy: 'trzy'
  1244. });
  1245. return obj.foo + obj.bar + obj.trzy === 'razdwatrzy';
  1246. };
  1247. });
  1248. var require_is_implemented3 = __commonJS(function(exports, module) {
  1249. 'use strict';
  1250. module.exports = function() {
  1251. try {
  1252. Object.keys('primitive');
  1253. return true;
  1254. } catch (e) {
  1255. return false;
  1256. }
  1257. };
  1258. });
  1259. var require_shim2 = __commonJS(function(exports, module) {
  1260. 'use strict';
  1261. var isValue = require_is_value();
  1262. var keys = Object.keys;
  1263. module.exports = function(object) {
  1264. return keys(isValue(object) ? Object(object) : object);
  1265. };
  1266. });
  1267. var require_keys = __commonJS(function(exports, module) {
  1268. 'use strict';
  1269. module.exports = require_is_implemented3()() ? Object.keys : require_shim2();
  1270. });
  1271. var require_shim3 = __commonJS(function(exports, module) {
  1272. 'use strict';
  1273. var keys = require_keys();
  1274. var value = require_valid_value();
  1275. var max = Math.max;
  1276. module.exports = function(dest, src) {
  1277. var error, i, length = max(arguments.length, 2), assign;
  1278. dest = Object(value(dest));
  1279. assign = function assign(key) {
  1280. try {
  1281. dest[key] = src[key];
  1282. } catch (e) {
  1283. if (!error) {
  1284. error = e;
  1285. }
  1286. }
  1287. };
  1288. for (i = 1; i < length; ++i) {
  1289. src = arguments[i];
  1290. keys(src).forEach(assign);
  1291. }
  1292. if (error !== void 0) {
  1293. throw error;
  1294. }
  1295. return dest;
  1296. };
  1297. });
  1298. var require_assign = __commonJS(function(exports, module) {
  1299. 'use strict';
  1300. module.exports = require_is_implemented2()() ? Object.assign : require_shim3();
  1301. });
  1302. var require_is_object = __commonJS(function(exports, module) {
  1303. 'use strict';
  1304. var isValue = require_is_value();
  1305. var map = {
  1306. function: true,
  1307. object: true
  1308. };
  1309. module.exports = function(value) {
  1310. return isValue(value) && map[_typeof(value)] || false;
  1311. };
  1312. });
  1313. var require_custom = __commonJS(function(exports, module) {
  1314. 'use strict';
  1315. var assign = require_assign();
  1316. var isObject = require_is_object();
  1317. var isValue = require_is_value();
  1318. var captureStackTrace = Error.captureStackTrace;
  1319. module.exports = function(message) {
  1320. var err2 = new Error(message), code = arguments[1], ext = arguments[2];
  1321. if (!isValue(ext)) {
  1322. if (isObject(code)) {
  1323. ext = code;
  1324. code = null;
  1325. }
  1326. }
  1327. if (isValue(ext)) {
  1328. assign(err2, ext);
  1329. }
  1330. if (isValue(code)) {
  1331. err2.code = code;
  1332. }
  1333. if (captureStackTrace) {
  1334. captureStackTrace(err2, module.exports);
  1335. }
  1336. return err2;
  1337. };
  1338. });
  1339. var require_mixin = __commonJS(function(exports, module) {
  1340. 'use strict';
  1341. var value = require_valid_value();
  1342. var defineProperty = Object.defineProperty;
  1343. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1344. var getOwnPropertyNames = Object.getOwnPropertyNames;
  1345. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  1346. module.exports = function(target, source) {
  1347. var error, sourceObject = Object(value(source));
  1348. target = Object(value(target));
  1349. getOwnPropertyNames(sourceObject).forEach(function(name) {
  1350. try {
  1351. defineProperty(target, name, getOwnPropertyDescriptor(source, name));
  1352. } catch (e) {
  1353. error = e;
  1354. }
  1355. });
  1356. if (typeof getOwnPropertySymbols === 'function') {
  1357. getOwnPropertySymbols(sourceObject).forEach(function(symbol) {
  1358. try {
  1359. defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol));
  1360. } catch (e) {
  1361. error = e;
  1362. }
  1363. });
  1364. }
  1365. if (error !== void 0) {
  1366. throw error;
  1367. }
  1368. return target;
  1369. };
  1370. });
  1371. var require_define_length = __commonJS(function(exports, module) {
  1372. 'use strict';
  1373. var toPosInt = require_to_pos_integer();
  1374. var test = function test(arg1, arg2) {
  1375. return arg2;
  1376. };
  1377. var desc;
  1378. var defineProperty;
  1379. var generate;
  1380. var mixin;
  1381. try {
  1382. Object.defineProperty(test, 'length', {
  1383. configurable: true,
  1384. writable: false,
  1385. enumerable: false,
  1386. value: 1
  1387. });
  1388. } catch (ignore) {}
  1389. if (test.length === 1) {
  1390. desc = {
  1391. configurable: true,
  1392. writable: false,
  1393. enumerable: false
  1394. };
  1395. defineProperty = Object.defineProperty;
  1396. module.exports = function(fn, length) {
  1397. length = toPosInt(length);
  1398. if (fn.length === length) {
  1399. return fn;
  1400. }
  1401. desc.value = length;
  1402. return defineProperty(fn, 'length', desc);
  1403. };
  1404. } else {
  1405. mixin = require_mixin();
  1406. generate = function() {
  1407. var cache2 = [];
  1408. return function(length) {
  1409. var args, i = 0;
  1410. if (cache2[length]) {
  1411. return cache2[length];
  1412. }
  1413. args = [];
  1414. while (length--) {
  1415. args.push('a' + (++i).toString(36));
  1416. }
  1417. return new Function('fn', 'return function (' + args.join(', ') + ') { return fn.apply(this, arguments); };');
  1418. };
  1419. }();
  1420. module.exports = function(src, length) {
  1421. var target;
  1422. length = toPosInt(length);
  1423. if (src.length === length) {
  1424. return src;
  1425. }
  1426. target = generate(length)(src);
  1427. try {
  1428. mixin(target, src);
  1429. } catch (ignore) {}
  1430. return target;
  1431. };
  1432. }
  1433. });
  1434. var require_is = __commonJS(function(exports, module) {
  1435. 'use strict';
  1436. var _undefined = void 0;
  1437. module.exports = function(value) {
  1438. return value !== _undefined && value !== null;
  1439. };
  1440. });
  1441. var require_is2 = __commonJS(function(exports, module) {
  1442. 'use strict';
  1443. var isValue = require_is();
  1444. var possibleTypes = {
  1445. object: true,
  1446. function: true,
  1447. undefined: true
  1448. };
  1449. module.exports = function(value) {
  1450. if (!isValue(value)) {
  1451. return false;
  1452. }
  1453. return hasOwnProperty.call(possibleTypes, _typeof(value));
  1454. };
  1455. });
  1456. var require_is3 = __commonJS(function(exports, module) {
  1457. 'use strict';
  1458. var isObject = require_is2();
  1459. module.exports = function(value) {
  1460. if (!isObject(value)) {
  1461. return false;
  1462. }
  1463. try {
  1464. if (!value.constructor) {
  1465. return false;
  1466. }
  1467. return value.constructor.prototype === value;
  1468. } catch (error) {
  1469. return false;
  1470. }
  1471. };
  1472. });
  1473. var require_is4 = __commonJS(function(exports, module) {
  1474. 'use strict';
  1475. var isPrototype = require_is3();
  1476. module.exports = function(value) {
  1477. if (typeof value !== 'function') {
  1478. return false;
  1479. }
  1480. if (!hasOwnProperty.call(value, 'length')) {
  1481. return false;
  1482. }
  1483. try {
  1484. if (typeof value.length !== 'number') {
  1485. return false;
  1486. }
  1487. if (typeof value.call !== 'function') {
  1488. return false;
  1489. }
  1490. if (typeof value.apply !== 'function') {
  1491. return false;
  1492. }
  1493. } catch (error) {
  1494. return false;
  1495. }
  1496. return !isPrototype(value);
  1497. };
  1498. });
  1499. var require_is5 = __commonJS(function(exports, module) {
  1500. 'use strict';
  1501. var isFunction = require_is4();
  1502. var classRe = /^\s*class[\s{/}]/;
  1503. var functionToString = Function.prototype.toString;
  1504. module.exports = function(value) {
  1505. if (!isFunction(value)) {
  1506. return false;
  1507. }
  1508. if (classRe.test(functionToString.call(value))) {
  1509. return false;
  1510. }
  1511. return true;
  1512. };
  1513. });
  1514. var require_is_implemented4 = __commonJS(function(exports, module) {
  1515. 'use strict';
  1516. var str = 'razdwatrzy';
  1517. module.exports = function() {
  1518. if (typeof str.contains !== 'function') {
  1519. return false;
  1520. }
  1521. return str.contains('dwa') === true && str.contains('foo') === false;
  1522. };
  1523. });
  1524. var require_shim4 = __commonJS(function(exports, module) {
  1525. 'use strict';
  1526. var indexOf = String.prototype.indexOf;
  1527. module.exports = function(searchString) {
  1528. return indexOf.call(this, searchString, arguments[1]) > -1;
  1529. };
  1530. });
  1531. var require_contains = __commonJS(function(exports, module) {
  1532. 'use strict';
  1533. module.exports = require_is_implemented4()() ? String.prototype.contains : require_shim4();
  1534. });
  1535. var require_d = __commonJS(function(exports, module) {
  1536. 'use strict';
  1537. var isValue = require_is();
  1538. var isPlainFunction = require_is5();
  1539. var assign = require_assign();
  1540. var normalizeOpts = require_normalize_options();
  1541. var contains3 = require_contains();
  1542. var d = module.exports = function(dscr, value) {
  1543. var c, e, w, options, desc;
  1544. if (arguments.length < 2 || typeof dscr !== 'string') {
  1545. options = value;
  1546. value = dscr;
  1547. dscr = null;
  1548. } else {
  1549. options = arguments[2];
  1550. }
  1551. if (isValue(dscr)) {
  1552. c = contains3.call(dscr, 'c');
  1553. e = contains3.call(dscr, 'e');
  1554. w = contains3.call(dscr, 'w');
  1555. } else {
  1556. c = w = true;
  1557. e = false;
  1558. }
  1559. desc = {
  1560. value: value,
  1561. configurable: c,
  1562. enumerable: e,
  1563. writable: w
  1564. };
  1565. return !options ? desc : assign(normalizeOpts(options), desc);
  1566. };
  1567. d.gs = function(dscr, get, set) {
  1568. var c, e, options, desc;
  1569. if (typeof dscr !== 'string') {
  1570. options = set;
  1571. set = get;
  1572. get = dscr;
  1573. dscr = null;
  1574. } else {
  1575. options = arguments[3];
  1576. }
  1577. if (!isValue(get)) {
  1578. get = void 0;
  1579. } else if (!isPlainFunction(get)) {
  1580. options = get;
  1581. get = set = void 0;
  1582. } else if (!isValue(set)) {
  1583. set = void 0;
  1584. } else if (!isPlainFunction(set)) {
  1585. options = set;
  1586. set = void 0;
  1587. }
  1588. if (isValue(dscr)) {
  1589. c = contains3.call(dscr, 'c');
  1590. e = contains3.call(dscr, 'e');
  1591. } else {
  1592. c = true;
  1593. e = false;
  1594. }
  1595. desc = {
  1596. get: get,
  1597. set: set,
  1598. configurable: c,
  1599. enumerable: e
  1600. };
  1601. return !options ? desc : assign(normalizeOpts(options), desc);
  1602. };
  1603. });
  1604. var require_event_emitter = __commonJS(function(exports, module) {
  1605. 'use strict';
  1606. var d = require_d();
  1607. var callable = require_valid_callable();
  1608. var apply = Function.prototype.apply;
  1609. var call = Function.prototype.call;
  1610. var create = Object.create;
  1611. var defineProperty = Object.defineProperty;
  1612. var defineProperties = Object.defineProperties;
  1613. var hasOwnProperty2 = Object.prototype.hasOwnProperty;
  1614. var descriptor = {
  1615. configurable: true,
  1616. enumerable: false,
  1617. writable: true
  1618. };
  1619. var on;
  1620. var once;
  1621. var off;
  1622. var emit;
  1623. var methods;
  1624. var descriptors;
  1625. var base;
  1626. on = function on(type, listener) {
  1627. var data2;
  1628. callable(listener);
  1629. if (!hasOwnProperty2.call(this, '__ee__')) {
  1630. data2 = descriptor.value = create(null);
  1631. defineProperty(this, '__ee__', descriptor);
  1632. descriptor.value = null;
  1633. } else {
  1634. data2 = this.__ee__;
  1635. }
  1636. if (!data2[type]) {
  1637. data2[type] = listener;
  1638. } else if (_typeof(data2[type]) === 'object') {
  1639. data2[type].push(listener);
  1640. } else {
  1641. data2[type] = [ data2[type], listener ];
  1642. }
  1643. return this;
  1644. };
  1645. once = function once(type, listener) {
  1646. var _once, self2;
  1647. callable(listener);
  1648. self2 = this;
  1649. on.call(this, type, _once = function once2() {
  1650. off.call(self2, type, _once);
  1651. apply.call(listener, this, arguments);
  1652. });
  1653. _once.__eeOnceListener__ = listener;
  1654. return this;
  1655. };
  1656. off = function off(type, listener) {
  1657. var data2, listeners, candidate, i;
  1658. callable(listener);
  1659. if (!hasOwnProperty2.call(this, '__ee__')) {
  1660. return this;
  1661. }
  1662. data2 = this.__ee__;
  1663. if (!data2[type]) {
  1664. return this;
  1665. }
  1666. listeners = data2[type];
  1667. if (_typeof(listeners) === 'object') {
  1668. for (i = 0; candidate = listeners[i]; ++i) {
  1669. if (candidate === listener || candidate.__eeOnceListener__ === listener) {
  1670. if (listeners.length === 2) {
  1671. data2[type] = listeners[i ? 0 : 1];
  1672. } else {
  1673. listeners.splice(i, 1);
  1674. }
  1675. }
  1676. }
  1677. } else {
  1678. if (listeners === listener || listeners.__eeOnceListener__ === listener) {
  1679. delete data2[type];
  1680. }
  1681. }
  1682. return this;
  1683. };
  1684. emit = function emit(type) {
  1685. var i, l, listener, listeners, args;
  1686. if (!hasOwnProperty2.call(this, '__ee__')) {
  1687. return;
  1688. }
  1689. listeners = this.__ee__[type];
  1690. if (!listeners) {
  1691. return;
  1692. }
  1693. if (_typeof(listeners) === 'object') {
  1694. l = arguments.length;
  1695. args = new Array(l - 1);
  1696. for (i = 1; i < l; ++i) {
  1697. args[i - 1] = arguments[i];
  1698. }
  1699. listeners = listeners.slice();
  1700. for (i = 0; listener = listeners[i]; ++i) {
  1701. apply.call(listener, this, args);
  1702. }
  1703. } else {
  1704. switch (arguments.length) {
  1705. case 1:
  1706. call.call(listeners, this);
  1707. break;
  1708. case 2:
  1709. call.call(listeners, this, arguments[1]);
  1710. break;
  1711. case 3:
  1712. call.call(listeners, this, arguments[1], arguments[2]);
  1713. break;
  1714. default:
  1715. l = arguments.length;
  1716. args = new Array(l - 1);
  1717. for (i = 1; i < l; ++i) {
  1718. args[i - 1] = arguments[i];
  1719. }
  1720. apply.call(listeners, this, args);
  1721. }
  1722. }
  1723. };
  1724. methods = {
  1725. on: on,
  1726. once: once,
  1727. off: off,
  1728. emit: emit
  1729. };
  1730. descriptors = {
  1731. on: d(on),
  1732. once: d(once),
  1733. off: d(off),
  1734. emit: d(emit)
  1735. };
  1736. base = defineProperties({}, descriptors);
  1737. module.exports = exports = function exports(o) {
  1738. return o == null ? create(base) : defineProperties(Object(o), descriptors);
  1739. };
  1740. exports.methods = methods;
  1741. });
  1742. var require_is_implemented5 = __commonJS(function(exports, module) {
  1743. 'use strict';
  1744. module.exports = function() {
  1745. var from = Array.from, arr, result;
  1746. if (typeof from !== 'function') {
  1747. return false;
  1748. }
  1749. arr = [ 'raz', 'dwa' ];
  1750. result = from(arr);
  1751. return Boolean(result && result !== arr && result[1] === 'dwa');
  1752. };
  1753. });
  1754. var require_is_implemented6 = __commonJS(function(exports, module) {
  1755. 'use strict';
  1756. module.exports = function() {
  1757. if ((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) !== 'object') {
  1758. return false;
  1759. }
  1760. if (!globalThis) {
  1761. return false;
  1762. }
  1763. return globalThis.Array === Array;
  1764. };
  1765. });
  1766. var require_implementation = __commonJS(function(exports, module) {
  1767. var naiveFallback = function naiveFallback() {
  1768. if ((typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self) {
  1769. return self;
  1770. }
  1771. if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window) {
  1772. return window;
  1773. }
  1774. throw new Error('Unable to resolve global `this`');
  1775. };
  1776. module.exports = function() {
  1777. if (this) {
  1778. return this;
  1779. }
  1780. try {
  1781. Object.defineProperty(Object.prototype, '__global__', {
  1782. get: function get() {
  1783. return this;
  1784. },
  1785. configurable: true
  1786. });
  1787. } catch (error) {
  1788. return naiveFallback();
  1789. }
  1790. try {
  1791. if (!__global__) {
  1792. return naiveFallback();
  1793. }
  1794. return __global__;
  1795. } finally {
  1796. delete Object.prototype.__global__;
  1797. }
  1798. }();
  1799. });
  1800. var require_global_this = __commonJS(function(exports, module) {
  1801. 'use strict';
  1802. module.exports = require_is_implemented6()() ? globalThis : require_implementation();
  1803. });
  1804. var require_is_implemented7 = __commonJS(function(exports, module) {
  1805. 'use strict';
  1806. var global2 = require_global_this();
  1807. var validTypes = {
  1808. object: true,
  1809. symbol: true
  1810. };
  1811. module.exports = function() {
  1812. var _Symbol = global2.Symbol;
  1813. var symbol;
  1814. if (typeof _Symbol !== 'function') {
  1815. return false;
  1816. }
  1817. symbol = _Symbol('test symbol');
  1818. try {
  1819. String(symbol);
  1820. } catch (e) {
  1821. return false;
  1822. }
  1823. if (!validTypes[_typeof(_Symbol.iterator)]) {
  1824. return false;
  1825. }
  1826. if (!validTypes[_typeof(_Symbol.toPrimitive)]) {
  1827. return false;
  1828. }
  1829. if (!validTypes[_typeof(_Symbol.toStringTag)]) {
  1830. return false;
  1831. }
  1832. return true;
  1833. };
  1834. });
  1835. var require_is_symbol = __commonJS(function(exports, module) {
  1836. 'use strict';
  1837. module.exports = function(value) {
  1838. if (!value) {
  1839. return false;
  1840. }
  1841. if (_typeof(value) === 'symbol') {
  1842. return true;
  1843. }
  1844. if (!value.constructor) {
  1845. return false;
  1846. }
  1847. if (value.constructor.name !== 'Symbol') {
  1848. return false;
  1849. }
  1850. return value[value.constructor.toStringTag] === 'Symbol';
  1851. };
  1852. });
  1853. var require_validate_symbol = __commonJS(function(exports, module) {
  1854. 'use strict';
  1855. var isSymbol = require_is_symbol();
  1856. module.exports = function(value) {
  1857. if (!isSymbol(value)) {
  1858. throw new TypeError(value + ' is not a symbol');
  1859. }
  1860. return value;
  1861. };
  1862. });
  1863. var require_generate_name = __commonJS(function(exports, module) {
  1864. 'use strict';
  1865. var d = require_d();
  1866. var create = Object.create;
  1867. var defineProperty = Object.defineProperty;
  1868. var objPrototype = Object.prototype;
  1869. var created = create(null);
  1870. module.exports = function(desc) {
  1871. var postfix = 0, name, ie11BugWorkaround;
  1872. while (created[desc + (postfix || '')]) {
  1873. ++postfix;
  1874. }
  1875. desc += postfix || '';
  1876. created[desc] = true;
  1877. name = '@@' + desc;
  1878. defineProperty(objPrototype, name, d.gs(null, function(value) {
  1879. if (ie11BugWorkaround) {
  1880. return;
  1881. }
  1882. ie11BugWorkaround = true;
  1883. defineProperty(this, name, d(value));
  1884. ie11BugWorkaround = false;
  1885. }));
  1886. return name;
  1887. };
  1888. });
  1889. var require_standard_symbols = __commonJS(function(exports, module) {
  1890. 'use strict';
  1891. var d = require_d();
  1892. var NativeSymbol = require_global_this().Symbol;
  1893. module.exports = function(SymbolPolyfill) {
  1894. return Object.defineProperties(SymbolPolyfill, {
  1895. hasInstance: d('', NativeSymbol && NativeSymbol.hasInstance || SymbolPolyfill('hasInstance')),
  1896. isConcatSpreadable: d('', NativeSymbol && NativeSymbol.isConcatSpreadable || SymbolPolyfill('isConcatSpreadable')),
  1897. iterator: d('', NativeSymbol && NativeSymbol.iterator || SymbolPolyfill('iterator')),
  1898. match: d('', NativeSymbol && NativeSymbol.match || SymbolPolyfill('match')),
  1899. replace: d('', NativeSymbol && NativeSymbol.replace || SymbolPolyfill('replace')),
  1900. search: d('', NativeSymbol && NativeSymbol.search || SymbolPolyfill('search')),
  1901. species: d('', NativeSymbol && NativeSymbol.species || SymbolPolyfill('species')),
  1902. split: d('', NativeSymbol && NativeSymbol.split || SymbolPolyfill('split')),
  1903. toPrimitive: d('', NativeSymbol && NativeSymbol.toPrimitive || SymbolPolyfill('toPrimitive')),
  1904. toStringTag: d('', NativeSymbol && NativeSymbol.toStringTag || SymbolPolyfill('toStringTag')),
  1905. unscopables: d('', NativeSymbol && NativeSymbol.unscopables || SymbolPolyfill('unscopables'))
  1906. });
  1907. };
  1908. });
  1909. var require_symbol_registry = __commonJS(function(exports, module) {
  1910. 'use strict';
  1911. var d = require_d();
  1912. var validateSymbol = require_validate_symbol();
  1913. var registry = Object.create(null);
  1914. module.exports = function(SymbolPolyfill) {
  1915. return Object.defineProperties(SymbolPolyfill, {
  1916. for: d(function(key) {
  1917. if (registry[key]) {
  1918. return registry[key];
  1919. }
  1920. return registry[key] = SymbolPolyfill(String(key));
  1921. }),
  1922. keyFor: d(function(symbol) {
  1923. var key;
  1924. validateSymbol(symbol);
  1925. for (key in registry) {
  1926. if (registry[key] === symbol) {
  1927. return key;
  1928. }
  1929. }
  1930. return void 0;
  1931. })
  1932. });
  1933. };
  1934. });
  1935. var require_polyfill = __commonJS(function(exports, module) {
  1936. 'use strict';
  1937. var d = require_d();
  1938. var validateSymbol = require_validate_symbol();
  1939. var NativeSymbol = require_global_this().Symbol;
  1940. var generateName = require_generate_name();
  1941. var setupStandardSymbols = require_standard_symbols();
  1942. var setupSymbolRegistry = require_symbol_registry();
  1943. var create = Object.create;
  1944. var defineProperties = Object.defineProperties;
  1945. var defineProperty = Object.defineProperty;
  1946. var SymbolPolyfill;
  1947. var HiddenSymbol;
  1948. var isNativeSafe;
  1949. if (typeof NativeSymbol === 'function') {
  1950. try {
  1951. String(NativeSymbol());
  1952. isNativeSafe = true;
  1953. } catch (ignore) {}
  1954. } else {
  1955. NativeSymbol = null;
  1956. }
  1957. HiddenSymbol = function _Symbol2(description) {
  1958. if (this instanceof HiddenSymbol) {
  1959. throw new TypeError('Symbol is not a constructor');
  1960. }
  1961. return SymbolPolyfill(description);
  1962. };
  1963. module.exports = SymbolPolyfill = function _Symbol3(description) {
  1964. var symbol;
  1965. if (this instanceof _Symbol3) {
  1966. throw new TypeError('Symbol is not a constructor');
  1967. }
  1968. if (isNativeSafe) {
  1969. return NativeSymbol(description);
  1970. }
  1971. symbol = create(HiddenSymbol.prototype);
  1972. description = description === void 0 ? '' : String(description);
  1973. return defineProperties(symbol, {
  1974. __description__: d('', description),
  1975. __name__: d('', generateName(description))
  1976. });
  1977. };
  1978. setupStandardSymbols(SymbolPolyfill);
  1979. setupSymbolRegistry(SymbolPolyfill);
  1980. defineProperties(HiddenSymbol.prototype, {
  1981. constructor: d(SymbolPolyfill),
  1982. toString: d('', function() {
  1983. return this.__name__;
  1984. })
  1985. });
  1986. defineProperties(SymbolPolyfill.prototype, {
  1987. toString: d(function() {
  1988. return 'Symbol (' + validateSymbol(this).__description__ + ')';
  1989. }),
  1990. valueOf: d(function() {
  1991. return validateSymbol(this);
  1992. })
  1993. });
  1994. defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function() {
  1995. var symbol = validateSymbol(this);
  1996. if (_typeof(symbol) === 'symbol') {
  1997. return symbol;
  1998. }
  1999. return symbol.toString();
  2000. }));
  2001. defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol'));
  2002. defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));
  2003. defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]));
  2004. });
  2005. var require_es6_symbol = __commonJS(function(exports, module) {
  2006. 'use strict';
  2007. module.exports = require_is_implemented7()() ? require_global_this().Symbol : require_polyfill();
  2008. });
  2009. var require_is_arguments = __commonJS(function(exports, module) {
  2010. 'use strict';
  2011. var objToString = Object.prototype.toString;
  2012. var id = objToString.call(function() {
  2013. return arguments;
  2014. }());
  2015. module.exports = function(value) {
  2016. return objToString.call(value) === id;
  2017. };
  2018. });
  2019. var require_is_function = __commonJS(function(exports, module) {
  2020. 'use strict';
  2021. var objToString = Object.prototype.toString;
  2022. var isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);
  2023. module.exports = function(value) {
  2024. return typeof value === 'function' && isFunctionStringTag(objToString.call(value));
  2025. };
  2026. });
  2027. var require_is_string = __commonJS(function(exports, module) {
  2028. 'use strict';
  2029. var objToString = Object.prototype.toString;
  2030. var id = objToString.call('');
  2031. module.exports = function(value) {
  2032. return typeof value === 'string' || value && _typeof(value) === 'object' && (value instanceof String || objToString.call(value) === id) || false;
  2033. };
  2034. });
  2035. var require_shim5 = __commonJS(function(exports, module) {
  2036. 'use strict';
  2037. var iteratorSymbol = require_es6_symbol().iterator;
  2038. var isArguments = require_is_arguments();
  2039. var isFunction = require_is_function();
  2040. var toPosInt = require_to_pos_integer();
  2041. var callable = require_valid_callable();
  2042. var validValue = require_valid_value();
  2043. var isValue = require_is_value();
  2044. var isString = require_is_string();
  2045. var isArray = Array.isArray;
  2046. var call = Function.prototype.call;
  2047. var desc = {
  2048. configurable: true,
  2049. enumerable: true,
  2050. writable: true,
  2051. value: null
  2052. };
  2053. var defineProperty = Object.defineProperty;
  2054. module.exports = function(arrayLike) {
  2055. var mapFn = arguments[1], thisArg = arguments[2], Context2, i, j, arr, length, code, iterator, result, getIterator, value;
  2056. arrayLike = Object(validValue(arrayLike));
  2057. if (isValue(mapFn)) {
  2058. callable(mapFn);
  2059. }
  2060. if (!this || this === Array || !isFunction(this)) {
  2061. if (!mapFn) {
  2062. if (isArguments(arrayLike)) {
  2063. length = arrayLike.length;
  2064. if (length !== 1) {
  2065. return Array.apply(null, arrayLike);
  2066. }
  2067. arr = new Array(1);
  2068. arr[0] = arrayLike[0];
  2069. return arr;
  2070. }
  2071. if (isArray(arrayLike)) {
  2072. arr = new Array(length = arrayLike.length);
  2073. for (i = 0; i < length; ++i) {
  2074. arr[i] = arrayLike[i];
  2075. }
  2076. return arr;
  2077. }
  2078. }
  2079. arr = [];
  2080. } else {
  2081. Context2 = this;
  2082. }
  2083. if (!isArray(arrayLike)) {
  2084. if ((getIterator = arrayLike[iteratorSymbol]) !== void 0) {
  2085. iterator = callable(getIterator).call(arrayLike);
  2086. if (Context2) {
  2087. arr = new Context2();
  2088. }
  2089. result = iterator.next();
  2090. i = 0;
  2091. while (!result.done) {
  2092. value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value;
  2093. if (Context2) {
  2094. desc.value = value;
  2095. defineProperty(arr, i, desc);
  2096. } else {
  2097. arr[i] = value;
  2098. }
  2099. result = iterator.next();
  2100. ++i;
  2101. }
  2102. length = i;
  2103. } else if (isString(arrayLike)) {
  2104. length = arrayLike.length;
  2105. if (Context2) {
  2106. arr = new Context2();
  2107. }
  2108. for (i = 0, j = 0; i < length; ++i) {
  2109. value = arrayLike[i];
  2110. if (i + 1 < length) {
  2111. code = value.charCodeAt(0);
  2112. if (code >= 55296 && code <= 56319) {
  2113. value += arrayLike[++i];
  2114. }
  2115. }
  2116. value = mapFn ? call.call(mapFn, thisArg, value, j) : value;
  2117. if (Context2) {
  2118. desc.value = value;
  2119. defineProperty(arr, j, desc);
  2120. } else {
  2121. arr[j] = value;
  2122. }
  2123. ++j;
  2124. }
  2125. length = j;
  2126. }
  2127. }
  2128. if (length === void 0) {
  2129. length = toPosInt(arrayLike.length);
  2130. if (Context2) {
  2131. arr = new Context2(length);
  2132. }
  2133. for (i = 0; i < length; ++i) {
  2134. value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i];
  2135. if (Context2) {
  2136. desc.value = value;
  2137. defineProperty(arr, i, desc);
  2138. } else {
  2139. arr[i] = value;
  2140. }
  2141. }
  2142. }
  2143. if (Context2) {
  2144. desc.value = null;
  2145. arr.length = length;
  2146. }
  2147. return arr;
  2148. };
  2149. });
  2150. var require_from = __commonJS(function(exports, module) {
  2151. 'use strict';
  2152. module.exports = require_is_implemented5()() ? Array.from : require_shim5();
  2153. });
  2154. var require_to_array = __commonJS(function(exports, module) {
  2155. 'use strict';
  2156. var from = require_from();
  2157. var isArray = Array.isArray;
  2158. module.exports = function(arrayLike) {
  2159. return isArray(arrayLike) ? arrayLike : from(arrayLike);
  2160. };
  2161. });
  2162. var require_resolve_resolve = __commonJS(function(exports, module) {
  2163. 'use strict';
  2164. var toArray2 = require_to_array();
  2165. var isValue = require_is_value();
  2166. var callable = require_valid_callable();
  2167. var slice = Array.prototype.slice;
  2168. var resolveArgs;
  2169. resolveArgs = function resolveArgs(args) {
  2170. return this.map(function(resolve, i) {
  2171. return resolve ? resolve(args[i]) : args[i];
  2172. }).concat(slice.call(args, this.length));
  2173. };
  2174. module.exports = function(resolvers) {
  2175. resolvers = toArray2(resolvers);
  2176. resolvers.forEach(function(resolve) {
  2177. if (isValue(resolve)) {
  2178. callable(resolve);
  2179. }
  2180. });
  2181. return resolveArgs.bind(resolvers);
  2182. };
  2183. });
  2184. var require_resolve_normalize = __commonJS(function(exports, module) {
  2185. 'use strict';
  2186. var callable = require_valid_callable();
  2187. module.exports = function(userNormalizer) {
  2188. var normalizer;
  2189. if (typeof userNormalizer === 'function') {
  2190. return {
  2191. set: userNormalizer,
  2192. get: userNormalizer
  2193. };
  2194. }
  2195. normalizer = {
  2196. get: callable(userNormalizer.get)
  2197. };
  2198. if (userNormalizer.set !== void 0) {
  2199. normalizer.set = callable(userNormalizer.set);
  2200. if (userNormalizer['delete']) {
  2201. normalizer['delete'] = callable(userNormalizer['delete']);
  2202. }
  2203. if (userNormalizer.clear) {
  2204. normalizer.clear = callable(userNormalizer.clear);
  2205. }
  2206. return normalizer;
  2207. }
  2208. normalizer.set = normalizer.get;
  2209. return normalizer;
  2210. };
  2211. });
  2212. var require_configure_map = __commonJS(function(exports, module) {
  2213. 'use strict';
  2214. var customError = require_custom();
  2215. var defineLength = require_define_length();
  2216. var d = require_d();
  2217. var ee = require_event_emitter().methods;
  2218. var resolveResolve = require_resolve_resolve();
  2219. var resolveNormalize = require_resolve_normalize();
  2220. var apply = Function.prototype.apply;
  2221. var call = Function.prototype.call;
  2222. var create = Object.create;
  2223. var defineProperties = Object.defineProperties;
  2224. var _on = ee.on;
  2225. var emit = ee.emit;
  2226. module.exports = function(original, length, options) {
  2227. var cache2 = create(null), conf, memLength, _get, set, del, _clear, extDel, extGet, extHas, normalizer, getListeners, setListeners, deleteListeners, memoized, resolve;
  2228. if (length !== false) {
  2229. memLength = length;
  2230. } else if (isNaN(original.length)) {
  2231. memLength = 1;
  2232. } else {
  2233. memLength = original.length;
  2234. }
  2235. if (options.normalizer) {
  2236. normalizer = resolveNormalize(options.normalizer);
  2237. _get = normalizer.get;
  2238. set = normalizer.set;
  2239. del = normalizer['delete'];
  2240. _clear = normalizer.clear;
  2241. }
  2242. if (options.resolvers != null) {
  2243. resolve = resolveResolve(options.resolvers);
  2244. }
  2245. if (_get) {
  2246. memoized = defineLength(function(arg) {
  2247. var id, result, args = arguments;
  2248. if (resolve) {
  2249. args = resolve(args);
  2250. }
  2251. id = _get(args);
  2252. if (id !== null) {
  2253. if (hasOwnProperty.call(cache2, id)) {
  2254. if (getListeners) {
  2255. conf.emit('get', id, args, this);
  2256. }
  2257. return cache2[id];
  2258. }
  2259. }
  2260. if (args.length === 1) {
  2261. result = call.call(original, this, args[0]);
  2262. } else {
  2263. result = apply.call(original, this, args);
  2264. }
  2265. if (id === null) {
  2266. id = _get(args);
  2267. if (id !== null) {
  2268. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  2269. }
  2270. id = set(args);
  2271. } else if (hasOwnProperty.call(cache2, id)) {
  2272. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  2273. }
  2274. cache2[id] = result;
  2275. if (setListeners) {
  2276. conf.emit('set', id, null, result);
  2277. }
  2278. return result;
  2279. }, memLength);
  2280. } else if (length === 0) {
  2281. memoized = function memoized() {
  2282. var result;
  2283. if (hasOwnProperty.call(cache2, 'data')) {
  2284. if (getListeners) {
  2285. conf.emit('get', 'data', arguments, this);
  2286. }
  2287. return cache2.data;
  2288. }
  2289. if (arguments.length) {
  2290. result = apply.call(original, this, arguments);
  2291. } else {
  2292. result = call.call(original, this);
  2293. }
  2294. if (hasOwnProperty.call(cache2, 'data')) {
  2295. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  2296. }
  2297. cache2.data = result;
  2298. if (setListeners) {
  2299. conf.emit('set', 'data', null, result);
  2300. }
  2301. return result;
  2302. };
  2303. } else {
  2304. memoized = function memoized(arg) {
  2305. var result, args = arguments, id;
  2306. if (resolve) {
  2307. args = resolve(arguments);
  2308. }
  2309. id = String(args[0]);
  2310. if (hasOwnProperty.call(cache2, id)) {
  2311. if (getListeners) {
  2312. conf.emit('get', id, args, this);
  2313. }
  2314. return cache2[id];
  2315. }
  2316. if (args.length === 1) {
  2317. result = call.call(original, this, args[0]);
  2318. } else {
  2319. result = apply.call(original, this, args);
  2320. }
  2321. if (hasOwnProperty.call(cache2, id)) {
  2322. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  2323. }
  2324. cache2[id] = result;
  2325. if (setListeners) {
  2326. conf.emit('set', id, null, result);
  2327. }
  2328. return result;
  2329. };
  2330. }
  2331. conf = {
  2332. original: original,
  2333. memoized: memoized,
  2334. profileName: options.profileName,
  2335. get: function get(args) {
  2336. if (resolve) {
  2337. args = resolve(args);
  2338. }
  2339. if (_get) {
  2340. return _get(args);
  2341. }
  2342. return String(args[0]);
  2343. },
  2344. has: function has(id) {
  2345. return hasOwnProperty.call(cache2, id);
  2346. },
  2347. delete: function _delete(id) {
  2348. var result;
  2349. if (!hasOwnProperty.call(cache2, id)) {
  2350. return;
  2351. }
  2352. if (del) {
  2353. del(id);
  2354. }
  2355. result = cache2[id];
  2356. delete cache2[id];
  2357. if (deleteListeners) {
  2358. conf.emit('delete', id, result);
  2359. }
  2360. },
  2361. clear: function clear() {
  2362. var oldCache = cache2;
  2363. if (_clear) {
  2364. _clear();
  2365. }
  2366. cache2 = create(null);
  2367. conf.emit('clear', oldCache);
  2368. },
  2369. on: function on(type, listener) {
  2370. if (type === 'get') {
  2371. getListeners = true;
  2372. } else if (type === 'set') {
  2373. setListeners = true;
  2374. } else if (type === 'delete') {
  2375. deleteListeners = true;
  2376. }
  2377. return _on.call(this, type, listener);
  2378. },
  2379. emit: emit,
  2380. updateEnv: function updateEnv() {
  2381. original = conf.original;
  2382. }
  2383. };
  2384. if (_get) {
  2385. extDel = defineLength(function(arg) {
  2386. var id, args = arguments;
  2387. if (resolve) {
  2388. args = resolve(args);
  2389. }
  2390. id = _get(args);
  2391. if (id === null) {
  2392. return;
  2393. }
  2394. conf['delete'](id);
  2395. }, memLength);
  2396. } else if (length === 0) {
  2397. extDel = function extDel() {
  2398. return conf['delete']('data');
  2399. };
  2400. } else {
  2401. extDel = function extDel(arg) {
  2402. if (resolve) {
  2403. arg = resolve(arguments)[0];
  2404. }
  2405. return conf['delete'](arg);
  2406. };
  2407. }
  2408. extGet = defineLength(function() {
  2409. var id, args = arguments;
  2410. if (length === 0) {
  2411. return cache2.data;
  2412. }
  2413. if (resolve) {
  2414. args = resolve(args);
  2415. }
  2416. if (_get) {
  2417. id = _get(args);
  2418. } else {
  2419. id = String(args[0]);
  2420. }
  2421. return cache2[id];
  2422. });
  2423. extHas = defineLength(function() {
  2424. var id, args = arguments;
  2425. if (length === 0) {
  2426. return conf.has('data');
  2427. }
  2428. if (resolve) {
  2429. args = resolve(args);
  2430. }
  2431. if (_get) {
  2432. id = _get(args);
  2433. } else {
  2434. id = String(args[0]);
  2435. }
  2436. if (id === null) {
  2437. return false;
  2438. }
  2439. return conf.has(id);
  2440. });
  2441. defineProperties(memoized, {
  2442. __memoized__: d(true),
  2443. delete: d(extDel),
  2444. clear: d(conf.clear),
  2445. _get: d(extGet),
  2446. _has: d(extHas)
  2447. });
  2448. return conf;
  2449. };
  2450. });
  2451. var require_plain = __commonJS(function(exports, module) {
  2452. 'use strict';
  2453. var callable = require_valid_callable();
  2454. var forEach = require_for_each();
  2455. var extensions = require_registered_extensions();
  2456. var configure4 = require_configure_map();
  2457. var resolveLength = require_resolve_length();
  2458. module.exports = function self2(fn) {
  2459. var options, length, conf;
  2460. callable(fn);
  2461. options = Object(arguments[1]);
  2462. if (options.async && options.promise) {
  2463. throw new Error('Options \'async\' and \'promise\' cannot be used together');
  2464. }
  2465. if (hasOwnProperty.call(fn, '__memoized__') && !options.force) {
  2466. return fn;
  2467. }
  2468. length = resolveLength(options.length, fn.length, options.async && extensions.async);
  2469. conf = configure4(fn, length, options);
  2470. forEach(extensions, function(extFn, name) {
  2471. if (options[name]) {
  2472. extFn(options[name], conf, options);
  2473. }
  2474. });
  2475. if (self2.__profiler__) {
  2476. self2.__profiler__(conf);
  2477. }
  2478. conf.updateEnv();
  2479. return conf.memoized;
  2480. };
  2481. });
  2482. var require_primitive = __commonJS(function(exports, module) {
  2483. 'use strict';
  2484. module.exports = function(args) {
  2485. var id, i, length = args.length;
  2486. if (!length) {
  2487. return '\x02';
  2488. }
  2489. id = String(args[i = 0]);
  2490. while (--length) {
  2491. id += '\x01' + args[++i];
  2492. }
  2493. return id;
  2494. };
  2495. });
  2496. var require_get_primitive_fixed = __commonJS(function(exports, module) {
  2497. 'use strict';
  2498. module.exports = function(length) {
  2499. if (!length) {
  2500. return function() {
  2501. return '';
  2502. };
  2503. }
  2504. return function(args) {
  2505. var id = String(args[0]), i = 0, currentLength = length;
  2506. while (--currentLength) {
  2507. id += '\x01' + args[++i];
  2508. }
  2509. return id;
  2510. };
  2511. };
  2512. });
  2513. var require_is_implemented8 = __commonJS(function(exports, module) {
  2514. 'use strict';
  2515. module.exports = function() {
  2516. var numberIsNaN = Number.isNaN;
  2517. if (typeof numberIsNaN !== 'function') {
  2518. return false;
  2519. }
  2520. return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34);
  2521. };
  2522. });
  2523. var require_shim6 = __commonJS(function(exports, module) {
  2524. 'use strict';
  2525. module.exports = function(value) {
  2526. return value !== value;
  2527. };
  2528. });
  2529. var require_is_nan = __commonJS(function(exports, module) {
  2530. 'use strict';
  2531. module.exports = require_is_implemented8()() ? Number.isNaN : require_shim6();
  2532. });
  2533. var require_e_index_of = __commonJS(function(exports, module) {
  2534. 'use strict';
  2535. var numberIsNaN = require_is_nan();
  2536. var toPosInt = require_to_pos_integer();
  2537. var value = require_valid_value();
  2538. var indexOf = Array.prototype.indexOf;
  2539. var objHasOwnProperty = Object.prototype.hasOwnProperty;
  2540. var abs = Math.abs;
  2541. var floor = Math.floor;
  2542. module.exports = function(searchElement) {
  2543. var i, length, fromIndex, val;
  2544. if (!numberIsNaN(searchElement)) {
  2545. return indexOf.apply(this, arguments);
  2546. }
  2547. length = toPosInt(value(this).length);
  2548. fromIndex = arguments[1];
  2549. if (isNaN(fromIndex)) {
  2550. fromIndex = 0;
  2551. } else if (fromIndex >= 0) {
  2552. fromIndex = floor(fromIndex);
  2553. } else {
  2554. fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
  2555. }
  2556. for (i = fromIndex; i < length; ++i) {
  2557. if (objHasOwnProperty.call(this, i)) {
  2558. val = this[i];
  2559. if (numberIsNaN(val)) {
  2560. return i;
  2561. }
  2562. }
  2563. }
  2564. return -1;
  2565. };
  2566. });
  2567. var require_get = __commonJS(function(exports, module) {
  2568. 'use strict';
  2569. var indexOf = require_e_index_of();
  2570. var create = Object.create;
  2571. module.exports = function() {
  2572. var lastId = 0, map = [], cache2 = create(null);
  2573. return {
  2574. get: function get(args) {
  2575. var index = 0, set = map, i, length = args.length;
  2576. if (length === 0) {
  2577. return set[length] || null;
  2578. }
  2579. if (set = set[length]) {
  2580. while (index < length - 1) {
  2581. i = indexOf.call(set[0], args[index]);
  2582. if (i === -1) {
  2583. return null;
  2584. }
  2585. set = set[1][i];
  2586. ++index;
  2587. }
  2588. i = indexOf.call(set[0], args[index]);
  2589. if (i === -1) {
  2590. return null;
  2591. }
  2592. return set[1][i] || null;
  2593. }
  2594. return null;
  2595. },
  2596. set: function set(args) {
  2597. var index = 0, set = map, i, length = args.length;
  2598. if (length === 0) {
  2599. set[length] = ++lastId;
  2600. } else {
  2601. if (!set[length]) {
  2602. set[length] = [ [], [] ];
  2603. }
  2604. set = set[length];
  2605. while (index < length - 1) {
  2606. i = indexOf.call(set[0], args[index]);
  2607. if (i === -1) {
  2608. i = set[0].push(args[index]) - 1;
  2609. set[1].push([ [], [] ]);
  2610. }
  2611. set = set[1][i];
  2612. ++index;
  2613. }
  2614. i = indexOf.call(set[0], args[index]);
  2615. if (i === -1) {
  2616. i = set[0].push(args[index]) - 1;
  2617. }
  2618. set[1][i] = ++lastId;
  2619. }
  2620. cache2[lastId] = args;
  2621. return lastId;
  2622. },
  2623. delete: function _delete(id) {
  2624. var index = 0, set = map, i, args = cache2[id], length = args.length, path = [];
  2625. if (length === 0) {
  2626. delete set[length];
  2627. } else if (set = set[length]) {
  2628. while (index < length - 1) {
  2629. i = indexOf.call(set[0], args[index]);
  2630. if (i === -1) {
  2631. return;
  2632. }
  2633. path.push(set, i);
  2634. set = set[1][i];
  2635. ++index;
  2636. }
  2637. i = indexOf.call(set[0], args[index]);
  2638. if (i === -1) {
  2639. return;
  2640. }
  2641. id = set[1][i];
  2642. set[0].splice(i, 1);
  2643. set[1].splice(i, 1);
  2644. while (!set[0].length && path.length) {
  2645. i = path.pop();
  2646. set = path.pop();
  2647. set[0].splice(i, 1);
  2648. set[1].splice(i, 1);
  2649. }
  2650. }
  2651. delete cache2[id];
  2652. },
  2653. clear: function clear() {
  2654. map = [];
  2655. cache2 = create(null);
  2656. }
  2657. };
  2658. };
  2659. });
  2660. var require_get_1 = __commonJS(function(exports, module) {
  2661. 'use strict';
  2662. var indexOf = require_e_index_of();
  2663. module.exports = function() {
  2664. var lastId = 0, argsMap = [], cache2 = [];
  2665. return {
  2666. get: function get(args) {
  2667. var index = indexOf.call(argsMap, args[0]);
  2668. return index === -1 ? null : cache2[index];
  2669. },
  2670. set: function set(args) {
  2671. argsMap.push(args[0]);
  2672. cache2.push(++lastId);
  2673. return lastId;
  2674. },
  2675. delete: function _delete(id) {
  2676. var index = indexOf.call(cache2, id);
  2677. if (index !== -1) {
  2678. argsMap.splice(index, 1);
  2679. cache2.splice(index, 1);
  2680. }
  2681. },
  2682. clear: function clear() {
  2683. argsMap = [];
  2684. cache2 = [];
  2685. }
  2686. };
  2687. };
  2688. });
  2689. var require_get_fixed = __commonJS(function(exports, module) {
  2690. 'use strict';
  2691. var indexOf = require_e_index_of();
  2692. var create = Object.create;
  2693. module.exports = function(length) {
  2694. var lastId = 0, map = [ [], [] ], cache2 = create(null);
  2695. return {
  2696. get: function get(args) {
  2697. var index = 0, set = map, i;
  2698. while (index < length - 1) {
  2699. i = indexOf.call(set[0], args[index]);
  2700. if (i === -1) {
  2701. return null;
  2702. }
  2703. set = set[1][i];
  2704. ++index;
  2705. }
  2706. i = indexOf.call(set[0], args[index]);
  2707. if (i === -1) {
  2708. return null;
  2709. }
  2710. return set[1][i] || null;
  2711. },
  2712. set: function set(args) {
  2713. var index = 0, set = map, i;
  2714. while (index < length - 1) {
  2715. i = indexOf.call(set[0], args[index]);
  2716. if (i === -1) {
  2717. i = set[0].push(args[index]) - 1;
  2718. set[1].push([ [], [] ]);
  2719. }
  2720. set = set[1][i];
  2721. ++index;
  2722. }
  2723. i = indexOf.call(set[0], args[index]);
  2724. if (i === -1) {
  2725. i = set[0].push(args[index]) - 1;
  2726. }
  2727. set[1][i] = ++lastId;
  2728. cache2[lastId] = args;
  2729. return lastId;
  2730. },
  2731. delete: function _delete(id) {
  2732. var index = 0, set = map, i, path = [], args = cache2[id];
  2733. while (index < length - 1) {
  2734. i = indexOf.call(set[0], args[index]);
  2735. if (i === -1) {
  2736. return;
  2737. }
  2738. path.push(set, i);
  2739. set = set[1][i];
  2740. ++index;
  2741. }
  2742. i = indexOf.call(set[0], args[index]);
  2743. if (i === -1) {
  2744. return;
  2745. }
  2746. id = set[1][i];
  2747. set[0].splice(i, 1);
  2748. set[1].splice(i, 1);
  2749. while (!set[0].length && path.length) {
  2750. i = path.pop();
  2751. set = path.pop();
  2752. set[0].splice(i, 1);
  2753. set[1].splice(i, 1);
  2754. }
  2755. delete cache2[id];
  2756. },
  2757. clear: function clear() {
  2758. map = [ [], [] ];
  2759. cache2 = create(null);
  2760. }
  2761. };
  2762. };
  2763. });
  2764. var require_map = __commonJS(function(exports, module) {
  2765. 'use strict';
  2766. var callable = require_valid_callable();
  2767. var forEach = require_for_each();
  2768. var call = Function.prototype.call;
  2769. module.exports = function(obj, cb) {
  2770. var result = {}, thisArg = arguments[2];
  2771. callable(cb);
  2772. forEach(obj, function(value, key, targetObj, index) {
  2773. result[key] = call.call(cb, thisArg, value, key, targetObj, index);
  2774. });
  2775. return result;
  2776. };
  2777. });
  2778. var require_next_tick = __commonJS(function(exports, module) {
  2779. 'use strict';
  2780. var ensureCallable = function ensureCallable(fn) {
  2781. if (typeof fn !== 'function') {
  2782. throw new TypeError(fn + ' is not a function');
  2783. }
  2784. return fn;
  2785. };
  2786. var byObserver = function byObserver(Observer) {
  2787. var node = document.createTextNode(''), queue2, currentQueue, i = 0;
  2788. new Observer(function() {
  2789. var callback;
  2790. if (!queue2) {
  2791. if (!currentQueue) {
  2792. return;
  2793. }
  2794. queue2 = currentQueue;
  2795. } else if (currentQueue) {
  2796. queue2 = currentQueue.concat(queue2);
  2797. }
  2798. currentQueue = queue2;
  2799. queue2 = null;
  2800. if (typeof currentQueue === 'function') {
  2801. callback = currentQueue;
  2802. currentQueue = null;
  2803. callback();
  2804. return;
  2805. }
  2806. node.data = i = ++i % 2;
  2807. while (currentQueue) {
  2808. callback = currentQueue.shift();
  2809. if (!currentQueue.length) {
  2810. currentQueue = null;
  2811. }
  2812. callback();
  2813. }
  2814. }).observe(node, {
  2815. characterData: true
  2816. });
  2817. return function(fn) {
  2818. ensureCallable(fn);
  2819. if (queue2) {
  2820. if (typeof queue2 === 'function') {
  2821. queue2 = [ queue2, fn ];
  2822. } else {
  2823. queue2.push(fn);
  2824. }
  2825. return;
  2826. }
  2827. queue2 = fn;
  2828. node.data = i = ++i % 2;
  2829. };
  2830. };
  2831. module.exports = function() {
  2832. if ((typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process && typeof process.nextTick === 'function') {
  2833. return process.nextTick;
  2834. }
  2835. if (typeof queueMicrotask === 'function') {
  2836. return function(cb) {
  2837. queueMicrotask(ensureCallable(cb));
  2838. };
  2839. }
  2840. if ((typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object' && document) {
  2841. if (typeof MutationObserver === 'function') {
  2842. return byObserver(MutationObserver);
  2843. }
  2844. if (typeof WebKitMutationObserver === 'function') {
  2845. return byObserver(WebKitMutationObserver);
  2846. }
  2847. }
  2848. if (typeof setImmediate === 'function') {
  2849. return function(cb) {
  2850. setImmediate(ensureCallable(cb));
  2851. };
  2852. }
  2853. if (typeof setTimeout === 'function' || (typeof setTimeout === 'undefined' ? 'undefined' : _typeof(setTimeout)) === 'object') {
  2854. return function(cb) {
  2855. setTimeout(ensureCallable(cb), 0);
  2856. };
  2857. }
  2858. return null;
  2859. }();
  2860. });
  2861. var require_async = __commonJS(function() {
  2862. 'use strict';
  2863. var aFrom = require_from();
  2864. var objectMap = require_map();
  2865. var mixin = require_mixin();
  2866. var defineLength = require_define_length();
  2867. var nextTick = require_next_tick();
  2868. var slice = Array.prototype.slice;
  2869. var apply = Function.prototype.apply;
  2870. var create = Object.create;
  2871. require_registered_extensions().async = function(tbi, conf) {
  2872. var waiting = create(null), cache2 = create(null), base = conf.memoized, original = conf.original, currentCallback, currentContext, currentArgs;
  2873. conf.memoized = defineLength(function(arg) {
  2874. var args = arguments, last = args[args.length - 1];
  2875. if (typeof last === 'function') {
  2876. currentCallback = last;
  2877. args = slice.call(args, 0, -1);
  2878. }
  2879. return base.apply(currentContext = this, currentArgs = args);
  2880. }, base);
  2881. try {
  2882. mixin(conf.memoized, base);
  2883. } catch (ignore) {}
  2884. conf.on('get', function(id) {
  2885. var cb, context, args;
  2886. if (!currentCallback) {
  2887. return;
  2888. }
  2889. if (waiting[id]) {
  2890. if (typeof waiting[id] === 'function') {
  2891. waiting[id] = [ waiting[id], currentCallback ];
  2892. } else {
  2893. waiting[id].push(currentCallback);
  2894. }
  2895. currentCallback = null;
  2896. return;
  2897. }
  2898. cb = currentCallback;
  2899. context = currentContext;
  2900. args = currentArgs;
  2901. currentCallback = currentContext = currentArgs = null;
  2902. nextTick(function() {
  2903. var data2;
  2904. if (hasOwnProperty.call(cache2, id)) {
  2905. data2 = cache2[id];
  2906. conf.emit('getasync', id, args, context);
  2907. apply.call(cb, data2.context, data2.args);
  2908. } else {
  2909. currentCallback = cb;
  2910. currentContext = context;
  2911. currentArgs = args;
  2912. base.apply(context, args);
  2913. }
  2914. });
  2915. });
  2916. conf.original = function() {
  2917. var args, cb, origCb, result;
  2918. if (!currentCallback) {
  2919. return apply.call(original, this, arguments);
  2920. }
  2921. args = aFrom(arguments);
  2922. cb = function self2(err2) {
  2923. var cb2, args2, id = self2.id;
  2924. if (id == null) {
  2925. nextTick(apply.bind(self2, this, arguments));
  2926. return void 0;
  2927. }
  2928. delete self2.id;
  2929. cb2 = waiting[id];
  2930. delete waiting[id];
  2931. if (!cb2) {
  2932. return void 0;
  2933. }
  2934. args2 = aFrom(arguments);
  2935. if (conf.has(id)) {
  2936. if (err2) {
  2937. conf['delete'](id);
  2938. } else {
  2939. cache2[id] = {
  2940. context: this,
  2941. args: args2
  2942. };
  2943. conf.emit('setasync', id, typeof cb2 === 'function' ? 1 : cb2.length);
  2944. }
  2945. }
  2946. if (typeof cb2 === 'function') {
  2947. result = apply.call(cb2, this, args2);
  2948. } else {
  2949. cb2.forEach(function(cb3) {
  2950. result = apply.call(cb3, this, args2);
  2951. }, this);
  2952. }
  2953. return result;
  2954. };
  2955. origCb = currentCallback;
  2956. currentCallback = currentContext = currentArgs = null;
  2957. args.push(cb);
  2958. result = apply.call(original, this, args);
  2959. cb.cb = origCb;
  2960. currentCallback = cb;
  2961. return result;
  2962. };
  2963. conf.on('set', function(id) {
  2964. if (!currentCallback) {
  2965. conf['delete'](id);
  2966. return;
  2967. }
  2968. if (waiting[id]) {
  2969. if (typeof waiting[id] === 'function') {
  2970. waiting[id] = [ waiting[id], currentCallback.cb ];
  2971. } else {
  2972. waiting[id].push(currentCallback.cb);
  2973. }
  2974. } else {
  2975. waiting[id] = currentCallback.cb;
  2976. }
  2977. delete currentCallback.cb;
  2978. currentCallback.id = id;
  2979. currentCallback = null;
  2980. });
  2981. conf.on('delete', function(id) {
  2982. var result;
  2983. if (hasOwnProperty.call(waiting, id)) {
  2984. return;
  2985. }
  2986. if (!cache2[id]) {
  2987. return;
  2988. }
  2989. result = cache2[id];
  2990. delete cache2[id];
  2991. conf.emit('deleteasync', id, slice.call(result.args, 1));
  2992. });
  2993. conf.on('clear', function() {
  2994. var oldCache = cache2;
  2995. cache2 = create(null);
  2996. conf.emit('clearasync', objectMap(oldCache, function(data2) {
  2997. return slice.call(data2.args, 1);
  2998. }));
  2999. });
  3000. };
  3001. });
  3002. var require_primitive_set = __commonJS(function(exports, module) {
  3003. 'use strict';
  3004. var forEach = Array.prototype.forEach;
  3005. var create = Object.create;
  3006. module.exports = function(arg) {
  3007. var set = create(null);
  3008. forEach.call(arguments, function(name) {
  3009. set[name] = true;
  3010. });
  3011. return set;
  3012. };
  3013. });
  3014. var require_is_callable = __commonJS(function(exports, module) {
  3015. 'use strict';
  3016. module.exports = function(obj) {
  3017. return typeof obj === 'function';
  3018. };
  3019. });
  3020. var require_validate_stringifiable = __commonJS(function(exports, module) {
  3021. 'use strict';
  3022. var isCallable = require_is_callable();
  3023. module.exports = function(stringifiable) {
  3024. try {
  3025. if (stringifiable && isCallable(stringifiable.toString)) {
  3026. return stringifiable.toString();
  3027. }
  3028. return String(stringifiable);
  3029. } catch (e) {
  3030. throw new TypeError('Passed argument cannot be stringifed');
  3031. }
  3032. };
  3033. });
  3034. var require_validate_stringifiable_value = __commonJS(function(exports, module) {
  3035. 'use strict';
  3036. var ensureValue = require_valid_value();
  3037. var stringifiable = require_validate_stringifiable();
  3038. module.exports = function(value) {
  3039. return stringifiable(ensureValue(value));
  3040. };
  3041. });
  3042. var require_safe_to_string = __commonJS(function(exports, module) {
  3043. 'use strict';
  3044. var isCallable = require_is_callable();
  3045. module.exports = function(value) {
  3046. try {
  3047. if (value && isCallable(value.toString)) {
  3048. return value.toString();
  3049. }
  3050. return String(value);
  3051. } catch (e) {
  3052. return '<Non-coercible to string value>';
  3053. }
  3054. };
  3055. });
  3056. var require_to_short_string_representation = __commonJS(function(exports, module) {
  3057. 'use strict';
  3058. var safeToString = require_safe_to_string();
  3059. var reNewLine = /[\n\r\u2028\u2029]/g;
  3060. module.exports = function(value) {
  3061. var string = safeToString(value);
  3062. if (string.length > 100) {
  3063. string = string.slice(0, 99) + '\u2026';
  3064. }
  3065. string = string.replace(reNewLine, function(_char) {
  3066. return JSON.stringify(_char).slice(1, -1);
  3067. });
  3068. return string;
  3069. };
  3070. });
  3071. var require_is_promise = __commonJS(function(exports, module) {
  3072. module.exports = isPromise;
  3073. module.exports['default'] = isPromise;
  3074. function isPromise(obj) {
  3075. return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  3076. }
  3077. });
  3078. var require_promise = __commonJS(function() {
  3079. 'use strict';
  3080. var objectMap = require_map();
  3081. var primitiveSet = require_primitive_set();
  3082. var ensureString = require_validate_stringifiable_value();
  3083. var toShortString = require_to_short_string_representation();
  3084. var isPromise = require_is_promise();
  3085. var nextTick = require_next_tick();
  3086. var create = Object.create;
  3087. var supportedModes = primitiveSet('then', 'then:finally', 'done', 'done:finally');
  3088. require_registered_extensions().promise = function(mode, conf) {
  3089. var waiting = create(null), cache2 = create(null), promises = create(null);
  3090. if (mode === true) {
  3091. mode = null;
  3092. } else {
  3093. mode = ensureString(mode);
  3094. if (!supportedModes[mode]) {
  3095. throw new TypeError('\'' + toShortString(mode) + '\' is not valid promise mode');
  3096. }
  3097. }
  3098. conf.on('set', function(id, ignore, promise) {
  3099. var isFailed = false;
  3100. if (!isPromise(promise)) {
  3101. cache2[id] = promise;
  3102. conf.emit('setasync', id, 1);
  3103. return;
  3104. }
  3105. waiting[id] = 1;
  3106. promises[id] = promise;
  3107. var onSuccess = function onSuccess(result) {
  3108. var count = waiting[id];
  3109. if (isFailed) {
  3110. throw new Error('Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in \'done:finally\' mode)\nConsider to rely on \'then\' or \'done\' mode instead.');
  3111. }
  3112. if (!count) {
  3113. return;
  3114. }
  3115. delete waiting[id];
  3116. cache2[id] = result;
  3117. conf.emit('setasync', id, count);
  3118. };
  3119. var onFailure = function onFailure() {
  3120. isFailed = true;
  3121. if (!waiting[id]) {
  3122. return;
  3123. }
  3124. delete waiting[id];
  3125. delete promises[id];
  3126. conf['delete'](id);
  3127. };
  3128. var resolvedMode = mode;
  3129. if (!resolvedMode) {
  3130. resolvedMode = 'then';
  3131. }
  3132. if (resolvedMode === 'then') {
  3133. var nextTickFailure = function nextTickFailure() {
  3134. nextTick(onFailure);
  3135. };
  3136. promise = promise.then(function(result) {
  3137. nextTick(onSuccess.bind(this, result));
  3138. }, nextTickFailure);
  3139. if (typeof promise['finally'] === 'function') {
  3140. promise['finally'](nextTickFailure);
  3141. }
  3142. } else if (resolvedMode === 'done') {
  3143. if (typeof promise.done !== 'function') {
  3144. throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done\' mode');
  3145. }
  3146. promise.done(onSuccess, onFailure);
  3147. } else if (resolvedMode === 'done:finally') {
  3148. if (typeof promise.done !== 'function') {
  3149. throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done:finally\' mode');
  3150. }
  3151. if (typeof promise['finally'] !== 'function') {
  3152. throw new Error('Memoizee error: Retrieved promise does not implement \'finally\' in \'done:finally\' mode');
  3153. }
  3154. promise.done(onSuccess);
  3155. promise['finally'](onFailure);
  3156. }
  3157. });
  3158. conf.on('get', function(id, args, context) {
  3159. var promise;
  3160. if (waiting[id]) {
  3161. ++waiting[id];
  3162. return;
  3163. }
  3164. promise = promises[id];
  3165. var emit = function emit() {
  3166. conf.emit('getasync', id, args, context);
  3167. };
  3168. if (isPromise(promise)) {
  3169. if (typeof promise.done === 'function') {
  3170. promise.done(emit);
  3171. } else {
  3172. promise.then(function() {
  3173. nextTick(emit);
  3174. });
  3175. }
  3176. } else {
  3177. emit();
  3178. }
  3179. });
  3180. conf.on('delete', function(id) {
  3181. delete promises[id];
  3182. if (waiting[id]) {
  3183. delete waiting[id];
  3184. return;
  3185. }
  3186. if (!hasOwnProperty.call(cache2, id)) {
  3187. return;
  3188. }
  3189. var result = cache2[id];
  3190. delete cache2[id];
  3191. conf.emit('deleteasync', id, [ result ]);
  3192. });
  3193. conf.on('clear', function() {
  3194. var oldCache = cache2;
  3195. cache2 = create(null);
  3196. waiting = create(null);
  3197. promises = create(null);
  3198. conf.emit('clearasync', objectMap(oldCache, function(data2) {
  3199. return [ data2 ];
  3200. }));
  3201. });
  3202. };
  3203. });
  3204. var require_dispose = __commonJS(function() {
  3205. 'use strict';
  3206. var callable = require_valid_callable();
  3207. var forEach = require_for_each();
  3208. var extensions = require_registered_extensions();
  3209. var apply = Function.prototype.apply;
  3210. extensions.dispose = function(dispose, conf, options) {
  3211. var del;
  3212. callable(dispose);
  3213. if (options.async && extensions.async || options.promise && extensions.promise) {
  3214. conf.on('deleteasync', del = function del(id, resultArray) {
  3215. apply.call(dispose, null, resultArray);
  3216. });
  3217. conf.on('clearasync', function(cache2) {
  3218. forEach(cache2, function(result, id) {
  3219. del(id, result);
  3220. });
  3221. });
  3222. return;
  3223. }
  3224. conf.on('delete', del = function del(id, result) {
  3225. dispose(result);
  3226. });
  3227. conf.on('clear', function(cache2) {
  3228. forEach(cache2, function(result, id) {
  3229. del(id, result);
  3230. });
  3231. });
  3232. };
  3233. });
  3234. var require_max_timeout = __commonJS(function(exports, module) {
  3235. 'use strict';
  3236. module.exports = 2147483647;
  3237. });
  3238. var require_valid_timeout = __commonJS(function(exports, module) {
  3239. 'use strict';
  3240. var toPosInt = require_to_pos_integer();
  3241. var maxTimeout = require_max_timeout();
  3242. module.exports = function(value) {
  3243. value = toPosInt(value);
  3244. if (value > maxTimeout) {
  3245. throw new TypeError(value + ' exceeds maximum possible timeout');
  3246. }
  3247. return value;
  3248. };
  3249. });
  3250. var require_max_age = __commonJS(function() {
  3251. 'use strict';
  3252. var aFrom = require_from();
  3253. var forEach = require_for_each();
  3254. var nextTick = require_next_tick();
  3255. var isPromise = require_is_promise();
  3256. var timeout = require_valid_timeout();
  3257. var extensions = require_registered_extensions();
  3258. var noop3 = Function.prototype;
  3259. var max = Math.max;
  3260. var min = Math.min;
  3261. var create = Object.create;
  3262. extensions.maxAge = function(maxAge, conf, options) {
  3263. var timeouts, postfix, preFetchAge, preFetchTimeouts;
  3264. maxAge = timeout(maxAge);
  3265. if (!maxAge) {
  3266. return;
  3267. }
  3268. timeouts = create(null);
  3269. postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
  3270. conf.on('set' + postfix, function(id) {
  3271. timeouts[id] = setTimeout(function() {
  3272. conf['delete'](id);
  3273. }, maxAge);
  3274. if (typeof timeouts[id].unref === 'function') {
  3275. timeouts[id].unref();
  3276. }
  3277. if (!preFetchTimeouts) {
  3278. return;
  3279. }
  3280. if (preFetchTimeouts[id]) {
  3281. if (preFetchTimeouts[id] !== 'nextTick') {
  3282. clearTimeout(preFetchTimeouts[id]);
  3283. }
  3284. }
  3285. preFetchTimeouts[id] = setTimeout(function() {
  3286. delete preFetchTimeouts[id];
  3287. }, preFetchAge);
  3288. if (typeof preFetchTimeouts[id].unref === 'function') {
  3289. preFetchTimeouts[id].unref();
  3290. }
  3291. });
  3292. conf.on('delete' + postfix, function(id) {
  3293. clearTimeout(timeouts[id]);
  3294. delete timeouts[id];
  3295. if (!preFetchTimeouts) {
  3296. return;
  3297. }
  3298. if (preFetchTimeouts[id] !== 'nextTick') {
  3299. clearTimeout(preFetchTimeouts[id]);
  3300. }
  3301. delete preFetchTimeouts[id];
  3302. });
  3303. if (options.preFetch) {
  3304. if (options.preFetch === true || isNaN(options.preFetch)) {
  3305. preFetchAge = .333;
  3306. } else {
  3307. preFetchAge = max(min(Number(options.preFetch), 1), 0);
  3308. }
  3309. if (preFetchAge) {
  3310. preFetchTimeouts = {};
  3311. preFetchAge = (1 - preFetchAge) * maxAge;
  3312. conf.on('get' + postfix, function(id, args, context) {
  3313. if (!preFetchTimeouts[id]) {
  3314. preFetchTimeouts[id] = 'nextTick';
  3315. nextTick(function() {
  3316. var result;
  3317. if (preFetchTimeouts[id] !== 'nextTick') {
  3318. return;
  3319. }
  3320. delete preFetchTimeouts[id];
  3321. conf['delete'](id);
  3322. if (options.async) {
  3323. args = aFrom(args);
  3324. args.push(noop3);
  3325. }
  3326. result = conf.memoized.apply(context, args);
  3327. if (options.promise) {
  3328. if (isPromise(result)) {
  3329. if (typeof result.done === 'function') {
  3330. result.done(noop3, noop3);
  3331. } else {
  3332. result.then(noop3, noop3);
  3333. }
  3334. }
  3335. }
  3336. });
  3337. }
  3338. });
  3339. }
  3340. }
  3341. conf.on('clear' + postfix, function() {
  3342. forEach(timeouts, function(id) {
  3343. clearTimeout(id);
  3344. });
  3345. timeouts = {};
  3346. if (preFetchTimeouts) {
  3347. forEach(preFetchTimeouts, function(id) {
  3348. if (id !== 'nextTick') {
  3349. clearTimeout(id);
  3350. }
  3351. });
  3352. preFetchTimeouts = {};
  3353. }
  3354. });
  3355. };
  3356. });
  3357. var require_lru_queue = __commonJS(function(exports, module) {
  3358. 'use strict';
  3359. var toPosInt = require_to_pos_integer();
  3360. var create = Object.create;
  3361. var hasOwnProperty2 = Object.prototype.hasOwnProperty;
  3362. module.exports = function(limit) {
  3363. var size = 0, base = 1, queue2 = create(null), map = create(null), index = 0, del;
  3364. limit = toPosInt(limit);
  3365. return {
  3366. hit: function hit(id) {
  3367. var oldIndex = map[id], nuIndex = ++index;
  3368. queue2[nuIndex] = id;
  3369. map[id] = nuIndex;
  3370. if (!oldIndex) {
  3371. ++size;
  3372. if (size <= limit) {
  3373. return;
  3374. }
  3375. id = queue2[base];
  3376. del(id);
  3377. return id;
  3378. }
  3379. delete queue2[oldIndex];
  3380. if (base !== oldIndex) {
  3381. return;
  3382. }
  3383. while (!hasOwnProperty2.call(queue2, ++base)) {
  3384. continue;
  3385. }
  3386. },
  3387. delete: del = function del(id) {
  3388. var oldIndex = map[id];
  3389. if (!oldIndex) {
  3390. return;
  3391. }
  3392. delete queue2[oldIndex];
  3393. delete map[id];
  3394. --size;
  3395. if (base !== oldIndex) {
  3396. return;
  3397. }
  3398. if (!size) {
  3399. index = 0;
  3400. base = 1;
  3401. return;
  3402. }
  3403. while (!hasOwnProperty2.call(queue2, ++base)) {
  3404. continue;
  3405. }
  3406. },
  3407. clear: function clear() {
  3408. size = 0;
  3409. base = 1;
  3410. queue2 = create(null);
  3411. map = create(null);
  3412. index = 0;
  3413. }
  3414. };
  3415. };
  3416. });
  3417. var require_max = __commonJS(function() {
  3418. 'use strict';
  3419. var toPosInteger = require_to_pos_integer();
  3420. var lruQueue = require_lru_queue();
  3421. var extensions = require_registered_extensions();
  3422. extensions.max = function(max, conf, options) {
  3423. var postfix, queue2, hit;
  3424. max = toPosInteger(max);
  3425. if (!max) {
  3426. return;
  3427. }
  3428. queue2 = lruQueue(max);
  3429. postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
  3430. conf.on('set' + postfix, hit = function hit(id) {
  3431. id = queue2.hit(id);
  3432. if (id === void 0) {
  3433. return;
  3434. }
  3435. conf['delete'](id);
  3436. });
  3437. conf.on('get' + postfix, hit);
  3438. conf.on('delete' + postfix, queue2['delete']);
  3439. conf.on('clear' + postfix, queue2.clear);
  3440. };
  3441. });
  3442. var require_ref_counter = __commonJS(function() {
  3443. 'use strict';
  3444. var d = require_d();
  3445. var extensions = require_registered_extensions();
  3446. var create = Object.create;
  3447. var defineProperties = Object.defineProperties;
  3448. extensions.refCounter = function(ignore, conf, options) {
  3449. var cache2, postfix;
  3450. cache2 = create(null);
  3451. postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
  3452. conf.on('set' + postfix, function(id, length) {
  3453. cache2[id] = length || 1;
  3454. });
  3455. conf.on('get' + postfix, function(id) {
  3456. ++cache2[id];
  3457. });
  3458. conf.on('delete' + postfix, function(id) {
  3459. delete cache2[id];
  3460. });
  3461. conf.on('clear' + postfix, function() {
  3462. cache2 = {};
  3463. });
  3464. defineProperties(conf.memoized, {
  3465. deleteRef: d(function() {
  3466. var id = conf.get(arguments);
  3467. if (id === null) {
  3468. return null;
  3469. }
  3470. if (!cache2[id]) {
  3471. return null;
  3472. }
  3473. if (!--cache2[id]) {
  3474. conf['delete'](id);
  3475. return true;
  3476. }
  3477. return false;
  3478. }),
  3479. getRefCount: d(function() {
  3480. var id = conf.get(arguments);
  3481. if (id === null) {
  3482. return 0;
  3483. }
  3484. if (!cache2[id]) {
  3485. return 0;
  3486. }
  3487. return cache2[id];
  3488. })
  3489. });
  3490. };
  3491. });
  3492. var require_memoizee = __commonJS(function(exports, module) {
  3493. 'use strict';
  3494. var normalizeOpts = require_normalize_options();
  3495. var resolveLength = require_resolve_length();
  3496. var plain = require_plain();
  3497. module.exports = function(fn) {
  3498. var options = normalizeOpts(arguments[1]), length;
  3499. if (!options.normalizer) {
  3500. length = options.length = resolveLength(options.length, fn.length, options.async);
  3501. if (length !== 0) {
  3502. if (options.primitive) {
  3503. if (length === false) {
  3504. options.normalizer = require_primitive();
  3505. } else if (length > 1) {
  3506. options.normalizer = require_get_primitive_fixed()(length);
  3507. }
  3508. } else if (length === false) {
  3509. options.normalizer = require_get()();
  3510. } else if (length === 1) {
  3511. options.normalizer = require_get_1()();
  3512. } else {
  3513. options.normalizer = require_get_fixed()(length);
  3514. }
  3515. }
  3516. }
  3517. if (options.async) {
  3518. require_async();
  3519. }
  3520. if (options.promise) {
  3521. require_promise();
  3522. }
  3523. if (options.dispose) {
  3524. require_dispose();
  3525. }
  3526. if (options.maxAge) {
  3527. require_max_age();
  3528. }
  3529. if (options.max) {
  3530. require_max();
  3531. }
  3532. if (options.refCounter) {
  3533. require_ref_counter();
  3534. }
  3535. return plain(fn, options);
  3536. };
  3537. });
  3538. var require_doT = __commonJS(function(exports, module) {
  3539. (function() {
  3540. 'use strict';
  3541. var doT3 = {
  3542. name: 'doT',
  3543. version: '1.1.1',
  3544. templateSettings: {
  3545. evaluate: /\{\{([\s\S]+?(\}?)+)\}\}/g,
  3546. interpolate: /\{\{=([\s\S]+?)\}\}/g,
  3547. encode: /\{\{!([\s\S]+?)\}\}/g,
  3548. use: /\{\{#([\s\S]+?)\}\}/g,
  3549. useParams: /(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,
  3550. define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,
  3551. defineParams: /^\s*([\w$]+):([\s\S]+)/,
  3552. conditional: /\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,
  3553. iterate: /\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,
  3554. varname: 'it',
  3555. strip: true,
  3556. append: true,
  3557. selfcontained: false,
  3558. doNotSkipEncoded: false
  3559. },
  3560. template: void 0,
  3561. compile: void 0,
  3562. log: true
  3563. };
  3564. (function() {
  3565. if ((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) === 'object') {
  3566. return;
  3567. }
  3568. try {
  3569. Object.defineProperty(Object.prototype, '__magic__', {
  3570. get: function get() {
  3571. return this;
  3572. },
  3573. configurable: true
  3574. });
  3575. __magic__.globalThis = __magic__;
  3576. delete Object.prototype.__magic__;
  3577. } catch (e) {
  3578. window.globalThis = function() {
  3579. if (typeof self !== 'undefined') {
  3580. return self;
  3581. }
  3582. if (typeof window !== 'undefined') {
  3583. return window;
  3584. }
  3585. if (typeof global !== 'undefined') {
  3586. return global;
  3587. }
  3588. if (typeof this !== 'undefined') {
  3589. return this;
  3590. }
  3591. throw new Error('Unable to locate global `this`');
  3592. }();
  3593. }
  3594. })();
  3595. doT3.encodeHTMLSource = function(doNotSkipEncoded) {
  3596. var encodeHTMLRules = {
  3597. '&': '&#38;',
  3598. '<': '&#60;',
  3599. '>': '&#62;',
  3600. '"': '&#34;',
  3601. '\'': '&#39;',
  3602. '/': '&#47;'
  3603. }, matchHTML = doNotSkipEncoded ? /[&<>"'\/]/g : /&(?!#?\w+;)|<|>|"|'|\//g;
  3604. return function(code) {
  3605. return code ? code.toString().replace(matchHTML, function(m) {
  3606. return encodeHTMLRules[m] || m;
  3607. }) : '';
  3608. };
  3609. };
  3610. if (typeof module !== 'undefined' && module.exports) {
  3611. module.exports = doT3;
  3612. } else if (typeof define === 'function' && define.amd) {
  3613. define(function() {
  3614. return doT3;
  3615. });
  3616. } else {
  3617. globalThis.doT = doT3;
  3618. }
  3619. var startend = {
  3620. append: {
  3621. start: '\'+(',
  3622. end: ')+\'',
  3623. startencode: '\'+encodeHTML('
  3624. },
  3625. split: {
  3626. start: '\';out+=(',
  3627. end: ');out+=\'',
  3628. startencode: '\';out+=encodeHTML('
  3629. }
  3630. }, skip = /$^/;
  3631. function resolveDefs(c, block, def) {
  3632. return (typeof block === 'string' ? block : block.toString()).replace(c.define || skip, function(m, code, assign, value) {
  3633. if (code.indexOf('def.') === 0) {
  3634. code = code.substring(4);
  3635. }
  3636. if (!(code in def)) {
  3637. if (assign === ':') {
  3638. if (c.defineParams) {
  3639. value.replace(c.defineParams, function(m2, param, v) {
  3640. def[code] = {
  3641. arg: param,
  3642. text: v
  3643. };
  3644. });
  3645. }
  3646. if (!(code in def)) {
  3647. def[code] = value;
  3648. }
  3649. } else {
  3650. new Function('def', 'def[\'' + code + '\']=' + value)(def);
  3651. }
  3652. }
  3653. return '';
  3654. }).replace(c.use || skip, function(m, code) {
  3655. if (c.useParams) {
  3656. code = code.replace(c.useParams, function(m2, s, d, param) {
  3657. if (def[d] && def[d].arg && param) {
  3658. var rw = (d + ':' + param).replace(/'|\\/g, '_');
  3659. def.__exp = def.__exp || {};
  3660. def.__exp[rw] = def[d].text.replace(new RegExp('(^|[^\\w$])' + def[d].arg + '([^\\w$])', 'g'), '$1' + param + '$2');
  3661. return s + 'def.__exp[\'' + rw + '\']';
  3662. }
  3663. });
  3664. }
  3665. var v = new Function('def', 'return ' + code)(def);
  3666. return v ? resolveDefs(c, v, def) : v;
  3667. });
  3668. }
  3669. function unescape(code) {
  3670. return code.replace(/\\('|\\)/g, '$1').replace(/[\r\t\n]/g, ' ');
  3671. }
  3672. doT3.template = function(tmpl, c, def) {
  3673. c = c || doT3.templateSettings;
  3674. var cse = c.append ? startend.append : startend.split, needhtmlencode, sid = 0, indv, str = c.use || c.define ? resolveDefs(c, tmpl, def || {}) : tmpl;
  3675. str = ('var out=\'' + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g, ' ').replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g, '') : str).replace(/'|\\/g, '\\$&').replace(c.interpolate || skip, function(m, code) {
  3676. return cse.start + unescape(code) + cse.end;
  3677. }).replace(c.encode || skip, function(m, code) {
  3678. needhtmlencode = true;
  3679. return cse.startencode + unescape(code) + cse.end;
  3680. }).replace(c.conditional || skip, function(m, elsecase, code) {
  3681. return elsecase ? code ? '\';}else if(' + unescape(code) + '){out+=\'' : '\';}else{out+=\'' : code ? '\';if(' + unescape(code) + '){out+=\'' : '\';}out+=\'';
  3682. }).replace(c.iterate || skip, function(m, iterate, vname, iname) {
  3683. if (!iterate) {
  3684. return '\';} } out+=\'';
  3685. }
  3686. sid += 1;
  3687. indv = iname || 'i' + sid;
  3688. iterate = unescape(iterate);
  3689. return '\';var arr' + sid + '=' + iterate + ';if(arr' + sid + '){var ' + vname + ',' + indv + '=-1,l' + sid + '=arr' + sid + '.length-1;while(' + indv + '<l' + sid + '){' + vname + '=arr' + sid + '[' + indv + '+=1];out+=\'';
  3690. }).replace(c.evaluate || skip, function(m, code) {
  3691. return '\';' + unescape(code) + 'out+=\'';
  3692. }) + '\';return out;').replace(/\n/g, '\\n').replace(/\t/g, '\\t').replace(/\r/g, '\\r').replace(/(\s|;|\}|^|\{)out\+='';/g, '$1').replace(/\+''/g, '');
  3693. if (needhtmlencode) {
  3694. if (!c.selfcontained && globalThis && !globalThis._encodeHTML) {
  3695. globalThis._encodeHTML = doT3.encodeHTMLSource(c.doNotSkipEncoded);
  3696. }
  3697. str = 'var encodeHTML = typeof _encodeHTML !== \'undefined\' ? _encodeHTML : (' + doT3.encodeHTMLSource.toString() + '(' + (c.doNotSkipEncoded || '') + '));' + str;
  3698. }
  3699. try {
  3700. return new Function(c.varname, str);
  3701. } catch (e) {
  3702. if (typeof console !== 'undefined') {
  3703. console.log('Could not create a template function: ' + str);
  3704. }
  3705. throw e;
  3706. }
  3707. };
  3708. doT3.compile = function(tmpl, def) {
  3709. return doT3.template(tmpl, null, def);
  3710. };
  3711. })();
  3712. });
  3713. var require_es6_promise = __commonJS(function(exports, module) {
  3714. (function(global2, factory) {
  3715. _typeof(exports) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global2.ES6Promise = factory();
  3716. })(exports, function() {
  3717. 'use strict';
  3718. function objectOrFunction(x) {
  3719. var type = _typeof(x);
  3720. return x !== null && (type === 'object' || type === 'function');
  3721. }
  3722. function isFunction(x) {
  3723. return typeof x === 'function';
  3724. }
  3725. var _isArray = void 0;
  3726. if (Array.isArray) {
  3727. _isArray = Array.isArray;
  3728. } else {
  3729. _isArray = function _isArray(x) {
  3730. return Object.prototype.toString.call(x) === '[object Array]';
  3731. };
  3732. }
  3733. var isArray = _isArray;
  3734. var len = 0;
  3735. var vertxNext = void 0;
  3736. var customSchedulerFn = void 0;
  3737. var asap = function asap2(callback, arg) {
  3738. queue2[len] = callback;
  3739. queue2[len + 1] = arg;
  3740. len += 2;
  3741. if (len === 2) {
  3742. if (customSchedulerFn) {
  3743. customSchedulerFn(flush);
  3744. } else {
  3745. scheduleFlush();
  3746. }
  3747. }
  3748. };
  3749. function setScheduler(scheduleFn) {
  3750. customSchedulerFn = scheduleFn;
  3751. }
  3752. function setAsap(asapFn) {
  3753. asap = asapFn;
  3754. }
  3755. var browserWindow = typeof window !== 'undefined' ? window : void 0;
  3756. var browserGlobal = browserWindow || {};
  3757. var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
  3758. var isNode2 = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
  3759. var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
  3760. function useNextTick() {
  3761. return function() {
  3762. return process.nextTick(flush);
  3763. };
  3764. }
  3765. function useVertxTimer() {
  3766. if (typeof vertxNext !== 'undefined') {
  3767. return function() {
  3768. vertxNext(flush);
  3769. };
  3770. }
  3771. return useSetTimeout();
  3772. }
  3773. function useMutationObserver() {
  3774. var iterations = 0;
  3775. var observer = new BrowserMutationObserver(flush);
  3776. var node = document.createTextNode('');
  3777. observer.observe(node, {
  3778. characterData: true
  3779. });
  3780. return function() {
  3781. node.data = iterations = ++iterations % 2;
  3782. };
  3783. }
  3784. function useMessageChannel() {
  3785. var channel = new MessageChannel();
  3786. channel.port1.onmessage = flush;
  3787. return function() {
  3788. return channel.port2.postMessage(0);
  3789. };
  3790. }
  3791. function useSetTimeout() {
  3792. var globalSetTimeout = setTimeout;
  3793. return function() {
  3794. return globalSetTimeout(flush, 1);
  3795. };
  3796. }
  3797. var queue2 = new Array(1e3);
  3798. function flush() {
  3799. for (var i = 0; i < len; i += 2) {
  3800. var callback = queue2[i];
  3801. var arg = queue2[i + 1];
  3802. callback(arg);
  3803. queue2[i] = void 0;
  3804. queue2[i + 1] = void 0;
  3805. }
  3806. len = 0;
  3807. }
  3808. function attemptVertx() {
  3809. try {
  3810. var vertx = Function('return this')().require('vertx');
  3811. vertxNext = vertx.runOnLoop || vertx.runOnContext;
  3812. return useVertxTimer();
  3813. } catch (e) {
  3814. return useSetTimeout();
  3815. }
  3816. }
  3817. var scheduleFlush = void 0;
  3818. if (isNode2) {
  3819. scheduleFlush = useNextTick();
  3820. } else if (BrowserMutationObserver) {
  3821. scheduleFlush = useMutationObserver();
  3822. } else if (isWorker) {
  3823. scheduleFlush = useMessageChannel();
  3824. } else if (browserWindow === void 0 && true) {
  3825. scheduleFlush = attemptVertx();
  3826. } else {
  3827. scheduleFlush = useSetTimeout();
  3828. }
  3829. function then(onFulfillment, onRejection) {
  3830. var parent = this;
  3831. var child = new this.constructor(noop3);
  3832. if (child[PROMISE_ID] === void 0) {
  3833. makePromise(child);
  3834. }
  3835. var _state = parent._state;
  3836. if (_state) {
  3837. var callback = arguments[_state - 1];
  3838. asap(function() {
  3839. return invokeCallback(_state, child, callback, parent._result);
  3840. });
  3841. } else {
  3842. subscribe2(parent, child, onFulfillment, onRejection);
  3843. }
  3844. return child;
  3845. }
  3846. function resolve$1(object) {
  3847. var Constructor = this;
  3848. if (object && _typeof(object) === 'object' && object.constructor === Constructor) {
  3849. return object;
  3850. }
  3851. var promise = new Constructor(noop3);
  3852. resolve(promise, object);
  3853. return promise;
  3854. }
  3855. var PROMISE_ID = Math.random().toString(36).substring(2);
  3856. function noop3() {}
  3857. var PENDING = void 0;
  3858. var FULFILLED = 1;
  3859. var REJECTED = 2;
  3860. function selfFulfillment() {
  3861. return new TypeError('You cannot resolve a promise with itself');
  3862. }
  3863. function cannotReturnOwn() {
  3864. return new TypeError('A promises callback cannot return that same promise.');
  3865. }
  3866. function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
  3867. try {
  3868. then$$1.call(value, fulfillmentHandler, rejectionHandler);
  3869. } catch (e) {
  3870. return e;
  3871. }
  3872. }
  3873. function handleForeignThenable(promise, thenable, then$$1) {
  3874. asap(function(promise2) {
  3875. var sealed = false;
  3876. var error = tryThen(then$$1, thenable, function(value) {
  3877. if (sealed) {
  3878. return;
  3879. }
  3880. sealed = true;
  3881. if (thenable !== value) {
  3882. resolve(promise2, value);
  3883. } else {
  3884. fulfill(promise2, value);
  3885. }
  3886. }, function(reason) {
  3887. if (sealed) {
  3888. return;
  3889. }
  3890. sealed = true;
  3891. reject(promise2, reason);
  3892. }, 'Settle: ' + (promise2._label || ' unknown promise'));
  3893. if (!sealed && error) {
  3894. sealed = true;
  3895. reject(promise2, error);
  3896. }
  3897. }, promise);
  3898. }
  3899. function handleOwnThenable(promise, thenable) {
  3900. if (thenable._state === FULFILLED) {
  3901. fulfill(promise, thenable._result);
  3902. } else if (thenable._state === REJECTED) {
  3903. reject(promise, thenable._result);
  3904. } else {
  3905. subscribe2(thenable, void 0, function(value) {
  3906. return resolve(promise, value);
  3907. }, function(reason) {
  3908. return reject(promise, reason);
  3909. });
  3910. }
  3911. }
  3912. function handleMaybeThenable(promise, maybeThenable, then$$1) {
  3913. if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
  3914. handleOwnThenable(promise, maybeThenable);
  3915. } else {
  3916. if (then$$1 === void 0) {
  3917. fulfill(promise, maybeThenable);
  3918. } else if (isFunction(then$$1)) {
  3919. handleForeignThenable(promise, maybeThenable, then$$1);
  3920. } else {
  3921. fulfill(promise, maybeThenable);
  3922. }
  3923. }
  3924. }
  3925. function resolve(promise, value) {
  3926. if (promise === value) {
  3927. reject(promise, selfFulfillment());
  3928. } else if (objectOrFunction(value)) {
  3929. var then$$1 = void 0;
  3930. try {
  3931. then$$1 = value.then;
  3932. } catch (error) {
  3933. reject(promise, error);
  3934. return;
  3935. }
  3936. handleMaybeThenable(promise, value, then$$1);
  3937. } else {
  3938. fulfill(promise, value);
  3939. }
  3940. }
  3941. function publishRejection(promise) {
  3942. if (promise._onerror) {
  3943. promise._onerror(promise._result);
  3944. }
  3945. publish(promise);
  3946. }
  3947. function fulfill(promise, value) {
  3948. if (promise._state !== PENDING) {
  3949. return;
  3950. }
  3951. promise._result = value;
  3952. promise._state = FULFILLED;
  3953. if (promise._subscribers.length !== 0) {
  3954. asap(publish, promise);
  3955. }
  3956. }
  3957. function reject(promise, reason) {
  3958. if (promise._state !== PENDING) {
  3959. return;
  3960. }
  3961. promise._state = REJECTED;
  3962. promise._result = reason;
  3963. asap(publishRejection, promise);
  3964. }
  3965. function subscribe2(parent, child, onFulfillment, onRejection) {
  3966. var _subscribers = parent._subscribers;
  3967. var length = _subscribers.length;
  3968. parent._onerror = null;
  3969. _subscribers[length] = child;
  3970. _subscribers[length + FULFILLED] = onFulfillment;
  3971. _subscribers[length + REJECTED] = onRejection;
  3972. if (length === 0 && parent._state) {
  3973. asap(publish, parent);
  3974. }
  3975. }
  3976. function publish(promise) {
  3977. var subscribers = promise._subscribers;
  3978. var settled = promise._state;
  3979. if (subscribers.length === 0) {
  3980. return;
  3981. }
  3982. var child = void 0, callback = void 0, detail = promise._result;
  3983. for (var i = 0; i < subscribers.length; i += 3) {
  3984. child = subscribers[i];
  3985. callback = subscribers[i + settled];
  3986. if (child) {
  3987. invokeCallback(settled, child, callback, detail);
  3988. } else {
  3989. callback(detail);
  3990. }
  3991. }
  3992. promise._subscribers.length = 0;
  3993. }
  3994. function invokeCallback(settled, promise, callback, detail) {
  3995. var hasCallback = isFunction(callback), value = void 0, error = void 0, succeeded = true;
  3996. if (hasCallback) {
  3997. try {
  3998. value = callback(detail);
  3999. } catch (e) {
  4000. succeeded = false;
  4001. error = e;
  4002. }
  4003. if (promise === value) {
  4004. reject(promise, cannotReturnOwn());
  4005. return;
  4006. }
  4007. } else {
  4008. value = detail;
  4009. }
  4010. if (promise._state !== PENDING) {} else if (hasCallback && succeeded) {
  4011. resolve(promise, value);
  4012. } else if (succeeded === false) {
  4013. reject(promise, error);
  4014. } else if (settled === FULFILLED) {
  4015. fulfill(promise, value);
  4016. } else if (settled === REJECTED) {
  4017. reject(promise, value);
  4018. }
  4019. }
  4020. function initializePromise(promise, resolver) {
  4021. try {
  4022. resolver(function resolvePromise(value) {
  4023. resolve(promise, value);
  4024. }, function rejectPromise(reason) {
  4025. reject(promise, reason);
  4026. });
  4027. } catch (e) {
  4028. reject(promise, e);
  4029. }
  4030. }
  4031. var id = 0;
  4032. function nextId() {
  4033. return id++;
  4034. }
  4035. function makePromise(promise) {
  4036. promise[PROMISE_ID] = id++;
  4037. promise._state = void 0;
  4038. promise._result = void 0;
  4039. promise._subscribers = [];
  4040. }
  4041. function validationError() {
  4042. return new Error('Array Methods must be provided an Array');
  4043. }
  4044. var Enumerator = function() {
  4045. function Enumerator2(Constructor, input) {
  4046. this._instanceConstructor = Constructor;
  4047. this.promise = new Constructor(noop3);
  4048. if (!this.promise[PROMISE_ID]) {
  4049. makePromise(this.promise);
  4050. }
  4051. if (isArray(input)) {
  4052. this.length = input.length;
  4053. this._remaining = input.length;
  4054. this._result = new Array(this.length);
  4055. if (this.length === 0) {
  4056. fulfill(this.promise, this._result);
  4057. } else {
  4058. this.length = this.length || 0;
  4059. this._enumerate(input);
  4060. if (this._remaining === 0) {
  4061. fulfill(this.promise, this._result);
  4062. }
  4063. }
  4064. } else {
  4065. reject(this.promise, validationError());
  4066. }
  4067. }
  4068. Enumerator2.prototype._enumerate = function _enumerate(input) {
  4069. for (var i = 0; this._state === PENDING && i < input.length; i++) {
  4070. this._eachEntry(input[i], i);
  4071. }
  4072. };
  4073. Enumerator2.prototype._eachEntry = function _eachEntry(entry, i) {
  4074. var c = this._instanceConstructor;
  4075. var resolve$$1 = c.resolve;
  4076. if (resolve$$1 === resolve$1) {
  4077. var _then = void 0;
  4078. var error = void 0;
  4079. var didError = false;
  4080. try {
  4081. _then = entry.then;
  4082. } catch (e) {
  4083. didError = true;
  4084. error = e;
  4085. }
  4086. if (_then === then && entry._state !== PENDING) {
  4087. this._settledAt(entry._state, i, entry._result);
  4088. } else if (typeof _then !== 'function') {
  4089. this._remaining--;
  4090. this._result[i] = entry;
  4091. } else if (c === Promise$1) {
  4092. var promise = new c(noop3);
  4093. if (didError) {
  4094. reject(promise, error);
  4095. } else {
  4096. handleMaybeThenable(promise, entry, _then);
  4097. }
  4098. this._willSettleAt(promise, i);
  4099. } else {
  4100. this._willSettleAt(new c(function(resolve$$12) {
  4101. return resolve$$12(entry);
  4102. }), i);
  4103. }
  4104. } else {
  4105. this._willSettleAt(resolve$$1(entry), i);
  4106. }
  4107. };
  4108. Enumerator2.prototype._settledAt = function _settledAt(state, i, value) {
  4109. var promise = this.promise;
  4110. if (promise._state === PENDING) {
  4111. this._remaining--;
  4112. if (state === REJECTED) {
  4113. reject(promise, value);
  4114. } else {
  4115. this._result[i] = value;
  4116. }
  4117. }
  4118. if (this._remaining === 0) {
  4119. fulfill(promise, this._result);
  4120. }
  4121. };
  4122. Enumerator2.prototype._willSettleAt = function _willSettleAt(promise, i) {
  4123. var enumerator = this;
  4124. subscribe2(promise, void 0, function(value) {
  4125. return enumerator._settledAt(FULFILLED, i, value);
  4126. }, function(reason) {
  4127. return enumerator._settledAt(REJECTED, i, reason);
  4128. });
  4129. };
  4130. return Enumerator2;
  4131. }();
  4132. function all(entries) {
  4133. return new Enumerator(this, entries).promise;
  4134. }
  4135. function race(entries) {
  4136. var Constructor = this;
  4137. if (!isArray(entries)) {
  4138. return new Constructor(function(_, reject2) {
  4139. return reject2(new TypeError('You must pass an array to race.'));
  4140. });
  4141. } else {
  4142. return new Constructor(function(resolve2, reject2) {
  4143. var length = entries.length;
  4144. for (var i = 0; i < length; i++) {
  4145. Constructor.resolve(entries[i]).then(resolve2, reject2);
  4146. }
  4147. });
  4148. }
  4149. }
  4150. function reject$1(reason) {
  4151. var Constructor = this;
  4152. var promise = new Constructor(noop3);
  4153. reject(promise, reason);
  4154. return promise;
  4155. }
  4156. function needsResolver() {
  4157. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  4158. }
  4159. function needsNew() {
  4160. throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
  4161. }
  4162. var Promise$1 = function() {
  4163. function Promise2(resolver) {
  4164. this[PROMISE_ID] = nextId();
  4165. this._result = this._state = void 0;
  4166. this._subscribers = [];
  4167. if (noop3 !== resolver) {
  4168. typeof resolver !== 'function' && needsResolver();
  4169. this instanceof Promise2 ? initializePromise(this, resolver) : needsNew();
  4170. }
  4171. }
  4172. Promise2.prototype['catch'] = function _catch(onRejection) {
  4173. return this.then(null, onRejection);
  4174. };
  4175. Promise2.prototype['finally'] = function _finally(callback) {
  4176. var promise = this;
  4177. var constructor = promise.constructor;
  4178. if (isFunction(callback)) {
  4179. return promise.then(function(value) {
  4180. return constructor.resolve(callback()).then(function() {
  4181. return value;
  4182. });
  4183. }, function(reason) {
  4184. return constructor.resolve(callback()).then(function() {
  4185. throw reason;
  4186. });
  4187. });
  4188. }
  4189. return promise.then(callback, callback);
  4190. };
  4191. return Promise2;
  4192. }();
  4193. Promise$1.prototype.then = then;
  4194. Promise$1.all = all;
  4195. Promise$1.race = race;
  4196. Promise$1.resolve = resolve$1;
  4197. Promise$1.reject = reject$1;
  4198. Promise$1._setScheduler = setScheduler;
  4199. Promise$1._setAsap = setAsap;
  4200. Promise$1._asap = asap;
  4201. function polyfill() {
  4202. var local = void 0;
  4203. if (typeof global !== 'undefined') {
  4204. local = global;
  4205. } else if (typeof self !== 'undefined') {
  4206. local = self;
  4207. } else {
  4208. try {
  4209. local = Function('return this')();
  4210. } catch (e) {
  4211. throw new Error('polyfill failed because global object is unavailable in this environment');
  4212. }
  4213. }
  4214. var P = local.Promise;
  4215. if (P) {
  4216. var promiseToString = null;
  4217. try {
  4218. promiseToString = Object.prototype.toString.call(P.resolve());
  4219. } catch (e) {}
  4220. if (promiseToString === '[object Promise]' && !P.cast) {
  4221. return;
  4222. }
  4223. }
  4224. local.Promise = Promise$1;
  4225. }
  4226. Promise$1.polyfill = polyfill;
  4227. Promise$1.Promise = Promise$1;
  4228. return Promise$1;
  4229. });
  4230. });
  4231. var require_typedarray = __commonJS(function(exports) {
  4232. var MAX_ARRAY_LENGTH = 1e5;
  4233. var ECMAScript = function() {
  4234. var opts = Object.prototype.toString;
  4235. var ophop = Object.prototype.hasOwnProperty;
  4236. return {
  4237. Class: function Class(v) {
  4238. return opts.call(v).replace(/^\[object *|\]$/g, '');
  4239. },
  4240. HasProperty: function HasProperty(o, p) {
  4241. return p in o;
  4242. },
  4243. HasOwnProperty: function HasOwnProperty(o, p) {
  4244. return ophop.call(o, p);
  4245. },
  4246. IsCallable: function IsCallable(o) {
  4247. return typeof o === 'function';
  4248. },
  4249. ToInt32: function ToInt32(v) {
  4250. return v >> 0;
  4251. },
  4252. ToUint32: function ToUint32(v) {
  4253. return v >>> 0;
  4254. }
  4255. };
  4256. }();
  4257. var LN2 = Math.LN2;
  4258. var abs = Math.abs;
  4259. var floor = Math.floor;
  4260. var log2 = Math.log;
  4261. var min = Math.min;
  4262. var pow = Math.pow;
  4263. var round = Math.round;
  4264. function clamp2(v, minimum, max) {
  4265. return v < minimum ? minimum : v > max ? max : v;
  4266. }
  4267. var getOwnPropNames = Object.getOwnPropertyNames || function(o) {
  4268. if (o !== Object(o)) {
  4269. throw new TypeError('Object.getOwnPropertyNames called on non-object');
  4270. }
  4271. var props = [], p;
  4272. for (p in o) {
  4273. if (ECMAScript.HasOwnProperty(o, p)) {
  4274. props.push(p);
  4275. }
  4276. }
  4277. return props;
  4278. };
  4279. var defineProp;
  4280. if (Object.defineProperty && function() {
  4281. try {
  4282. Object.defineProperty({}, 'x', {});
  4283. return true;
  4284. } catch (e) {
  4285. return false;
  4286. }
  4287. }()) {
  4288. defineProp = Object.defineProperty;
  4289. } else {
  4290. defineProp = function defineProp(o, p, desc) {
  4291. if (!o === Object(o)) {
  4292. throw new TypeError('Object.defineProperty called on non-object');
  4293. }
  4294. if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) {
  4295. Object.prototype.__defineGetter__.call(o, p, desc.get);
  4296. }
  4297. if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) {
  4298. Object.prototype.__defineSetter__.call(o, p, desc.set);
  4299. }
  4300. if (ECMAScript.HasProperty(desc, 'value')) {
  4301. o[p] = desc.value;
  4302. }
  4303. return o;
  4304. };
  4305. }
  4306. function configureProperties(obj) {
  4307. if (getOwnPropNames && defineProp) {
  4308. var props = getOwnPropNames(obj), i;
  4309. for (i = 0; i < props.length; i += 1) {
  4310. defineProp(obj, props[i], {
  4311. value: obj[props[i]],
  4312. writable: false,
  4313. enumerable: false,
  4314. configurable: false
  4315. });
  4316. }
  4317. }
  4318. }
  4319. function makeArrayAccessors(obj) {
  4320. if (!defineProp) {
  4321. return;
  4322. }
  4323. if (obj.length > MAX_ARRAY_LENGTH) {
  4324. throw new RangeError('Array too large for polyfill');
  4325. }
  4326. function makeArrayAccessor(index) {
  4327. defineProp(obj, index, {
  4328. get: function get() {
  4329. return obj._getter(index);
  4330. },
  4331. set: function set(v) {
  4332. obj._setter(index, v);
  4333. },
  4334. enumerable: true,
  4335. configurable: false
  4336. });
  4337. }
  4338. var i;
  4339. for (i = 0; i < obj.length; i += 1) {
  4340. makeArrayAccessor(i);
  4341. }
  4342. }
  4343. function as_signed(value, bits) {
  4344. var s = 32 - bits;
  4345. return value << s >> s;
  4346. }
  4347. function as_unsigned(value, bits) {
  4348. var s = 32 - bits;
  4349. return value << s >>> s;
  4350. }
  4351. function packI8(n) {
  4352. return [ n & 255 ];
  4353. }
  4354. function unpackI8(bytes) {
  4355. return as_signed(bytes[0], 8);
  4356. }
  4357. function packU8(n) {
  4358. return [ n & 255 ];
  4359. }
  4360. function unpackU8(bytes) {
  4361. return as_unsigned(bytes[0], 8);
  4362. }
  4363. function packU8Clamped(n) {
  4364. n = round(Number(n));
  4365. return [ n < 0 ? 0 : n > 255 ? 255 : n & 255 ];
  4366. }
  4367. function packI16(n) {
  4368. return [ n >> 8 & 255, n & 255 ];
  4369. }
  4370. function unpackI16(bytes) {
  4371. return as_signed(bytes[0] << 8 | bytes[1], 16);
  4372. }
  4373. function packU16(n) {
  4374. return [ n >> 8 & 255, n & 255 ];
  4375. }
  4376. function unpackU16(bytes) {
  4377. return as_unsigned(bytes[0] << 8 | bytes[1], 16);
  4378. }
  4379. function packI32(n) {
  4380. return [ n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255 ];
  4381. }
  4382. function unpackI32(bytes) {
  4383. return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32);
  4384. }
  4385. function packU32(n) {
  4386. return [ n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255 ];
  4387. }
  4388. function unpackU32(bytes) {
  4389. return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32);
  4390. }
  4391. function packIEEE754(v, ebits, fbits) {
  4392. var bias = (1 << ebits - 1) - 1;
  4393. var s, e, f, i, bits, str, bytes;
  4394. function roundToEven(n) {
  4395. var w = floor(n);
  4396. var fl = n - w;
  4397. if (fl < .5) {
  4398. return w;
  4399. }
  4400. if (fl > .5) {
  4401. return w + 1;
  4402. }
  4403. return w % 2 ? w + 1 : w;
  4404. }
  4405. if (v !== v) {
  4406. e = (1 << ebits) - 1;
  4407. f = pow(2, fbits - 1);
  4408. s = 0;
  4409. } else if (v === Infinity || v === -Infinity) {
  4410. e = (1 << ebits) - 1;
  4411. f = 0;
  4412. s = v < 0 ? 1 : 0;
  4413. } else if (v === 0) {
  4414. e = 0;
  4415. f = 0;
  4416. s = 1 / v === -Infinity ? 1 : 0;
  4417. } else {
  4418. s = v < 0;
  4419. v = abs(v);
  4420. if (v >= pow(2, 1 - bias)) {
  4421. e = min(floor(log2(v) / LN2), 1023);
  4422. f = roundToEven(v / pow(2, e) * pow(2, fbits));
  4423. if (f / pow(2, fbits) >= 2) {
  4424. e = e + 1;
  4425. f = 1;
  4426. }
  4427. if (e > bias) {
  4428. e = (1 << ebits) - 1;
  4429. f = 0;
  4430. } else {
  4431. e = e + bias;
  4432. f = f - pow(2, fbits);
  4433. }
  4434. } else {
  4435. e = 0;
  4436. f = roundToEven(v / pow(2, 1 - bias - fbits));
  4437. }
  4438. }
  4439. bits = [];
  4440. for (i = fbits; i; i -= 1) {
  4441. bits.push(f % 2 ? 1 : 0);
  4442. f = floor(f / 2);
  4443. }
  4444. for (i = ebits; i; i -= 1) {
  4445. bits.push(e % 2 ? 1 : 0);
  4446. e = floor(e / 2);
  4447. }
  4448. bits.push(s ? 1 : 0);
  4449. bits.reverse();
  4450. str = bits.join('');
  4451. bytes = [];
  4452. while (str.length) {
  4453. bytes.push(parseInt(str.substring(0, 8), 2));
  4454. str = str.substring(8);
  4455. }
  4456. return bytes;
  4457. }
  4458. function unpackIEEE754(bytes, ebits, fbits) {
  4459. var bits = [], i, j, b, str, bias, s, e, f;
  4460. for (i = bytes.length; i; i -= 1) {
  4461. b = bytes[i - 1];
  4462. for (j = 8; j; j -= 1) {
  4463. bits.push(b % 2 ? 1 : 0);
  4464. b = b >> 1;
  4465. }
  4466. }
  4467. bits.reverse();
  4468. str = bits.join('');
  4469. bias = (1 << ebits - 1) - 1;
  4470. s = parseInt(str.substring(0, 1), 2) ? -1 : 1;
  4471. e = parseInt(str.substring(1, 1 + ebits), 2);
  4472. f = parseInt(str.substring(1 + ebits), 2);
  4473. if (e === (1 << ebits) - 1) {
  4474. return f === 0 ? s * Infinity : NaN;
  4475. } else if (e > 0) {
  4476. return s * pow(2, e - bias) * (1 + f / pow(2, fbits));
  4477. } else if (f !== 0) {
  4478. return s * pow(2, -(bias - 1)) * (f / pow(2, fbits));
  4479. }
  4480. return s < 0 ? -0 : 0;
  4481. }
  4482. function unpackF64(b) {
  4483. return unpackIEEE754(b, 11, 52);
  4484. }
  4485. function packF64(v) {
  4486. return packIEEE754(v, 11, 52);
  4487. }
  4488. function unpackF32(b) {
  4489. return unpackIEEE754(b, 8, 23);
  4490. }
  4491. function packF32(v) {
  4492. return packIEEE754(v, 8, 23);
  4493. }
  4494. (function() {
  4495. function ArrayBuffer(length) {
  4496. length = ECMAScript.ToInt32(length);
  4497. if (length < 0) {
  4498. throw new RangeError('ArrayBuffer size is not a small enough positive integer');
  4499. }
  4500. this.byteLength = length;
  4501. this._bytes = [];
  4502. this._bytes.length = length;
  4503. var i;
  4504. for (i = 0; i < this.byteLength; i += 1) {
  4505. this._bytes[i] = 0;
  4506. }
  4507. configureProperties(this);
  4508. }
  4509. exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer;
  4510. function ArrayBufferView() {}
  4511. function makeConstructor(bytesPerElement, pack, unpack) {
  4512. var _ctor;
  4513. _ctor = function ctor(buffer, byteOffset, length) {
  4514. var array, sequence, i, s;
  4515. if (!arguments.length || typeof arguments[0] === 'number') {
  4516. this.length = ECMAScript.ToInt32(arguments[0]);
  4517. if (length < 0) {
  4518. throw new RangeError('ArrayBufferView size is not a small enough positive integer');
  4519. }
  4520. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4521. this.buffer = new ArrayBuffer(this.byteLength);
  4522. this.byteOffset = 0;
  4523. } else if (_typeof(arguments[0]) === 'object' && arguments[0].constructor === _ctor) {
  4524. array = arguments[0];
  4525. this.length = array.length;
  4526. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4527. this.buffer = new ArrayBuffer(this.byteLength);
  4528. this.byteOffset = 0;
  4529. for (i = 0; i < this.length; i += 1) {
  4530. this._setter(i, array._getter(i));
  4531. }
  4532. } else if (_typeof(arguments[0]) === 'object' && !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
  4533. sequence = arguments[0];
  4534. this.length = ECMAScript.ToUint32(sequence.length);
  4535. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4536. this.buffer = new ArrayBuffer(this.byteLength);
  4537. this.byteOffset = 0;
  4538. for (i = 0; i < this.length; i += 1) {
  4539. s = sequence[i];
  4540. this._setter(i, Number(s));
  4541. }
  4542. } else if (_typeof(arguments[0]) === 'object' && (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
  4543. this.buffer = buffer;
  4544. this.byteOffset = ECMAScript.ToUint32(byteOffset);
  4545. if (this.byteOffset > this.buffer.byteLength) {
  4546. throw new RangeError('byteOffset out of range');
  4547. }
  4548. if (this.byteOffset % this.BYTES_PER_ELEMENT) {
  4549. throw new RangeError('ArrayBuffer length minus the byteOffset is not a multiple of the element size.');
  4550. }
  4551. if (arguments.length < 3) {
  4552. this.byteLength = this.buffer.byteLength - this.byteOffset;
  4553. if (this.byteLength % this.BYTES_PER_ELEMENT) {
  4554. throw new RangeError('length of buffer minus byteOffset not a multiple of the element size');
  4555. }
  4556. this.length = this.byteLength / this.BYTES_PER_ELEMENT;
  4557. } else {
  4558. this.length = ECMAScript.ToUint32(length);
  4559. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4560. }
  4561. if (this.byteOffset + this.byteLength > this.buffer.byteLength) {
  4562. throw new RangeError('byteOffset and length reference an area beyond the end of the buffer');
  4563. }
  4564. } else {
  4565. throw new TypeError('Unexpected argument type(s)');
  4566. }
  4567. this.constructor = _ctor;
  4568. configureProperties(this);
  4569. makeArrayAccessors(this);
  4570. };
  4571. _ctor.prototype = new ArrayBufferView();
  4572. _ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement;
  4573. _ctor.prototype._pack = pack;
  4574. _ctor.prototype._unpack = unpack;
  4575. _ctor.BYTES_PER_ELEMENT = bytesPerElement;
  4576. _ctor.prototype._getter = function(index) {
  4577. if (arguments.length < 1) {
  4578. throw new SyntaxError('Not enough arguments');
  4579. }
  4580. index = ECMAScript.ToUint32(index);
  4581. if (index >= this.length) {
  4582. return void 0;
  4583. }
  4584. var bytes = [];
  4585. for (var i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1,
  4586. o += 1) {
  4587. bytes.push(this.buffer._bytes[o]);
  4588. }
  4589. return this._unpack(bytes);
  4590. };
  4591. _ctor.prototype.get = _ctor.prototype._getter;
  4592. _ctor.prototype._setter = function(index, value) {
  4593. if (arguments.length < 2) {
  4594. throw new SyntaxError('Not enough arguments');
  4595. }
  4596. index = ECMAScript.ToUint32(index);
  4597. if (index < this.length) {
  4598. var bytes = this._pack(value);
  4599. var i;
  4600. var o;
  4601. for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1,
  4602. o += 1) {
  4603. this.buffer._bytes[o] = bytes[i];
  4604. }
  4605. }
  4606. };
  4607. _ctor.prototype.set = function(index, value) {
  4608. if (arguments.length < 1) {
  4609. throw new SyntaxError('Not enough arguments');
  4610. }
  4611. var array, sequence, offset, len, i, s, d, byteOffset, byteLength, tmp;
  4612. if (_typeof(arguments[0]) === 'object' && arguments[0].constructor === this.constructor) {
  4613. array = arguments[0];
  4614. offset = ECMAScript.ToUint32(arguments[1]);
  4615. if (offset + array.length > this.length) {
  4616. throw new RangeError('Offset plus length of array is out of range');
  4617. }
  4618. byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT;
  4619. byteLength = array.length * this.BYTES_PER_ELEMENT;
  4620. if (array.buffer === this.buffer) {
  4621. tmp = [];
  4622. for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) {
  4623. tmp[i] = array.buffer._bytes[s];
  4624. }
  4625. for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) {
  4626. this.buffer._bytes[d] = tmp[i];
  4627. }
  4628. } else {
  4629. for (i = 0, s = array.byteOffset, d = byteOffset; i < byteLength; i += 1,
  4630. s += 1, d += 1) {
  4631. this.buffer._bytes[d] = array.buffer._bytes[s];
  4632. }
  4633. }
  4634. } else if (_typeof(arguments[0]) === 'object' && typeof arguments[0].length !== 'undefined') {
  4635. sequence = arguments[0];
  4636. len = ECMAScript.ToUint32(sequence.length);
  4637. offset = ECMAScript.ToUint32(arguments[1]);
  4638. if (offset + len > this.length) {
  4639. throw new RangeError('Offset plus length of array is out of range');
  4640. }
  4641. for (i = 0; i < len; i += 1) {
  4642. s = sequence[i];
  4643. this._setter(offset + i, Number(s));
  4644. }
  4645. } else {
  4646. throw new TypeError('Unexpected argument type(s)');
  4647. }
  4648. };
  4649. _ctor.prototype.subarray = function(start, end) {
  4650. start = ECMAScript.ToInt32(start);
  4651. end = ECMAScript.ToInt32(end);
  4652. if (arguments.length < 1) {
  4653. start = 0;
  4654. }
  4655. if (arguments.length < 2) {
  4656. end = this.length;
  4657. }
  4658. if (start < 0) {
  4659. start = this.length + start;
  4660. }
  4661. if (end < 0) {
  4662. end = this.length + end;
  4663. }
  4664. start = clamp2(start, 0, this.length);
  4665. end = clamp2(end, 0, this.length);
  4666. var len = end - start;
  4667. if (len < 0) {
  4668. len = 0;
  4669. }
  4670. return new this.constructor(this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len);
  4671. };
  4672. return _ctor;
  4673. }
  4674. var Int8Array = makeConstructor(1, packI8, unpackI8);
  4675. var Uint8Array2 = makeConstructor(1, packU8, unpackU8);
  4676. var Uint8ClampedArray2 = makeConstructor(1, packU8Clamped, unpackU8);
  4677. var Int16Array = makeConstructor(2, packI16, unpackI16);
  4678. var Uint16Array = makeConstructor(2, packU16, unpackU16);
  4679. var Int32Array = makeConstructor(4, packI32, unpackI32);
  4680. var Uint32Array3 = makeConstructor(4, packU32, unpackU32);
  4681. var Float32Array = makeConstructor(4, packF32, unpackF32);
  4682. var Float64Array = makeConstructor(8, packF64, unpackF64);
  4683. exports.Int8Array = exports.Int8Array || Int8Array;
  4684. exports.Uint8Array = exports.Uint8Array || Uint8Array2;
  4685. exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray2;
  4686. exports.Int16Array = exports.Int16Array || Int16Array;
  4687. exports.Uint16Array = exports.Uint16Array || Uint16Array;
  4688. exports.Int32Array = exports.Int32Array || Int32Array;
  4689. exports.Uint32Array = exports.Uint32Array || Uint32Array3;
  4690. exports.Float32Array = exports.Float32Array || Float32Array;
  4691. exports.Float64Array = exports.Float64Array || Float64Array;
  4692. })();
  4693. (function() {
  4694. function r(array, index) {
  4695. return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index];
  4696. }
  4697. var IS_BIG_ENDIAN = function() {
  4698. var u16array = new exports.Uint16Array([ 4660 ]), u8array = new exports.Uint8Array(u16array.buffer);
  4699. return r(u8array, 0) === 18;
  4700. }();
  4701. function DataView(buffer, byteOffset, byteLength) {
  4702. if (arguments.length === 0) {
  4703. buffer = new exports.ArrayBuffer(0);
  4704. } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) {
  4705. throw new TypeError('TypeError');
  4706. }
  4707. this.buffer = buffer || new exports.ArrayBuffer(0);
  4708. this.byteOffset = ECMAScript.ToUint32(byteOffset);
  4709. if (this.byteOffset > this.buffer.byteLength) {
  4710. throw new RangeError('byteOffset out of range');
  4711. }
  4712. if (arguments.length < 3) {
  4713. this.byteLength = this.buffer.byteLength - this.byteOffset;
  4714. } else {
  4715. this.byteLength = ECMAScript.ToUint32(byteLength);
  4716. }
  4717. if (this.byteOffset + this.byteLength > this.buffer.byteLength) {
  4718. throw new RangeError('byteOffset and length reference an area beyond the end of the buffer');
  4719. }
  4720. configureProperties(this);
  4721. }
  4722. function makeGetter(arrayType) {
  4723. return function(byteOffset, littleEndian) {
  4724. byteOffset = ECMAScript.ToUint32(byteOffset);
  4725. if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
  4726. throw new RangeError('Array index out of range');
  4727. }
  4728. byteOffset += this.byteOffset;
  4729. var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), bytes = [], i;
  4730. for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
  4731. bytes.push(r(uint8Array, i));
  4732. }
  4733. if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
  4734. bytes.reverse();
  4735. }
  4736. return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0);
  4737. };
  4738. }
  4739. DataView.prototype.getUint8 = makeGetter(exports.Uint8Array);
  4740. DataView.prototype.getInt8 = makeGetter(exports.Int8Array);
  4741. DataView.prototype.getUint16 = makeGetter(exports.Uint16Array);
  4742. DataView.prototype.getInt16 = makeGetter(exports.Int16Array);
  4743. DataView.prototype.getUint32 = makeGetter(exports.Uint32Array);
  4744. DataView.prototype.getInt32 = makeGetter(exports.Int32Array);
  4745. DataView.prototype.getFloat32 = makeGetter(exports.Float32Array);
  4746. DataView.prototype.getFloat64 = makeGetter(exports.Float64Array);
  4747. function makeSetter(arrayType) {
  4748. return function(byteOffset, value, littleEndian) {
  4749. byteOffset = ECMAScript.ToUint32(byteOffset);
  4750. if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
  4751. throw new RangeError('Array index out of range');
  4752. }
  4753. var typeArray = new arrayType([ value ]), byteArray = new exports.Uint8Array(typeArray.buffer), bytes = [], i, byteView;
  4754. for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
  4755. bytes.push(r(byteArray, i));
  4756. }
  4757. if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
  4758. bytes.reverse();
  4759. }
  4760. byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT);
  4761. byteView.set(bytes);
  4762. };
  4763. }
  4764. DataView.prototype.setUint8 = makeSetter(exports.Uint8Array);
  4765. DataView.prototype.setInt8 = makeSetter(exports.Int8Array);
  4766. DataView.prototype.setUint16 = makeSetter(exports.Uint16Array);
  4767. DataView.prototype.setInt16 = makeSetter(exports.Int16Array);
  4768. DataView.prototype.setUint32 = makeSetter(exports.Uint32Array);
  4769. DataView.prototype.setInt32 = makeSetter(exports.Int32Array);
  4770. DataView.prototype.setFloat32 = makeSetter(exports.Float32Array);
  4771. DataView.prototype.setFloat64 = makeSetter(exports.Float64Array);
  4772. exports.DataView = exports.DataView || DataView;
  4773. })();
  4774. });
  4775. var require_weakmap_polyfill = __commonJS(function(exports) {
  4776. (function(self2) {
  4777. 'use strict';
  4778. if (self2.WeakMap) {
  4779. return;
  4780. }
  4781. var hasOwnProperty2 = Object.prototype.hasOwnProperty;
  4782. var hasDefine = Object.defineProperty && function() {
  4783. try {
  4784. return Object.defineProperty({}, 'x', {
  4785. value: 1
  4786. }).x === 1;
  4787. } catch (e) {}
  4788. }();
  4789. var defineProperty = function defineProperty(object, name, value) {
  4790. if (hasDefine) {
  4791. Object.defineProperty(object, name, {
  4792. configurable: true,
  4793. writable: true,
  4794. value: value
  4795. });
  4796. } else {
  4797. object[name] = value;
  4798. }
  4799. };
  4800. self2.WeakMap = function() {
  4801. function WeakMap2() {
  4802. if (this === void 0) {
  4803. throw new TypeError('Constructor WeakMap requires \'new\'');
  4804. }
  4805. defineProperty(this, '_id', genId('_WeakMap'));
  4806. if (arguments.length > 0) {
  4807. throw new TypeError('WeakMap iterable is not supported');
  4808. }
  4809. }
  4810. defineProperty(WeakMap2.prototype, 'delete', function(key) {
  4811. checkInstance(this, 'delete');
  4812. if (!isObject(key)) {
  4813. return false;
  4814. }
  4815. var entry = key[this._id];
  4816. if (entry && entry[0] === key) {
  4817. delete key[this._id];
  4818. return true;
  4819. }
  4820. return false;
  4821. });
  4822. defineProperty(WeakMap2.prototype, 'get', function(key) {
  4823. checkInstance(this, 'get');
  4824. if (!isObject(key)) {
  4825. return void 0;
  4826. }
  4827. var entry = key[this._id];
  4828. if (entry && entry[0] === key) {
  4829. return entry[1];
  4830. }
  4831. return void 0;
  4832. });
  4833. defineProperty(WeakMap2.prototype, 'has', function(key) {
  4834. checkInstance(this, 'has');
  4835. if (!isObject(key)) {
  4836. return false;
  4837. }
  4838. var entry = key[this._id];
  4839. if (entry && entry[0] === key) {
  4840. return true;
  4841. }
  4842. return false;
  4843. });
  4844. defineProperty(WeakMap2.prototype, 'set', function(key, value) {
  4845. checkInstance(this, 'set');
  4846. if (!isObject(key)) {
  4847. throw new TypeError('Invalid value used as weak map key');
  4848. }
  4849. var entry = key[this._id];
  4850. if (entry && entry[0] === key) {
  4851. entry[1] = value;
  4852. return this;
  4853. }
  4854. defineProperty(key, this._id, [ key, value ]);
  4855. return this;
  4856. });
  4857. function checkInstance(x, methodName) {
  4858. if (!isObject(x) || !hasOwnProperty2.call(x, '_id')) {
  4859. throw new TypeError(methodName + ' method called on incompatible receiver ' + _typeof(x));
  4860. }
  4861. }
  4862. function genId(prefix) {
  4863. return prefix + '_' + rand() + '.' + rand();
  4864. }
  4865. function rand() {
  4866. return Math.random().toString().substring(2);
  4867. }
  4868. defineProperty(WeakMap2, '_polyfill', true);
  4869. return WeakMap2;
  4870. }();
  4871. function isObject(x) {
  4872. return Object(x) === x;
  4873. }
  4874. })(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : exports);
  4875. });
  4876. var definitions = [ {
  4877. name: 'NA',
  4878. value: 'inapplicable',
  4879. priority: 0,
  4880. group: 'inapplicable'
  4881. }, {
  4882. name: 'PASS',
  4883. value: 'passed',
  4884. priority: 1,
  4885. group: 'passes'
  4886. }, {
  4887. name: 'CANTTELL',
  4888. value: 'cantTell',
  4889. priority: 2,
  4890. group: 'incomplete'
  4891. }, {
  4892. name: 'FAIL',
  4893. value: 'failed',
  4894. priority: 3,
  4895. group: 'violations'
  4896. } ];
  4897. var constants = {
  4898. helpUrlBase: 'https://dequeuniversity.com/rules/',
  4899. gridSize: 200,
  4900. results: [],
  4901. resultGroups: [],
  4902. resultGroupMap: {},
  4903. impact: Object.freeze([ 'minor', 'moderate', 'serious', 'critical' ]),
  4904. preload: Object.freeze({
  4905. assets: [ 'cssom', 'media' ],
  4906. timeout: 1e4
  4907. }),
  4908. allOrigins: '<unsafe_all_origins>',
  4909. sameOrigin: '<same_origin>'
  4910. };
  4911. definitions.forEach(function(definition) {
  4912. var name = definition.name;
  4913. var value = definition.value;
  4914. var priority = definition.priority;
  4915. var group = definition.group;
  4916. constants[name] = value;
  4917. constants[name + '_PRIO'] = priority;
  4918. constants[name + '_GROUP'] = group;
  4919. constants.results[priority] = value;
  4920. constants.resultGroups[priority] = group;
  4921. constants.resultGroupMap[value] = group;
  4922. });
  4923. Object.freeze(constants.results);
  4924. Object.freeze(constants.resultGroups);
  4925. Object.freeze(constants.resultGroupMap);
  4926. Object.freeze(constants);
  4927. var constants_default = constants;
  4928. function log() {
  4929. if ((typeof console === 'undefined' ? 'undefined' : _typeof(console)) === 'object' && console.log) {
  4930. Function.prototype.apply.call(console.log, console, arguments);
  4931. }
  4932. }
  4933. var log_default = log;
  4934. var whitespaceRegex = /[\t\r\n\f]/g;
  4935. var AbstractVirtualNode = function() {
  4936. function AbstractVirtualNode() {
  4937. _classCallCheck(this, AbstractVirtualNode);
  4938. this.parent = void 0;
  4939. }
  4940. _createClass(AbstractVirtualNode, [ {
  4941. key: 'props',
  4942. get: function get() {
  4943. throw new Error('VirtualNode class must have a "props" object consisting of "nodeType" and "nodeName" properties');
  4944. }
  4945. }, {
  4946. key: 'attrNames',
  4947. get: function get() {
  4948. throw new Error('VirtualNode class must have an "attrNames" property');
  4949. }
  4950. }, {
  4951. key: 'attr',
  4952. value: function attr() {
  4953. throw new Error('VirtualNode class must have an "attr" function');
  4954. }
  4955. }, {
  4956. key: 'hasAttr',
  4957. value: function hasAttr() {
  4958. throw new Error('VirtualNode class must have a "hasAttr" function');
  4959. }
  4960. }, {
  4961. key: 'hasClass',
  4962. value: function hasClass(className) {
  4963. var classAttr = this.attr('class');
  4964. if (!classAttr) {
  4965. return false;
  4966. }
  4967. var selector = ' ' + className + ' ';
  4968. return (' ' + classAttr + ' ').replace(whitespaceRegex, ' ').indexOf(selector) >= 0;
  4969. }
  4970. } ]);
  4971. return AbstractVirtualNode;
  4972. }();
  4973. var abstract_virtual_node_default = AbstractVirtualNode;
  4974. var utils_exports = {};
  4975. __export(utils_exports, {
  4976. DqElement: function DqElement() {
  4977. return dq_element_default;
  4978. },
  4979. aggregate: function aggregate() {
  4980. return aggregate_default;
  4981. },
  4982. aggregateChecks: function aggregateChecks() {
  4983. return aggregate_checks_default;
  4984. },
  4985. aggregateNodeResults: function aggregateNodeResults() {
  4986. return aggregate_node_results_default;
  4987. },
  4988. aggregateResult: function aggregateResult() {
  4989. return aggregate_result_default;
  4990. },
  4991. areStylesSet: function areStylesSet() {
  4992. return are_styles_set_default;
  4993. },
  4994. assert: function assert() {
  4995. return assert_default;
  4996. },
  4997. checkHelper: function checkHelper() {
  4998. return check_helper_default;
  4999. },
  5000. clone: function clone() {
  5001. return clone_default;
  5002. },
  5003. closest: function closest() {
  5004. return closest_default;
  5005. },
  5006. collectResultsFromFrames: function collectResultsFromFrames() {
  5007. return _collectResultsFromFrames;
  5008. },
  5009. contains: function contains() {
  5010. return _contains;
  5011. },
  5012. convertSelector: function convertSelector() {
  5013. return _convertSelector;
  5014. },
  5015. cssParser: function cssParser() {
  5016. return css_parser_default;
  5017. },
  5018. deepMerge: function deepMerge() {
  5019. return deep_merge_default;
  5020. },
  5021. escapeSelector: function escapeSelector() {
  5022. return escape_selector_default;
  5023. },
  5024. extendMetaData: function extendMetaData() {
  5025. return extend_meta_data_default;
  5026. },
  5027. filterHtmlAttrs: function filterHtmlAttrs() {
  5028. return _filterHtmlAttrs;
  5029. },
  5030. finalizeRuleResult: function finalizeRuleResult() {
  5031. return finalize_result_default;
  5032. },
  5033. findBy: function findBy() {
  5034. return find_by_default;
  5035. },
  5036. getAllChecks: function getAllChecks() {
  5037. return get_all_checks_default;
  5038. },
  5039. getAncestry: function getAncestry() {
  5040. return _getAncestry;
  5041. },
  5042. getBaseLang: function getBaseLang() {
  5043. return get_base_lang_default;
  5044. },
  5045. getCheckMessage: function getCheckMessage() {
  5046. return get_check_message_default;
  5047. },
  5048. getCheckOption: function getCheckOption() {
  5049. return get_check_option_default;
  5050. },
  5051. getEnvironmentData: function getEnvironmentData() {
  5052. return _getEnvironmentData;
  5053. },
  5054. getFlattenedTree: function getFlattenedTree() {
  5055. return get_flattened_tree_default;
  5056. },
  5057. getFrameContexts: function getFrameContexts() {
  5058. return _getFrameContexts;
  5059. },
  5060. getFriendlyUriEnd: function getFriendlyUriEnd() {
  5061. return get_friendly_uri_end_default;
  5062. },
  5063. getNodeAttributes: function getNodeAttributes() {
  5064. return get_node_attributes_default;
  5065. },
  5066. getNodeFromTree: function getNodeFromTree() {
  5067. return get_node_from_tree_default;
  5068. },
  5069. getPreloadConfig: function getPreloadConfig() {
  5070. return _getPreloadConfig;
  5071. },
  5072. getRootNode: function getRootNode() {
  5073. return get_root_node_default;
  5074. },
  5075. getRule: function getRule() {
  5076. return get_rule_default;
  5077. },
  5078. getScroll: function getScroll() {
  5079. return _getScroll;
  5080. },
  5081. getScrollState: function getScrollState() {
  5082. return get_scroll_state_default;
  5083. },
  5084. getSelector: function getSelector() {
  5085. return _getSelector;
  5086. },
  5087. getSelectorData: function getSelectorData() {
  5088. return _getSelectorData;
  5089. },
  5090. getShadowSelector: function getShadowSelector() {
  5091. return get_shadow_selector_default;
  5092. },
  5093. getStandards: function getStandards() {
  5094. return _getStandards;
  5095. },
  5096. getStyleSheetFactory: function getStyleSheetFactory() {
  5097. return get_stylesheet_factory_default;
  5098. },
  5099. getXpath: function getXpath() {
  5100. return get_xpath_default;
  5101. },
  5102. injectStyle: function injectStyle() {
  5103. return inject_style_default;
  5104. },
  5105. isHidden: function isHidden() {
  5106. return is_hidden_default;
  5107. },
  5108. isHtmlElement: function isHtmlElement() {
  5109. return is_html_element_default;
  5110. },
  5111. isNodeInContext: function isNodeInContext() {
  5112. return _isNodeInContext;
  5113. },
  5114. isShadowRoot: function isShadowRoot() {
  5115. return is_shadow_root_default;
  5116. },
  5117. isValidLang: function isValidLang() {
  5118. return valid_langs_default;
  5119. },
  5120. isXHTML: function isXHTML() {
  5121. return is_xhtml_default;
  5122. },
  5123. matchAncestry: function matchAncestry() {
  5124. return match_ancestry_default;
  5125. },
  5126. matches: function matches() {
  5127. return matches_default;
  5128. },
  5129. matchesExpression: function matchesExpression() {
  5130. return _matchesExpression;
  5131. },
  5132. matchesSelector: function matchesSelector() {
  5133. return element_matches_default;
  5134. },
  5135. memoize: function memoize() {
  5136. return memoize_default;
  5137. },
  5138. mergeResults: function mergeResults() {
  5139. return merge_results_default;
  5140. },
  5141. nodeSorter: function nodeSorter() {
  5142. return node_sorter_default;
  5143. },
  5144. parseCrossOriginStylesheet: function parseCrossOriginStylesheet() {
  5145. return parse_crossorigin_stylesheet_default;
  5146. },
  5147. parseSameOriginStylesheet: function parseSameOriginStylesheet() {
  5148. return parse_sameorigin_stylesheet_default;
  5149. },
  5150. parseStylesheet: function parseStylesheet() {
  5151. return parse_stylesheet_default;
  5152. },
  5153. performanceTimer: function performanceTimer() {
  5154. return performance_timer_default;
  5155. },
  5156. pollyfillElementsFromPoint: function pollyfillElementsFromPoint() {
  5157. return _pollyfillElementsFromPoint;
  5158. },
  5159. preload: function preload() {
  5160. return preload_default;
  5161. },
  5162. preloadCssom: function preloadCssom() {
  5163. return preload_cssom_default;
  5164. },
  5165. preloadMedia: function preloadMedia() {
  5166. return preload_media_default;
  5167. },
  5168. processMessage: function processMessage() {
  5169. return process_message_default;
  5170. },
  5171. publishMetaData: function publishMetaData() {
  5172. return publish_metadata_default;
  5173. },
  5174. querySelectorAll: function querySelectorAll() {
  5175. return query_selector_all_default;
  5176. },
  5177. querySelectorAllFilter: function querySelectorAllFilter() {
  5178. return query_selector_all_filter_default;
  5179. },
  5180. queue: function queue() {
  5181. return queue_default;
  5182. },
  5183. respondable: function respondable() {
  5184. return _respondable;
  5185. },
  5186. ruleShouldRun: function ruleShouldRun() {
  5187. return rule_should_run_default;
  5188. },
  5189. select: function select() {
  5190. return _select;
  5191. },
  5192. sendCommandToFrame: function sendCommandToFrame() {
  5193. return _sendCommandToFrame;
  5194. },
  5195. setScrollState: function setScrollState() {
  5196. return set_scroll_state_default;
  5197. },
  5198. shadowSelect: function shadowSelect() {
  5199. return _shadowSelect;
  5200. },
  5201. shadowSelectAll: function shadowSelectAll() {
  5202. return _shadowSelectAll;
  5203. },
  5204. shouldPreload: function shouldPreload() {
  5205. return _shouldPreload;
  5206. },
  5207. toArray: function toArray() {
  5208. return to_array_default;
  5209. },
  5210. tokenList: function tokenList() {
  5211. return token_list_default;
  5212. },
  5213. uniqueArray: function uniqueArray() {
  5214. return unique_array_default;
  5215. },
  5216. uuid: function uuid() {
  5217. return uuid_default;
  5218. },
  5219. validInputTypes: function validInputTypes() {
  5220. return valid_input_type_default;
  5221. },
  5222. validLangs: function validLangs() {
  5223. return _validLangs;
  5224. }
  5225. });
  5226. function aggregate(map, values, initial) {
  5227. values = values.slice();
  5228. if (initial) {
  5229. values.push(initial);
  5230. }
  5231. var sorting = values.map(function(val) {
  5232. return map.indexOf(val);
  5233. }).sort();
  5234. return map[sorting.pop()];
  5235. }
  5236. var aggregate_default = aggregate;
  5237. var CANTTELL_PRIO = constants_default.CANTTELL_PRIO, FAIL_PRIO = constants_default.FAIL_PRIO;
  5238. var checkMap = [];
  5239. checkMap[constants_default.PASS_PRIO] = true;
  5240. checkMap[constants_default.CANTTELL_PRIO] = null;
  5241. checkMap[constants_default.FAIL_PRIO] = false;
  5242. var checkTypes = [ 'any', 'all', 'none' ];
  5243. function anyAllNone(obj, functor) {
  5244. return checkTypes.reduce(function(out, type) {
  5245. out[type] = (obj[type] || []).map(function(val) {
  5246. return functor(val, type);
  5247. });
  5248. return out;
  5249. }, {});
  5250. }
  5251. function aggregateChecks(nodeResOriginal) {
  5252. var nodeResult = Object.assign({}, nodeResOriginal);
  5253. anyAllNone(nodeResult, function(check, type) {
  5254. var i = typeof check.result === 'undefined' ? -1 : checkMap.indexOf(check.result);
  5255. check.priority = i !== -1 ? i : constants_default.CANTTELL_PRIO;
  5256. if (type === 'none') {
  5257. if (check.priority === constants_default.PASS_PRIO) {
  5258. check.priority = constants_default.FAIL_PRIO;
  5259. } else if (check.priority === constants_default.FAIL_PRIO) {
  5260. check.priority = constants_default.PASS_PRIO;
  5261. }
  5262. }
  5263. });
  5264. var priorities = {
  5265. all: nodeResult.all.reduce(function(a, b) {
  5266. return Math.max(a, b.priority);
  5267. }, 0),
  5268. none: nodeResult.none.reduce(function(a, b) {
  5269. return Math.max(a, b.priority);
  5270. }, 0),
  5271. any: nodeResult.any.reduce(function(a, b) {
  5272. return Math.min(a, b.priority);
  5273. }, 4) % 4
  5274. };
  5275. nodeResult.priority = Math.max(priorities.all, priorities.none, priorities.any);
  5276. var impacts = [];
  5277. checkTypes.forEach(function(type) {
  5278. nodeResult[type] = nodeResult[type].filter(function(check) {
  5279. return check.priority === nodeResult.priority && check.priority === priorities[type];
  5280. });
  5281. nodeResult[type].forEach(function(check) {
  5282. return impacts.push(check.impact);
  5283. });
  5284. });
  5285. if ([ CANTTELL_PRIO, FAIL_PRIO ].includes(nodeResult.priority)) {
  5286. nodeResult.impact = aggregate_default(constants_default.impact, impacts);
  5287. } else {
  5288. nodeResult.impact = null;
  5289. }
  5290. anyAllNone(nodeResult, function(c) {
  5291. delete c.result;
  5292. delete c.priority;
  5293. });
  5294. nodeResult.result = constants_default.results[nodeResult.priority];
  5295. delete nodeResult.priority;
  5296. return nodeResult;
  5297. }
  5298. var aggregate_checks_default = aggregateChecks;
  5299. function finalizeRuleResult(ruleResult) {
  5300. var rule = axe._audit.rules.find(function(rule2) {
  5301. return rule2.id === ruleResult.id;
  5302. });
  5303. if (rule && rule.impact) {
  5304. ruleResult.nodes.forEach(function(node) {
  5305. [ 'any', 'all', 'none' ].forEach(function(checkType) {
  5306. (node[checkType] || []).forEach(function(checkResult) {
  5307. checkResult.impact = rule.impact;
  5308. });
  5309. });
  5310. });
  5311. }
  5312. Object.assign(ruleResult, aggregate_node_results_default(ruleResult.nodes));
  5313. delete ruleResult.nodes;
  5314. return ruleResult;
  5315. }
  5316. var finalize_result_default = finalizeRuleResult;
  5317. function aggregateNodeResults(nodeResults) {
  5318. var ruleResult = {};
  5319. nodeResults = nodeResults.map(function(nodeResult) {
  5320. if (nodeResult.any && nodeResult.all && nodeResult.none) {
  5321. return aggregate_checks_default(nodeResult);
  5322. } else if (Array.isArray(nodeResult.node)) {
  5323. return finalize_result_default(nodeResult);
  5324. } else {
  5325. throw new TypeError('Invalid Result type');
  5326. }
  5327. });
  5328. if (nodeResults && nodeResults.length) {
  5329. var resultList = nodeResults.map(function(node) {
  5330. return node.result;
  5331. });
  5332. ruleResult.result = aggregate_default(constants_default.results, resultList, ruleResult.result);
  5333. } else {
  5334. ruleResult.result = 'inapplicable';
  5335. }
  5336. constants_default.resultGroups.forEach(function(group) {
  5337. return ruleResult[group] = [];
  5338. });
  5339. nodeResults.forEach(function(nodeResult) {
  5340. var groupName = constants_default.resultGroupMap[nodeResult.result];
  5341. ruleResult[groupName].push(nodeResult);
  5342. });
  5343. var impactGroup = constants_default.FAIL_GROUP;
  5344. if (ruleResult[impactGroup].length === 0) {
  5345. impactGroup = constants_default.CANTTELL_GROUP;
  5346. }
  5347. if (ruleResult[impactGroup].length > 0) {
  5348. var impactList = ruleResult[impactGroup].map(function(failure) {
  5349. return failure.impact;
  5350. });
  5351. ruleResult.impact = aggregate_default(constants_default.impact, impactList) || null;
  5352. } else {
  5353. ruleResult.impact = null;
  5354. }
  5355. return ruleResult;
  5356. }
  5357. var aggregate_node_results_default = aggregateNodeResults;
  5358. function copyToGroup(resultObject, subResult, group) {
  5359. var resultCopy = Object.assign({}, subResult);
  5360. resultCopy.nodes = (resultCopy[group] || []).concat();
  5361. constants_default.resultGroups.forEach(function(group2) {
  5362. delete resultCopy[group2];
  5363. });
  5364. resultObject[group].push(resultCopy);
  5365. }
  5366. function aggregateResult(results) {
  5367. var resultObject = {};
  5368. constants_default.resultGroups.forEach(function(groupName) {
  5369. return resultObject[groupName] = [];
  5370. });
  5371. results.forEach(function(subResult) {
  5372. if (subResult.error) {
  5373. copyToGroup(resultObject, subResult, constants_default.CANTTELL_GROUP);
  5374. } else if (subResult.result === constants_default.NA) {
  5375. copyToGroup(resultObject, subResult, constants_default.NA_GROUP);
  5376. } else {
  5377. constants_default.resultGroups.forEach(function(group) {
  5378. if (Array.isArray(subResult[group]) && subResult[group].length > 0) {
  5379. copyToGroup(resultObject, subResult, group);
  5380. }
  5381. });
  5382. }
  5383. });
  5384. return resultObject;
  5385. }
  5386. var aggregate_result_default = aggregateResult;
  5387. function areStylesSet(el, styles, stopAt) {
  5388. var styl = window.getComputedStyle(el, null);
  5389. if (!styl) {
  5390. return false;
  5391. }
  5392. for (var i = 0; i < styles.length; ++i) {
  5393. var att = styles[i];
  5394. if (styl.getPropertyValue(att.property) === att.value) {
  5395. return true;
  5396. }
  5397. }
  5398. if (!el.parentNode || el.nodeName.toUpperCase() === stopAt.toUpperCase()) {
  5399. return false;
  5400. }
  5401. return areStylesSet(el.parentNode, styles, stopAt);
  5402. }
  5403. var are_styles_set_default = areStylesSet;
  5404. function assert(bool, message) {
  5405. if (!bool) {
  5406. throw new Error(message);
  5407. }
  5408. }
  5409. var assert_default = assert;
  5410. function toArray(thing) {
  5411. return Array.prototype.slice.call(thing);
  5412. }
  5413. var to_array_default = toArray;
  5414. function escapeSelector(value) {
  5415. var string = String(value);
  5416. var length = string.length;
  5417. var index = -1;
  5418. var codeUnit;
  5419. var result = '';
  5420. var firstCodeUnit = string.charCodeAt(0);
  5421. while (++index < length) {
  5422. codeUnit = string.charCodeAt(index);
  5423. if (codeUnit == 0) {
  5424. result += '\ufffd';
  5425. continue;
  5426. }
  5427. if (codeUnit >= 1 && codeUnit <= 31 || codeUnit == 127 || index == 0 && codeUnit >= 48 && codeUnit <= 57 || index == 1 && codeUnit >= 48 && codeUnit <= 57 && firstCodeUnit == 45) {
  5428. result += '\\' + codeUnit.toString(16) + ' ';
  5429. continue;
  5430. }
  5431. if (index == 0 && length == 1 && codeUnit == 45) {
  5432. result += '\\' + string.charAt(index);
  5433. continue;
  5434. }
  5435. if (codeUnit >= 128 || codeUnit == 45 || codeUnit == 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) {
  5436. result += string.charAt(index);
  5437. continue;
  5438. }
  5439. result += '\\' + string.charAt(index);
  5440. }
  5441. return result;
  5442. }
  5443. var escape_selector_default = escapeSelector;
  5444. function isMostlyNumbers() {
  5445. var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  5446. return str.length !== 0 && (str.match(/[0-9]/g) || '').length >= str.length / 2;
  5447. }
  5448. function splitString(str, splitIndex) {
  5449. return [ str.substring(0, splitIndex), str.substring(splitIndex) ];
  5450. }
  5451. function trimRight(str) {
  5452. return str.replace(/\s+$/, '');
  5453. }
  5454. function uriParser(url) {
  5455. var original = url;
  5456. var protocol = '', domain = '', port = '', path = '', query = '', hash = '';
  5457. if (url.includes('#')) {
  5458. var _splitString = splitString(url, url.indexOf('#'));
  5459. var _splitString2 = _slicedToArray(_splitString, 2);
  5460. url = _splitString2[0];
  5461. hash = _splitString2[1];
  5462. }
  5463. if (url.includes('?')) {
  5464. var _splitString3 = splitString(url, url.indexOf('?'));
  5465. var _splitString4 = _slicedToArray(_splitString3, 2);
  5466. url = _splitString4[0];
  5467. query = _splitString4[1];
  5468. }
  5469. if (url.includes('://')) {
  5470. var _url$split = url.split('://');
  5471. var _url$split2 = _slicedToArray(_url$split, 2);
  5472. protocol = _url$split2[0];
  5473. url = _url$split2[1];
  5474. var _splitString5 = splitString(url, url.indexOf('/'));
  5475. var _splitString6 = _slicedToArray(_splitString5, 2);
  5476. domain = _splitString6[0];
  5477. url = _splitString6[1];
  5478. } else if (url.substr(0, 2) === '//') {
  5479. url = url.substr(2);
  5480. var _splitString7 = splitString(url, url.indexOf('/'));
  5481. var _splitString8 = _slicedToArray(_splitString7, 2);
  5482. domain = _splitString8[0];
  5483. url = _splitString8[1];
  5484. }
  5485. if (domain.substr(0, 4) === 'www.') {
  5486. domain = domain.substr(4);
  5487. }
  5488. if (domain && domain.includes(':')) {
  5489. var _splitString9 = splitString(domain, domain.indexOf(':'));
  5490. var _splitString10 = _slicedToArray(_splitString9, 2);
  5491. domain = _splitString10[0];
  5492. port = _splitString10[1];
  5493. }
  5494. path = url;
  5495. return {
  5496. original: original,
  5497. protocol: protocol,
  5498. domain: domain,
  5499. port: port,
  5500. path: path,
  5501. query: query,
  5502. hash: hash
  5503. };
  5504. }
  5505. function getFriendlyUriEnd() {
  5506. var uri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  5507. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  5508. if (uri.length <= 1 || uri.substr(0, 5) === 'data:' || uri.substr(0, 11) === 'javascript:' || uri.includes('?')) {
  5509. return;
  5510. }
  5511. var currentDomain = options.currentDomain, _options$maxLength = options.maxLength, maxLength = _options$maxLength === void 0 ? 25 : _options$maxLength;
  5512. var _uriParser = uriParser(uri), path = _uriParser.path, domain = _uriParser.domain, hash = _uriParser.hash;
  5513. var pathEnd = path.substr(path.substr(0, path.length - 2).lastIndexOf('/') + 1);
  5514. if (hash) {
  5515. if (pathEnd && (pathEnd + hash).length <= maxLength) {
  5516. return trimRight(pathEnd + hash);
  5517. } else if (pathEnd.length < 2 && hash.length > 2 && hash.length <= maxLength) {
  5518. return trimRight(hash);
  5519. } else {
  5520. return;
  5521. }
  5522. } else if (domain && domain.length < maxLength && path.length <= 1) {
  5523. return trimRight(domain + path);
  5524. }
  5525. if (path === '/' + pathEnd && domain && currentDomain && domain !== currentDomain && (domain + path).length <= maxLength) {
  5526. return trimRight(domain + path);
  5527. }
  5528. var lastDotIndex = pathEnd.lastIndexOf('.');
  5529. if ((lastDotIndex === -1 || lastDotIndex > 1) && (lastDotIndex !== -1 || pathEnd.length > 2) && pathEnd.length <= maxLength && !pathEnd.match(/index(\.[a-zA-Z]{2-4})?/) && !isMostlyNumbers(pathEnd)) {
  5530. return trimRight(pathEnd);
  5531. }
  5532. }
  5533. var get_friendly_uri_end_default = getFriendlyUriEnd;
  5534. function getNodeAttributes(node) {
  5535. if (node.attributes instanceof window.NamedNodeMap) {
  5536. return node.attributes;
  5537. }
  5538. return node.cloneNode(false).attributes;
  5539. }
  5540. var get_node_attributes_default = getNodeAttributes;
  5541. var matchesSelector = function() {
  5542. var method;
  5543. function getMethod(node) {
  5544. var index, candidate, candidates = [ 'matches', 'matchesSelector', 'mozMatchesSelector', 'webkitMatchesSelector', 'msMatchesSelector' ], length = candidates.length;
  5545. for (index = 0; index < length; index++) {
  5546. candidate = candidates[index];
  5547. if (node[candidate]) {
  5548. return candidate;
  5549. }
  5550. }
  5551. }
  5552. return function(node, selector) {
  5553. if (!method || !node[method]) {
  5554. method = getMethod(node);
  5555. }
  5556. if (node[method]) {
  5557. return node[method](selector);
  5558. }
  5559. return false;
  5560. };
  5561. }();
  5562. var element_matches_default = matchesSelector;
  5563. function isXHTML(doc) {
  5564. if (!doc.createElement) {
  5565. return false;
  5566. }
  5567. return doc.createElement('A').localName === 'A';
  5568. }
  5569. var is_xhtml_default = isXHTML;
  5570. function getShadowSelector(generateSelector2, elm) {
  5571. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  5572. if (!elm) {
  5573. return '';
  5574. }
  5575. var doc = elm.getRootNode && elm.getRootNode() || document;
  5576. if (doc.nodeType !== 11) {
  5577. return generateSelector2(elm, options, doc);
  5578. }
  5579. var stack = [];
  5580. while (doc.nodeType === 11) {
  5581. if (!doc.host) {
  5582. return '';
  5583. }
  5584. stack.unshift({
  5585. elm: elm,
  5586. doc: doc
  5587. });
  5588. elm = doc.host;
  5589. doc = elm.getRootNode();
  5590. }
  5591. stack.unshift({
  5592. elm: elm,
  5593. doc: doc
  5594. });
  5595. return stack.map(function(_ref) {
  5596. var elm2 = _ref.elm, doc2 = _ref.doc;
  5597. return generateSelector2(elm2, options, doc2);
  5598. });
  5599. }
  5600. var get_shadow_selector_default = getShadowSelector;
  5601. var xhtml;
  5602. var ignoredAttributes = [ 'class', 'style', 'id', 'selected', 'checked', 'disabled', 'tabindex', 'aria-checked', 'aria-selected', 'aria-invalid', 'aria-activedescendant', 'aria-busy', 'aria-disabled', 'aria-expanded', 'aria-grabbed', 'aria-pressed', 'aria-valuenow' ];
  5603. var MAXATTRIBUTELENGTH = 31;
  5604. var attrCharsRegex = /([\\"])/g;
  5605. var newlineChars = /(\r\n|\r|\n)/g;
  5606. function escapeAttribute(str) {
  5607. return str.replace(attrCharsRegex, '\\$1').replace(newlineChars, '\\a ');
  5608. }
  5609. function getAttributeNameValue(node, at) {
  5610. var name = at.name;
  5611. var atnv;
  5612. if (name.indexOf('href') !== -1 || name.indexOf('src') !== -1) {
  5613. var friendly = get_friendly_uri_end_default(node.getAttribute(name));
  5614. if (friendly) {
  5615. atnv = escape_selector_default(at.name) + '$="' + escapeAttribute(friendly) + '"';
  5616. } else {
  5617. atnv = escape_selector_default(at.name) + '="' + escapeAttribute(node.getAttribute(name)) + '"';
  5618. }
  5619. } else {
  5620. atnv = escape_selector_default(name) + '="' + escapeAttribute(at.value) + '"';
  5621. }
  5622. return atnv;
  5623. }
  5624. function countSort(a, b) {
  5625. return a.count < b.count ? -1 : a.count === b.count ? 0 : 1;
  5626. }
  5627. function filterAttributes(at) {
  5628. return !ignoredAttributes.includes(at.name) && at.name.indexOf(':') === -1 && (!at.value || at.value.length < MAXATTRIBUTELENGTH);
  5629. }
  5630. function _getSelectorData(domTree) {
  5631. var data2 = {
  5632. classes: {},
  5633. tags: {},
  5634. attributes: {}
  5635. };
  5636. domTree = Array.isArray(domTree) ? domTree : [ domTree ];
  5637. var currentLevel = domTree.slice();
  5638. var stack = [];
  5639. var _loop2 = function _loop2() {
  5640. var current = currentLevel.pop();
  5641. var node = current.actualNode;
  5642. if (!!node.querySelectorAll) {
  5643. var tag = node.nodeName;
  5644. if (data2.tags[tag]) {
  5645. data2.tags[tag]++;
  5646. } else {
  5647. data2.tags[tag] = 1;
  5648. }
  5649. if (node.classList) {
  5650. Array.from(node.classList).forEach(function(cl) {
  5651. var ind = escape_selector_default(cl);
  5652. if (data2.classes[ind]) {
  5653. data2.classes[ind]++;
  5654. } else {
  5655. data2.classes[ind] = 1;
  5656. }
  5657. });
  5658. }
  5659. if (node.hasAttributes()) {
  5660. Array.from(get_node_attributes_default(node)).filter(filterAttributes).forEach(function(at) {
  5661. var atnv = getAttributeNameValue(node, at);
  5662. if (atnv) {
  5663. if (data2.attributes[atnv]) {
  5664. data2.attributes[atnv]++;
  5665. } else {
  5666. data2.attributes[atnv] = 1;
  5667. }
  5668. }
  5669. });
  5670. }
  5671. }
  5672. if (current.children.length) {
  5673. stack.push(currentLevel);
  5674. currentLevel = current.children.slice();
  5675. }
  5676. while (!currentLevel.length && stack.length) {
  5677. currentLevel = stack.pop();
  5678. }
  5679. };
  5680. while (currentLevel.length) {
  5681. _loop2();
  5682. }
  5683. return data2;
  5684. }
  5685. function uncommonClasses(node, selectorData) {
  5686. var retVal = [];
  5687. var classData = selectorData.classes;
  5688. var tagData = selectorData.tags;
  5689. if (node.classList) {
  5690. Array.from(node.classList).forEach(function(cl) {
  5691. var ind = escape_selector_default(cl);
  5692. if (classData[ind] < tagData[node.nodeName]) {
  5693. retVal.push({
  5694. name: ind,
  5695. count: classData[ind],
  5696. species: 'class'
  5697. });
  5698. }
  5699. });
  5700. }
  5701. return retVal.sort(countSort);
  5702. }
  5703. function getNthChildString(elm, selector) {
  5704. var siblings = elm.parentNode && Array.from(elm.parentNode.children || '') || [];
  5705. var hasMatchingSiblings = siblings.find(function(sibling) {
  5706. return sibling !== elm && element_matches_default(sibling, selector);
  5707. });
  5708. if (hasMatchingSiblings) {
  5709. var nthChild = 1 + siblings.indexOf(elm);
  5710. return ':nth-child(' + nthChild + ')';
  5711. } else {
  5712. return '';
  5713. }
  5714. }
  5715. function getElmId(elm) {
  5716. if (!elm.getAttribute('id')) {
  5717. return;
  5718. }
  5719. var doc = elm.getRootNode && elm.getRootNode() || document;
  5720. var id = '#' + escape_selector_default(elm.getAttribute('id') || '');
  5721. if (!id.match(/player_uid_/) && doc.querySelectorAll(id).length === 1) {
  5722. return id;
  5723. }
  5724. }
  5725. function getBaseSelector(elm) {
  5726. if (typeof xhtml === 'undefined') {
  5727. xhtml = is_xhtml_default(document);
  5728. }
  5729. return escape_selector_default(xhtml ? elm.localName : elm.nodeName.toLowerCase());
  5730. }
  5731. function uncommonAttributes(node, selectorData) {
  5732. var retVal = [];
  5733. var attData = selectorData.attributes;
  5734. var tagData = selectorData.tags;
  5735. if (node.hasAttributes()) {
  5736. Array.from(get_node_attributes_default(node)).filter(filterAttributes).forEach(function(at) {
  5737. var atnv = getAttributeNameValue(node, at);
  5738. if (atnv && attData[atnv] < tagData[node.nodeName]) {
  5739. retVal.push({
  5740. name: atnv,
  5741. count: attData[atnv],
  5742. species: 'attribute'
  5743. });
  5744. }
  5745. });
  5746. }
  5747. return retVal.sort(countSort);
  5748. }
  5749. function getThreeLeastCommonFeatures(elm, selectorData) {
  5750. var selector = '';
  5751. var features;
  5752. var clss = uncommonClasses(elm, selectorData);
  5753. var atts = uncommonAttributes(elm, selectorData);
  5754. if (clss.length && clss[0].count === 1) {
  5755. features = [ clss[0] ];
  5756. } else if (atts.length && atts[0].count === 1) {
  5757. features = [ atts[0] ];
  5758. selector = getBaseSelector(elm);
  5759. } else {
  5760. features = clss.concat(atts);
  5761. features.sort(countSort);
  5762. features = features.slice(0, 3);
  5763. if (!features.some(function(feat) {
  5764. return feat.species === 'class';
  5765. })) {
  5766. selector = getBaseSelector(elm);
  5767. } else {
  5768. features.sort(function(a, b) {
  5769. return a.species !== b.species && a.species === 'class' ? -1 : a.species === b.species ? 0 : 1;
  5770. });
  5771. }
  5772. }
  5773. return selector += features.reduce(function(val, feat) {
  5774. switch (feat.species) {
  5775. case 'class':
  5776. return val + '.' + feat.name;
  5777. case 'attribute':
  5778. return val + '[' + feat.name + ']';
  5779. }
  5780. return val;
  5781. }, '');
  5782. }
  5783. function generateSelector(elm, options, doc) {
  5784. if (!axe._selectorData) {
  5785. throw new Error('Expect axe._selectorData to be set up');
  5786. }
  5787. var _options$toRoot = options.toRoot, toRoot = _options$toRoot === void 0 ? false : _options$toRoot;
  5788. var selector;
  5789. var similar;
  5790. do {
  5791. var features = getElmId(elm);
  5792. if (!features) {
  5793. features = getThreeLeastCommonFeatures(elm, axe._selectorData);
  5794. features += getNthChildString(elm, features);
  5795. }
  5796. if (selector) {
  5797. selector = features + ' > ' + selector;
  5798. } else {
  5799. selector = features;
  5800. }
  5801. if (!similar) {
  5802. similar = Array.from(doc.querySelectorAll(selector));
  5803. } else {
  5804. similar = similar.filter(function(item) {
  5805. return element_matches_default(item, selector);
  5806. });
  5807. }
  5808. elm = elm.parentElement;
  5809. } while ((similar.length > 1 || toRoot) && elm && elm.nodeType !== 11);
  5810. if (similar.length === 1) {
  5811. return selector;
  5812. } else if (selector.indexOf(' > ') !== -1) {
  5813. return ':root' + selector.substring(selector.indexOf(' > '));
  5814. }
  5815. return ':root';
  5816. }
  5817. function _getSelector(elm, options) {
  5818. return get_shadow_selector_default(generateSelector, elm, options);
  5819. }
  5820. function generateAncestry(node) {
  5821. var nodeName2 = node.nodeName.toLowerCase();
  5822. var parent = node.parentElement;
  5823. if (!parent) {
  5824. return nodeName2;
  5825. }
  5826. var nthChild = '';
  5827. if (nodeName2 !== 'head' && nodeName2 !== 'body' && parent.children.length > 1) {
  5828. var index = Array.prototype.indexOf.call(parent.children, node) + 1;
  5829. nthChild = ':nth-child('.concat(index, ')');
  5830. }
  5831. return generateAncestry(parent) + ' > ' + nodeName2 + nthChild;
  5832. }
  5833. function _getAncestry(elm, options) {
  5834. return get_shadow_selector_default(generateAncestry, elm, options);
  5835. }
  5836. function getXPathArray(node, path) {
  5837. var sibling, count;
  5838. if (!node) {
  5839. return [];
  5840. }
  5841. if (!path && node.nodeType === 9) {
  5842. path = [ {
  5843. str: 'html'
  5844. } ];
  5845. return path;
  5846. }
  5847. path = path || [];
  5848. if (node.parentNode && node.parentNode !== node) {
  5849. path = getXPathArray(node.parentNode, path);
  5850. }
  5851. if (node.previousSibling) {
  5852. count = 1;
  5853. sibling = node.previousSibling;
  5854. do {
  5855. if (sibling.nodeType === 1 && sibling.nodeName === node.nodeName) {
  5856. count++;
  5857. }
  5858. sibling = sibling.previousSibling;
  5859. } while (sibling);
  5860. if (count === 1) {
  5861. count = null;
  5862. }
  5863. } else if (node.nextSibling) {
  5864. sibling = node.nextSibling;
  5865. do {
  5866. if (sibling.nodeType === 1 && sibling.nodeName === node.nodeName) {
  5867. count = 1;
  5868. sibling = null;
  5869. } else {
  5870. count = null;
  5871. sibling = sibling.previousSibling;
  5872. }
  5873. } while (sibling);
  5874. }
  5875. if (node.nodeType === 1) {
  5876. var element = {};
  5877. element.str = node.nodeName.toLowerCase();
  5878. var id = node.getAttribute && escape_selector_default(node.getAttribute('id'));
  5879. if (id && node.ownerDocument.querySelectorAll('#' + id).length === 1) {
  5880. element.id = node.getAttribute('id');
  5881. }
  5882. if (count > 1) {
  5883. element.count = count;
  5884. }
  5885. path.push(element);
  5886. }
  5887. return path;
  5888. }
  5889. function xpathToString(xpathArray) {
  5890. return xpathArray.reduce(function(str, elm) {
  5891. if (elm.id) {
  5892. return '/'.concat(elm.str, '[@id=\'').concat(elm.id, '\']');
  5893. } else {
  5894. return str + '/'.concat(elm.str) + (elm.count > 0 ? '['.concat(elm.count, ']') : '');
  5895. }
  5896. }, '');
  5897. }
  5898. function getXpath(node) {
  5899. var xpathArray = getXPathArray(node);
  5900. return xpathToString(xpathArray);
  5901. }
  5902. var get_xpath_default = getXpath;
  5903. var _cache = {};
  5904. var cache = {
  5905. set: function set(key, value) {
  5906. validateKey(key);
  5907. _cache[key] = value;
  5908. },
  5909. get: function get(key, creator) {
  5910. validateCreator(creator);
  5911. if (key in _cache) {
  5912. return _cache[key];
  5913. }
  5914. if (typeof creator === 'function') {
  5915. var value = creator();
  5916. assert_default(value !== void 0, 'Cache creator function should not return undefined');
  5917. this.set(key, value);
  5918. return _cache[key];
  5919. }
  5920. },
  5921. clear: function clear() {
  5922. _cache = {};
  5923. }
  5924. };
  5925. function validateKey(key) {
  5926. assert_default(typeof key === 'string', 'key must be a string, ' + _typeof(key) + ' given');
  5927. assert_default(key !== '', 'key must not be empty');
  5928. }
  5929. function validateCreator(creator) {
  5930. assert_default(typeof creator === 'function' || typeof creator === 'undefined', 'creator must be a function or undefined, ' + _typeof(creator) + ' given');
  5931. }
  5932. var cache_default = cache;
  5933. function getNodeFromTree(vNode, node) {
  5934. var el = node || vNode;
  5935. return cache_default.get('nodeMap') ? cache_default.get('nodeMap').get(el) : null;
  5936. }
  5937. var get_node_from_tree_default = getNodeFromTree;
  5938. function truncate(str, maxLength) {
  5939. maxLength = maxLength || 300;
  5940. if (str.length > maxLength) {
  5941. var index = str.indexOf('>');
  5942. str = str.substring(0, index + 1);
  5943. }
  5944. return str;
  5945. }
  5946. function getSource(element) {
  5947. if (!(element !== null && element !== void 0 && element.outerHTML)) {
  5948. return '';
  5949. }
  5950. var source = element.outerHTML;
  5951. if (!source && typeof window.XMLSerializer === 'function') {
  5952. source = new window.XMLSerializer().serializeToString(element);
  5953. }
  5954. return truncate(source || '');
  5955. }
  5956. function DqElement(elm) {
  5957. var _this$spec$selector, _this$_virtualNode;
  5958. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  5959. var spec = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  5960. this.spec = spec;
  5961. if (elm instanceof abstract_virtual_node_default) {
  5962. this._virtualNode = elm;
  5963. this._element = elm.actualNode;
  5964. } else {
  5965. this._element = elm;
  5966. this._virtualNode = get_node_from_tree_default(elm);
  5967. }
  5968. this.fromFrame = ((_this$spec$selector = this.spec.selector) === null || _this$spec$selector === void 0 ? void 0 : _this$spec$selector.length) > 1;
  5969. if (options.absolutePaths) {
  5970. this._options = {
  5971. toRoot: true
  5972. };
  5973. }
  5974. this.nodeIndexes = [];
  5975. if (Array.isArray(this.spec.nodeIndexes)) {
  5976. this.nodeIndexes = this.spec.nodeIndexes;
  5977. } else if (typeof ((_this$_virtualNode = this._virtualNode) === null || _this$_virtualNode === void 0 ? void 0 : _this$_virtualNode.nodeIndex) === 'number') {
  5978. this.nodeIndexes = [ this._virtualNode.nodeIndex ];
  5979. }
  5980. this.source = null;
  5981. if (!axe._audit.noHtml) {
  5982. var _this$spec$source;
  5983. this.source = (_this$spec$source = this.spec.source) !== null && _this$spec$source !== void 0 ? _this$spec$source : getSource(this._element);
  5984. }
  5985. }
  5986. DqElement.prototype = {
  5987. get selector() {
  5988. return this.spec.selector || [ _getSelector(this.element, this._options) ];
  5989. },
  5990. get ancestry() {
  5991. return this.spec.ancestry || [ _getAncestry(this.element) ];
  5992. },
  5993. get xpath() {
  5994. return this.spec.xpath || [ get_xpath_default(this.element) ];
  5995. },
  5996. get element() {
  5997. return this._element;
  5998. },
  5999. toJSON: function toJSON() {
  6000. return {
  6001. selector: this.selector,
  6002. source: this.source,
  6003. xpath: this.xpath,
  6004. ancestry: this.ancestry,
  6005. nodeIndexes: this.nodeIndexes
  6006. };
  6007. }
  6008. };
  6009. DqElement.fromFrame = function fromFrame(node, options, frame) {
  6010. var spec = DqElement.mergeSpecs(node, frame);
  6011. return new DqElement(frame.element, options, spec);
  6012. };
  6013. DqElement.mergeSpecs = function mergeSpec(node, frame) {
  6014. return _extends({}, node, {
  6015. selector: [].concat(_toConsumableArray(frame.selector), _toConsumableArray(node.selector)),
  6016. ancestry: [].concat(_toConsumableArray(frame.ancestry), _toConsumableArray(node.ancestry)),
  6017. xpath: [].concat(_toConsumableArray(frame.xpath), _toConsumableArray(node.xpath)),
  6018. nodeIndexes: [].concat(_toConsumableArray(frame.nodeIndexes), _toConsumableArray(node.nodeIndexes))
  6019. });
  6020. };
  6021. var dq_element_default = DqElement;
  6022. function checkHelper(checkResult, options, resolve, reject) {
  6023. return {
  6024. isAsync: false,
  6025. async: function async() {
  6026. this.isAsync = true;
  6027. return function(result) {
  6028. if (result instanceof Error === false) {
  6029. checkResult.result = result;
  6030. resolve(checkResult);
  6031. } else {
  6032. reject(result);
  6033. }
  6034. };
  6035. },
  6036. data: function data(data2) {
  6037. checkResult.data = data2;
  6038. },
  6039. relatedNodes: function relatedNodes(nodes) {
  6040. if (!window.Node) {
  6041. return;
  6042. }
  6043. nodes = nodes instanceof window.Node ? [ nodes ] : to_array_default(nodes);
  6044. if (!nodes.every(function(node) {
  6045. return node instanceof window.Node || node.actualNode;
  6046. })) {
  6047. return;
  6048. }
  6049. checkResult.relatedNodes = nodes.map(function(element) {
  6050. return new dq_element_default(element, options);
  6051. });
  6052. }
  6053. };
  6054. }
  6055. var check_helper_default = checkHelper;
  6056. function clone(obj) {
  6057. var _window, _window2;
  6058. var index, length, out = obj;
  6059. if ((_window = window) !== null && _window !== void 0 && _window.Node && obj instanceof window.Node || (_window2 = window) !== null && _window2 !== void 0 && _window2.HTMLCollection && obj instanceof window.HTMLCollection) {
  6060. return obj;
  6061. }
  6062. if (obj !== null && _typeof(obj) === 'object') {
  6063. if (Array.isArray(obj)) {
  6064. out = [];
  6065. for (index = 0, length = obj.length; index < length; index++) {
  6066. out[index] = clone(obj[index]);
  6067. }
  6068. } else {
  6069. out = {};
  6070. for (index in obj) {
  6071. out[index] = clone(obj[index]);
  6072. }
  6073. }
  6074. }
  6075. return out;
  6076. }
  6077. var clone_default = clone;
  6078. var import_css_selector_parser = __toModule(require_lib());
  6079. var parser = new import_css_selector_parser.CssSelectorParser();
  6080. parser.registerSelectorPseudos('not');
  6081. parser.registerSelectorPseudos('is');
  6082. parser.registerNestingOperators('>');
  6083. parser.registerAttrEqualityMods('^', '$', '*', '~');
  6084. var css_parser_default = parser;
  6085. function matchesTag(vNode, exp) {
  6086. return vNode.props.nodeType === 1 && (exp.tag === '*' || vNode.props.nodeName === exp.tag);
  6087. }
  6088. function matchesClasses(vNode, exp) {
  6089. return !exp.classes || exp.classes.every(function(cl) {
  6090. return vNode.hasClass(cl.value);
  6091. });
  6092. }
  6093. function matchesAttributes(vNode, exp) {
  6094. return !exp.attributes || exp.attributes.every(function(att) {
  6095. var nodeAtt = vNode.attr(att.key);
  6096. return nodeAtt !== null && att.test(nodeAtt);
  6097. });
  6098. }
  6099. function matchesId(vNode, exp) {
  6100. return !exp.id || vNode.props.id === exp.id;
  6101. }
  6102. function matchesPseudos(target, exp) {
  6103. if (!exp.pseudos || exp.pseudos.every(function(pseudo) {
  6104. if (pseudo.name === 'not') {
  6105. return !pseudo.expressions.some(function(expression) {
  6106. return _matchesExpression(target, expression);
  6107. });
  6108. } else if (pseudo.name === 'is') {
  6109. return pseudo.expressions.some(function(expression) {
  6110. return _matchesExpression(target, expression);
  6111. });
  6112. }
  6113. throw new Error('the pseudo selector ' + pseudo.name + ' has not yet been implemented');
  6114. })) {
  6115. return true;
  6116. }
  6117. return false;
  6118. }
  6119. function matchExpression(vNode, expression) {
  6120. return matchesTag(vNode, expression) && matchesClasses(vNode, expression) && matchesAttributes(vNode, expression) && matchesId(vNode, expression) && matchesPseudos(vNode, expression);
  6121. }
  6122. var escapeRegExp = function() {
  6123. var from = /(?=[\-\[\]{}()*+?.\\\^$|,#\s])/g;
  6124. var to = '\\';
  6125. return function(string) {
  6126. return string.replace(from, to);
  6127. };
  6128. }();
  6129. var reUnescape = /\\/g;
  6130. function convertAttributes(atts) {
  6131. if (!atts) {
  6132. return;
  6133. }
  6134. return atts.map(function(att) {
  6135. var attributeKey = att.name.replace(reUnescape, '');
  6136. var attributeValue = (att.value || '').replace(reUnescape, '');
  6137. var test, regexp;
  6138. switch (att.operator) {
  6139. case '^=':
  6140. regexp = new RegExp('^' + escapeRegExp(attributeValue));
  6141. break;
  6142. case '$=':
  6143. regexp = new RegExp(escapeRegExp(attributeValue) + '$');
  6144. break;
  6145. case '~=':
  6146. regexp = new RegExp('(^|\\s)' + escapeRegExp(attributeValue) + '(\\s|$)');
  6147. break;
  6148. case '|=':
  6149. regexp = new RegExp('^' + escapeRegExp(attributeValue) + '(-|$)');
  6150. break;
  6151. case '=':
  6152. test = function test(value) {
  6153. return attributeValue === value;
  6154. };
  6155. break;
  6156. case '*=':
  6157. test = function test(value) {
  6158. return value && value.includes(attributeValue);
  6159. };
  6160. break;
  6161. case '!=':
  6162. test = function test(value) {
  6163. return attributeValue !== value;
  6164. };
  6165. break;
  6166. default:
  6167. test = function test(value) {
  6168. return value !== null;
  6169. };
  6170. }
  6171. if (attributeValue === '' && /^[*$^]=$/.test(att.operator)) {
  6172. test = function test() {
  6173. return false;
  6174. };
  6175. }
  6176. if (!test) {
  6177. test = function test(value) {
  6178. return value && regexp.test(value);
  6179. };
  6180. }
  6181. return {
  6182. key: attributeKey,
  6183. value: attributeValue,
  6184. type: typeof att.value === 'undefined' ? 'attrExist' : 'attrValue',
  6185. test: test
  6186. };
  6187. });
  6188. }
  6189. function convertClasses(classes) {
  6190. if (!classes) {
  6191. return;
  6192. }
  6193. return classes.map(function(className) {
  6194. className = className.replace(reUnescape, '');
  6195. return {
  6196. value: className,
  6197. regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)')
  6198. };
  6199. });
  6200. }
  6201. function convertPseudos(pseudos) {
  6202. if (!pseudos) {
  6203. return;
  6204. }
  6205. return pseudos.map(function(p) {
  6206. var expressions;
  6207. if ([ 'is', 'not' ].includes(p.name)) {
  6208. expressions = p.value;
  6209. expressions = expressions.selectors ? expressions.selectors : [ expressions ];
  6210. expressions = convertExpressions(expressions);
  6211. }
  6212. return {
  6213. name: p.name,
  6214. expressions: expressions,
  6215. value: p.value
  6216. };
  6217. });
  6218. }
  6219. function convertExpressions(expressions) {
  6220. return expressions.map(function(exp) {
  6221. var newExp = [];
  6222. var rule = exp.rule;
  6223. while (rule) {
  6224. newExp.push({
  6225. tag: rule.tagName ? rule.tagName.toLowerCase() : '*',
  6226. combinator: rule.nestingOperator ? rule.nestingOperator : ' ',
  6227. id: rule.id,
  6228. attributes: convertAttributes(rule.attrs),
  6229. classes: convertClasses(rule.classNames),
  6230. pseudos: convertPseudos(rule.pseudos)
  6231. });
  6232. rule = rule.rule;
  6233. }
  6234. return newExp;
  6235. });
  6236. }
  6237. function _convertSelector(selector) {
  6238. var expressions = css_parser_default.parse(selector);
  6239. expressions = expressions.selectors ? expressions.selectors : [ expressions ];
  6240. return convertExpressions(expressions);
  6241. }
  6242. function optimizedMatchesExpression(vNode, expressions, index, matchAnyParent) {
  6243. if (!vNode) {
  6244. return false;
  6245. }
  6246. var isArray = Array.isArray(expressions);
  6247. var expression = isArray ? expressions[index] : expressions;
  6248. var matches4 = matchExpression(vNode, expression);
  6249. while (!matches4 && matchAnyParent && vNode.parent) {
  6250. vNode = vNode.parent;
  6251. matches4 = matchExpression(vNode, expression);
  6252. }
  6253. if (index > 0) {
  6254. if ([ ' ', '>' ].includes(expression.combinator) === false) {
  6255. throw new Error('axe.utils.matchesExpression does not support the combinator: ' + expression.combinator);
  6256. }
  6257. matches4 = matches4 && optimizedMatchesExpression(vNode.parent, expressions, index - 1, expression.combinator === ' ');
  6258. }
  6259. return matches4;
  6260. }
  6261. function _matchesExpression(vNode, expressions, matchAnyParent) {
  6262. return optimizedMatchesExpression(vNode, expressions, expressions.length - 1, matchAnyParent);
  6263. }
  6264. function matches(vNode, selector) {
  6265. var expressions = _convertSelector(selector);
  6266. return expressions.some(function(expression) {
  6267. return _matchesExpression(vNode, expression);
  6268. });
  6269. }
  6270. var matches_default = matches;
  6271. function closest(vNode, selector) {
  6272. while (vNode) {
  6273. if (matches_default(vNode, selector)) {
  6274. return vNode;
  6275. }
  6276. if (typeof vNode.parent === 'undefined') {
  6277. throw new TypeError('Cannot resolve parent for non-DOM nodes');
  6278. }
  6279. vNode = vNode.parent;
  6280. }
  6281. return null;
  6282. }
  6283. var closest_default = closest;
  6284. function noop() {}
  6285. function funcGuard(f) {
  6286. if (typeof f !== 'function') {
  6287. throw new TypeError('Queue methods require functions as arguments');
  6288. }
  6289. }
  6290. function queue() {
  6291. var tasks = [];
  6292. var started = 0;
  6293. var remaining = 0;
  6294. var completeQueue = noop;
  6295. var complete = false;
  6296. var err2;
  6297. var defaultFail = function defaultFail(e) {
  6298. err2 = e;
  6299. setTimeout(function() {
  6300. if (err2 !== void 0 && err2 !== null) {
  6301. log_default('Uncaught error (of queue)', err2);
  6302. }
  6303. }, 1);
  6304. };
  6305. var failed = defaultFail;
  6306. function createResolve(i) {
  6307. return function(r) {
  6308. tasks[i] = r;
  6309. remaining -= 1;
  6310. if (!remaining && completeQueue !== noop) {
  6311. complete = true;
  6312. completeQueue(tasks);
  6313. }
  6314. };
  6315. }
  6316. function abort(msg) {
  6317. completeQueue = noop;
  6318. failed(msg);
  6319. return tasks;
  6320. }
  6321. function pop() {
  6322. var length = tasks.length;
  6323. for (;started < length; started++) {
  6324. var task = tasks[started];
  6325. try {
  6326. task.call(null, createResolve(started), abort);
  6327. } catch (e) {
  6328. abort(e);
  6329. }
  6330. }
  6331. }
  6332. var q = {
  6333. defer: function defer(fn) {
  6334. if (_typeof(fn) === 'object' && fn.then && fn['catch']) {
  6335. var defer = fn;
  6336. fn = function fn(resolve, reject) {
  6337. defer.then(resolve)['catch'](reject);
  6338. };
  6339. }
  6340. funcGuard(fn);
  6341. if (err2 !== void 0) {
  6342. return;
  6343. } else if (complete) {
  6344. throw new Error('Queue already completed');
  6345. }
  6346. tasks.push(fn);
  6347. ++remaining;
  6348. pop();
  6349. return q;
  6350. },
  6351. then: function then(fn) {
  6352. funcGuard(fn);
  6353. if (completeQueue !== noop) {
  6354. throw new Error('queue `then` already set');
  6355. }
  6356. if (!err2) {
  6357. completeQueue = fn;
  6358. if (!remaining) {
  6359. complete = true;
  6360. completeQueue(tasks);
  6361. }
  6362. }
  6363. return q;
  6364. },
  6365. catch: function _catch(fn) {
  6366. funcGuard(fn);
  6367. if (failed !== defaultFail) {
  6368. throw new Error('queue `catch` already set');
  6369. }
  6370. if (!err2) {
  6371. failed = fn;
  6372. } else {
  6373. fn(err2);
  6374. err2 = null;
  6375. }
  6376. return q;
  6377. },
  6378. abort: abort
  6379. };
  6380. return q;
  6381. }
  6382. var queue_default = queue;
  6383. var uuid;
  6384. var _rng;
  6385. var _crypto = window.crypto || window.msCrypto;
  6386. if (!_rng && _crypto && _crypto.getRandomValues) {
  6387. _rnds8 = new Uint8Array(16);
  6388. _rng = function whatwgRNG() {
  6389. _crypto.getRandomValues(_rnds8);
  6390. return _rnds8;
  6391. };
  6392. }
  6393. var _rnds8;
  6394. if (!_rng) {
  6395. _rnds = new Array(16);
  6396. _rng = function _rng() {
  6397. for (var i = 0, r; i < 16; i++) {
  6398. if ((i & 3) === 0) {
  6399. r = Math.random() * 4294967296;
  6400. }
  6401. _rnds[i] = r >>> ((i & 3) << 3) & 255;
  6402. }
  6403. return _rnds;
  6404. };
  6405. }
  6406. var _rnds;
  6407. var BufferClass = typeof window.Buffer == 'function' ? window.Buffer : Array;
  6408. var _byteToHex = [];
  6409. var _hexToByte = {};
  6410. for (var i = 0; i < 256; i++) {
  6411. _byteToHex[i] = (i + 256).toString(16).substr(1);
  6412. _hexToByte[_byteToHex[i]] = i;
  6413. }
  6414. function parse(s, buf, offset) {
  6415. var i = buf && offset || 0, ii = 0;
  6416. buf = buf || [];
  6417. s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
  6418. if (ii < 16) {
  6419. buf[i + ii++] = _hexToByte[oct];
  6420. }
  6421. });
  6422. while (ii < 16) {
  6423. buf[i + ii++] = 0;
  6424. }
  6425. return buf;
  6426. }
  6427. function unparse(buf, offset) {
  6428. var i = offset || 0, bth = _byteToHex;
  6429. return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]];
  6430. }
  6431. var _seedBytes = _rng();
  6432. var _nodeId = [ _seedBytes[0] | 1, _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] ];
  6433. var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 16383;
  6434. var _lastMSecs = 0;
  6435. var _lastNSecs = 0;
  6436. function v1(options, buf, offset) {
  6437. var i = buf && offset || 0;
  6438. var b = buf || [];
  6439. options = options || {};
  6440. var clockseq = options.clockseq != null ? options.clockseq : _clockseq;
  6441. var msecs = options.msecs != null ? options.msecs : new Date().getTime();
  6442. var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
  6443. var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
  6444. if (dt < 0 && options.clockseq == null) {
  6445. clockseq = clockseq + 1 & 16383;
  6446. }
  6447. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
  6448. nsecs = 0;
  6449. }
  6450. if (nsecs >= 1e4) {
  6451. throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
  6452. }
  6453. _lastMSecs = msecs;
  6454. _lastNSecs = nsecs;
  6455. _clockseq = clockseq;
  6456. msecs += 122192928e5;
  6457. var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
  6458. b[i++] = tl >>> 24 & 255;
  6459. b[i++] = tl >>> 16 & 255;
  6460. b[i++] = tl >>> 8 & 255;
  6461. b[i++] = tl & 255;
  6462. var tmh = msecs / 4294967296 * 1e4 & 268435455;
  6463. b[i++] = tmh >>> 8 & 255;
  6464. b[i++] = tmh & 255;
  6465. b[i++] = tmh >>> 24 & 15 | 16;
  6466. b[i++] = tmh >>> 16 & 255;
  6467. b[i++] = clockseq >>> 8 | 128;
  6468. b[i++] = clockseq & 255;
  6469. var node = options.node || _nodeId;
  6470. for (var n = 0; n < 6; n++) {
  6471. b[i + n] = node[n];
  6472. }
  6473. return buf ? buf : unparse(b);
  6474. }
  6475. function v4(options, buf, offset) {
  6476. var i = buf && offset || 0;
  6477. if (typeof options == 'string') {
  6478. buf = options == 'binary' ? new BufferClass(16) : null;
  6479. options = null;
  6480. }
  6481. options = options || {};
  6482. var rnds = options.random || (options.rng || _rng)();
  6483. rnds[6] = rnds[6] & 15 | 64;
  6484. rnds[8] = rnds[8] & 63 | 128;
  6485. if (buf) {
  6486. for (var ii = 0; ii < 16; ii++) {
  6487. buf[i + ii] = rnds[ii];
  6488. }
  6489. }
  6490. return buf || unparse(rnds);
  6491. }
  6492. uuid = v4;
  6493. uuid.v1 = v1;
  6494. uuid.v4 = v4;
  6495. uuid.parse = parse;
  6496. uuid.unparse = unparse;
  6497. uuid.BufferClass = BufferClass;
  6498. axe._uuid = v1();
  6499. var uuid_default = v4;
  6500. var errorTypes = Object.freeze([ 'EvalError', 'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError' ]);
  6501. function stringifyMessage(_ref2) {
  6502. var topic = _ref2.topic, channelId = _ref2.channelId, message = _ref2.message, messageId = _ref2.messageId, keepalive = _ref2.keepalive;
  6503. var data2 = {
  6504. channelId: channelId,
  6505. topic: topic,
  6506. messageId: messageId,
  6507. keepalive: !!keepalive,
  6508. source: getSource2()
  6509. };
  6510. if (message instanceof Error) {
  6511. data2.error = {
  6512. name: message.name,
  6513. message: message.message,
  6514. stack: message.stack
  6515. };
  6516. } else {
  6517. data2.payload = message;
  6518. }
  6519. return JSON.stringify(data2);
  6520. }
  6521. function parseMessage(dataString) {
  6522. var data2;
  6523. try {
  6524. data2 = JSON.parse(dataString);
  6525. } catch (e) {
  6526. return;
  6527. }
  6528. if (!isRespondableMessage(data2)) {
  6529. return;
  6530. }
  6531. var _data = data2, topic = _data.topic, channelId = _data.channelId, messageId = _data.messageId, keepalive = _data.keepalive;
  6532. var message = _typeof(data2.error) === 'object' ? buildErrorObject(data2.error) : data2.payload;
  6533. return {
  6534. topic: topic,
  6535. message: message,
  6536. messageId: messageId,
  6537. channelId: channelId,
  6538. keepalive: !!keepalive
  6539. };
  6540. }
  6541. function isRespondableMessage(postedMessage) {
  6542. return postedMessage !== null && _typeof(postedMessage) === 'object' && typeof postedMessage.channelId === 'string' && postedMessage.source === getSource2();
  6543. }
  6544. function buildErrorObject(error) {
  6545. var msg = error.message || 'Unknown error occurred';
  6546. var errorName = errorTypes.includes(error.name) ? error.name : 'Error';
  6547. var ErrConstructor = window[errorName] || Error;
  6548. if (error.stack) {
  6549. msg += '\n' + error.stack.replace(error.message, '');
  6550. }
  6551. return new ErrConstructor(msg);
  6552. }
  6553. function getSource2() {
  6554. var application = 'axeAPI';
  6555. var version = '';
  6556. if (typeof axe !== 'undefined' && axe._audit && axe._audit.application) {
  6557. application = axe._audit.application;
  6558. }
  6559. if (typeof axe !== 'undefined') {
  6560. version = axe.version;
  6561. }
  6562. return application + '.' + version;
  6563. }
  6564. function assertIsParentWindow(win) {
  6565. assetNotGlobalWindow(win);
  6566. assert_default(window.parent === win, 'Source of the response must be the parent window.');
  6567. }
  6568. function assertIsFrameWindow(win) {
  6569. assetNotGlobalWindow(win);
  6570. assert_default(win.parent === window, 'Respondable target must be a frame in the current window');
  6571. }
  6572. function assetNotGlobalWindow(win) {
  6573. assert_default(window !== win, 'Messages can not be sent to the same window.');
  6574. }
  6575. var channels = {};
  6576. function storeReplyHandler(channelId, replyHandler) {
  6577. var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  6578. assert_default(!channels[channelId], 'A replyHandler already exists for this message channel.');
  6579. channels[channelId] = {
  6580. replyHandler: replyHandler,
  6581. sendToParent: sendToParent
  6582. };
  6583. }
  6584. function getReplyHandler(channelId) {
  6585. return channels[channelId];
  6586. }
  6587. function deleteReplyHandler(channelId) {
  6588. delete channels[channelId];
  6589. }
  6590. var messageIds = [];
  6591. function createMessageId() {
  6592. var uuid2 = ''.concat(v4(), ':').concat(v4());
  6593. if (messageIds.includes(uuid2)) {
  6594. return createMessageId();
  6595. }
  6596. messageIds.push(uuid2);
  6597. return uuid2;
  6598. }
  6599. function isNewMessage(uuid2) {
  6600. if (messageIds.includes(uuid2)) {
  6601. return false;
  6602. }
  6603. messageIds.push(uuid2);
  6604. return true;
  6605. }
  6606. function postMessage(win, data2, sendToParent, replyHandler) {
  6607. if (typeof replyHandler === 'function') {
  6608. storeReplyHandler(data2.channelId, replyHandler, sendToParent);
  6609. }
  6610. sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
  6611. if (data2.message instanceof Error && !sendToParent) {
  6612. axe.log(data2.message);
  6613. return false;
  6614. }
  6615. var dataString = stringifyMessage(_extends({
  6616. messageId: createMessageId()
  6617. }, data2));
  6618. var allowedOrigins = axe._audit.allowedOrigins;
  6619. if (!allowedOrigins || !allowedOrigins.length) {
  6620. return false;
  6621. }
  6622. allowedOrigins.forEach(function(origin) {
  6623. try {
  6624. win.postMessage(dataString, origin);
  6625. } catch (err2) {
  6626. if (err2 instanceof win.DOMException) {
  6627. throw new Error('allowedOrigins value "'.concat(origin, '" is not a valid origin'));
  6628. }
  6629. throw err2;
  6630. }
  6631. });
  6632. return true;
  6633. }
  6634. function processError(win, error, channelId) {
  6635. if (!win.parent !== window) {
  6636. return axe.log(error);
  6637. }
  6638. try {
  6639. postMessage(win, {
  6640. topic: null,
  6641. channelId: channelId,
  6642. message: error,
  6643. messageId: createMessageId(),
  6644. keepalive: true
  6645. }, true);
  6646. } catch (err2) {
  6647. return axe.log(err2);
  6648. }
  6649. }
  6650. function createResponder(win, channelId) {
  6651. var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  6652. return function respond(message, keepalive, replyHandler) {
  6653. var data2 = {
  6654. channelId: channelId,
  6655. message: message,
  6656. keepalive: keepalive
  6657. };
  6658. postMessage(win, data2, sendToParent, replyHandler);
  6659. };
  6660. }
  6661. function originIsAllowed(origin) {
  6662. var allowedOrigins = axe._audit.allowedOrigins;
  6663. return allowedOrigins && allowedOrigins.includes('*') || allowedOrigins.includes(origin);
  6664. }
  6665. function messageHandler(_ref3, topicHandler) {
  6666. var origin = _ref3.origin, dataString = _ref3.data, win = _ref3.source;
  6667. try {
  6668. var data2 = parseMessage(dataString) || {};
  6669. var channelId = data2.channelId, message = data2.message, messageId = data2.messageId;
  6670. if (!originIsAllowed(origin) || !isNewMessage(messageId)) {
  6671. return;
  6672. }
  6673. if (message instanceof Error && win.parent !== window) {
  6674. axe.log(message);
  6675. return false;
  6676. }
  6677. try {
  6678. if (data2.topic) {
  6679. var responder = createResponder(win, channelId);
  6680. assertIsParentWindow(win);
  6681. topicHandler(data2, responder);
  6682. } else {
  6683. callReplyHandler(win, data2);
  6684. }
  6685. } catch (error) {
  6686. processError(win, error, channelId);
  6687. }
  6688. } catch (error) {
  6689. axe.log(error);
  6690. return false;
  6691. }
  6692. }
  6693. function callReplyHandler(win, data2) {
  6694. var channelId = data2.channelId, message = data2.message, keepalive = data2.keepalive;
  6695. var _ref4 = getReplyHandler(channelId) || {}, replyHandler = _ref4.replyHandler, sendToParent = _ref4.sendToParent;
  6696. if (!replyHandler) {
  6697. return;
  6698. }
  6699. sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
  6700. var responder = createResponder(win, channelId, sendToParent);
  6701. if (!keepalive && channelId) {
  6702. deleteReplyHandler(channelId);
  6703. }
  6704. try {
  6705. replyHandler(message, keepalive, responder);
  6706. } catch (error) {
  6707. axe.log(error);
  6708. responder(error, keepalive);
  6709. }
  6710. }
  6711. var frameMessenger = {
  6712. open: function open(topicHandler) {
  6713. if (typeof window.addEventListener !== 'function') {
  6714. return;
  6715. }
  6716. var handler = function handler(messageEvent) {
  6717. messageHandler(messageEvent, topicHandler);
  6718. };
  6719. window.addEventListener('message', handler, false);
  6720. return function() {
  6721. window.removeEventListener('message', handler, false);
  6722. };
  6723. },
  6724. post: function post(win, data2, replyHandler) {
  6725. if (typeof window.addEventListener !== 'function') {
  6726. return false;
  6727. }
  6728. return postMessage(win, data2, false, replyHandler);
  6729. }
  6730. };
  6731. function setDefaultFrameMessenger(respondable2) {
  6732. respondable2.updateMessenger(frameMessenger);
  6733. }
  6734. var closeHandler;
  6735. var postMessage2;
  6736. var topicHandlers = {};
  6737. function _respondable(win, topic, message, keepalive, replyHandler) {
  6738. var data2 = {
  6739. topic: topic,
  6740. message: message,
  6741. channelId: ''.concat(v4(), ':').concat(v4()),
  6742. keepalive: keepalive
  6743. };
  6744. return postMessage2(win, data2, replyHandler);
  6745. }
  6746. function messageListener(data2, responder) {
  6747. var topic = data2.topic, message = data2.message, keepalive = data2.keepalive;
  6748. var topicHandler = topicHandlers[topic];
  6749. if (!topicHandler) {
  6750. return;
  6751. }
  6752. try {
  6753. topicHandler(message, keepalive, responder);
  6754. } catch (error) {
  6755. axe.log(error);
  6756. responder(error, keepalive);
  6757. }
  6758. }
  6759. _respondable.updateMessenger = function updateMessenger(_ref5) {
  6760. var open = _ref5.open, post = _ref5.post;
  6761. assert_default(typeof open === 'function', 'open callback must be a function');
  6762. assert_default(typeof post === 'function', 'post callback must be a function');
  6763. if (closeHandler) {
  6764. closeHandler();
  6765. }
  6766. var close = open(messageListener);
  6767. if (close) {
  6768. assert_default(typeof close === 'function', 'open callback must return a cleanup function');
  6769. closeHandler = close;
  6770. } else {
  6771. closeHandler = null;
  6772. }
  6773. postMessage2 = post;
  6774. };
  6775. _respondable.subscribe = function subscribe(topic, topicHandler) {
  6776. assert_default(typeof topicHandler === 'function', 'Subscriber callback must be a function');
  6777. assert_default(!topicHandlers[topic], 'Topic '.concat(topic, ' is already registered to.'));
  6778. topicHandlers[topic] = topicHandler;
  6779. };
  6780. _respondable.isInFrame = function isInFrame() {
  6781. var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  6782. return !!win.frameElement;
  6783. };
  6784. setDefaultFrameMessenger(_respondable);
  6785. function _sendCommandToFrame(node, parameters, resolve, reject) {
  6786. var _parameters$options$p, _parameters$options;
  6787. var win = node.contentWindow;
  6788. var pingWaitTime = (_parameters$options$p = (_parameters$options = parameters.options) === null || _parameters$options === void 0 ? void 0 : _parameters$options.pingWaitTime) !== null && _parameters$options$p !== void 0 ? _parameters$options$p : 500;
  6789. if (!win) {
  6790. log_default('Frame does not have a content window', node);
  6791. resolve(null);
  6792. return;
  6793. }
  6794. if (pingWaitTime === 0) {
  6795. callAxeStart(node, parameters, resolve, reject);
  6796. return;
  6797. }
  6798. var timeout = setTimeout(function() {
  6799. timeout = setTimeout(function() {
  6800. if (!parameters.debug) {
  6801. resolve(null);
  6802. } else {
  6803. reject(err('No response from frame', node));
  6804. }
  6805. }, 0);
  6806. }, pingWaitTime);
  6807. _respondable(win, 'axe.ping', null, void 0, function() {
  6808. clearTimeout(timeout);
  6809. callAxeStart(node, parameters, resolve, reject);
  6810. });
  6811. }
  6812. function callAxeStart(node, parameters, resolve, reject) {
  6813. var _parameters$options$f, _parameters$options2;
  6814. var frameWaitTime = (_parameters$options$f = (_parameters$options2 = parameters.options) === null || _parameters$options2 === void 0 ? void 0 : _parameters$options2.frameWaitTime) !== null && _parameters$options$f !== void 0 ? _parameters$options$f : 6e4;
  6815. var win = node.contentWindow;
  6816. var timeout = setTimeout(function collectResultFramesTimeout() {
  6817. reject(err('Axe in frame timed out', node));
  6818. }, frameWaitTime);
  6819. _respondable(win, 'axe.start', parameters, void 0, function(data2) {
  6820. clearTimeout(timeout);
  6821. if (data2 instanceof Error === false) {
  6822. resolve(data2);
  6823. } else {
  6824. reject(data2);
  6825. }
  6826. });
  6827. }
  6828. function err(message, node) {
  6829. var selector;
  6830. if (axe._tree) {
  6831. selector = _getSelector(node);
  6832. }
  6833. return new Error(message + ': ' + (selector || node));
  6834. }
  6835. function getAllChecks(object) {
  6836. var result = [];
  6837. return result.concat(object.any || []).concat(object.all || []).concat(object.none || []);
  6838. }
  6839. var get_all_checks_default = getAllChecks;
  6840. function findBy(array, key, value) {
  6841. if (Array.isArray(array)) {
  6842. return array.find(function(obj) {
  6843. return _typeof(obj) === 'object' && obj[key] === value;
  6844. });
  6845. }
  6846. }
  6847. var find_by_default = findBy;
  6848. function pushFrame(resultSet, options, frameSpec) {
  6849. resultSet.forEach(function(res) {
  6850. res.node = dq_element_default.fromFrame(res.node, options, frameSpec);
  6851. var checks = get_all_checks_default(res);
  6852. checks.forEach(function(check) {
  6853. check.relatedNodes = check.relatedNodes.map(function(node) {
  6854. return dq_element_default.fromFrame(node, options, frameSpec);
  6855. });
  6856. });
  6857. });
  6858. }
  6859. function spliceNodes(target, to) {
  6860. var firstFromFrame = to[0].node;
  6861. for (var _i2 = 0; _i2 < target.length; _i2++) {
  6862. var node = target[_i2].node;
  6863. var resultSort = nodeIndexSort(node.nodeIndexes, firstFromFrame.nodeIndexes);
  6864. if (resultSort > 0 || resultSort === 0 && firstFromFrame.selector.length < node.selector.length) {
  6865. target.splice.apply(target, [ _i2, 0 ].concat(_toConsumableArray(to)));
  6866. return;
  6867. }
  6868. }
  6869. target.push.apply(target, _toConsumableArray(to));
  6870. }
  6871. function normalizeResult(result) {
  6872. if (!result || !result.results) {
  6873. return null;
  6874. }
  6875. if (!Array.isArray(result.results)) {
  6876. return [ result.results ];
  6877. }
  6878. if (!result.results.length) {
  6879. return null;
  6880. }
  6881. return result.results;
  6882. }
  6883. function mergeResults(frameResults, options) {
  6884. var mergedResult = [];
  6885. frameResults.forEach(function(frameResult) {
  6886. var results = normalizeResult(frameResult);
  6887. if (!results || !results.length) {
  6888. return;
  6889. }
  6890. var frameSpec = getFrameSpec(frameResult, options);
  6891. results.forEach(function(ruleResult) {
  6892. if (ruleResult.nodes && frameSpec) {
  6893. pushFrame(ruleResult.nodes, options, frameSpec);
  6894. }
  6895. var res = find_by_default(mergedResult, 'id', ruleResult.id);
  6896. if (!res) {
  6897. mergedResult.push(ruleResult);
  6898. } else {
  6899. if (ruleResult.nodes.length) {
  6900. spliceNodes(res.nodes, ruleResult.nodes);
  6901. }
  6902. }
  6903. });
  6904. });
  6905. mergedResult.forEach(function(result) {
  6906. if (result.nodes) {
  6907. result.nodes.sort(function(nodeA, nodeB) {
  6908. return nodeIndexSort(nodeA.node.nodeIndexes, nodeB.node.nodeIndexes);
  6909. });
  6910. }
  6911. });
  6912. return mergedResult;
  6913. }
  6914. function nodeIndexSort() {
  6915. var nodeIndexesA = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  6916. var nodeIndexesB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  6917. var length = Math.max(nodeIndexesA === null || nodeIndexesA === void 0 ? void 0 : nodeIndexesA.length, nodeIndexesB === null || nodeIndexesB === void 0 ? void 0 : nodeIndexesB.length);
  6918. for (var _i3 = 0; _i3 < length; _i3++) {
  6919. var indexA = nodeIndexesA === null || nodeIndexesA === void 0 ? void 0 : nodeIndexesA[_i3];
  6920. var indexB = nodeIndexesB === null || nodeIndexesB === void 0 ? void 0 : nodeIndexesB[_i3];
  6921. if (typeof indexA !== 'number' || isNaN(indexA)) {
  6922. return _i3 === 0 ? 1 : -1;
  6923. }
  6924. if (typeof indexB !== 'number' || isNaN(indexB)) {
  6925. return _i3 === 0 ? -1 : 1;
  6926. }
  6927. if (indexA !== indexB) {
  6928. return indexA - indexB;
  6929. }
  6930. }
  6931. return 0;
  6932. }
  6933. var merge_results_default = mergeResults;
  6934. function getFrameSpec(frameResult, options) {
  6935. if (frameResult.frameElement) {
  6936. return new dq_element_default(frameResult.frameElement, options);
  6937. } else if (frameResult.frameSpec) {
  6938. return frameResult.frameSpec;
  6939. }
  6940. return null;
  6941. }
  6942. function _collectResultsFromFrames(parentContent, options, command, parameter, resolve, reject) {
  6943. var q = queue_default();
  6944. var frames = parentContent.frames;
  6945. frames.forEach(function(_ref6) {
  6946. var frameElement = _ref6.node, context = _objectWithoutProperties(_ref6, _excluded);
  6947. q.defer(function(res, rej) {
  6948. var params = {
  6949. options: options,
  6950. command: command,
  6951. parameter: parameter,
  6952. context: context
  6953. };
  6954. function callback(results) {
  6955. if (!results) {
  6956. return res(null);
  6957. }
  6958. return res({
  6959. results: results,
  6960. frameElement: frameElement
  6961. });
  6962. }
  6963. _sendCommandToFrame(frameElement, params, callback, rej);
  6964. });
  6965. });
  6966. q.then(function(data2) {
  6967. resolve(merge_results_default(data2, options));
  6968. })['catch'](reject);
  6969. }
  6970. function _contains(vNode, otherVNode) {
  6971. if (!vNode.shadowId && !otherVNode.shadowId && vNode.actualNode && typeof vNode.actualNode.contains === 'function') {
  6972. return vNode.actualNode.contains(otherVNode.actualNode);
  6973. }
  6974. do {
  6975. if (vNode === otherVNode) {
  6976. return true;
  6977. } else if (otherVNode.nodeIndex < vNode.nodeIndex) {
  6978. return false;
  6979. }
  6980. otherVNode = otherVNode.parent;
  6981. } while (otherVNode);
  6982. return false;
  6983. }
  6984. function deepMerge() {
  6985. var target = {};
  6986. for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
  6987. sources[_key] = arguments[_key];
  6988. }
  6989. sources.forEach(function(source) {
  6990. if (!source || _typeof(source) !== 'object' || Array.isArray(source)) {
  6991. return;
  6992. }
  6993. for (var _i4 = 0, _Object$keys = Object.keys(source); _i4 < _Object$keys.length; _i4++) {
  6994. var key = _Object$keys[_i4];
  6995. if (!target.hasOwnProperty(key) || _typeof(source[key]) !== 'object' || Array.isArray(target[key])) {
  6996. target[key] = source[key];
  6997. } else {
  6998. target[key] = deepMerge(target[key], source[key]);
  6999. }
  7000. }
  7001. });
  7002. return target;
  7003. }
  7004. var deep_merge_default = deepMerge;
  7005. function extendMetaData(to, from) {
  7006. Object.assign(to, from);
  7007. Object.keys(from).filter(function(prop) {
  7008. return typeof from[prop] === 'function';
  7009. }).forEach(function(prop) {
  7010. to[prop] = null;
  7011. try {
  7012. to[prop] = from[prop](to);
  7013. } catch (e) {}
  7014. });
  7015. }
  7016. var extend_meta_data_default = extendMetaData;
  7017. var possibleShadowRoots = [ 'article', 'aside', 'blockquote', 'body', 'div', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'main', 'nav', 'p', 'section', 'span' ];
  7018. function isShadowRoot(node) {
  7019. if (node.shadowRoot) {
  7020. var nodeName2 = node.nodeName.toLowerCase();
  7021. if (possibleShadowRoots.includes(nodeName2) || /^[a-z][a-z0-9_.-]*-[a-z0-9_.-]*$/.test(nodeName2)) {
  7022. return true;
  7023. }
  7024. }
  7025. return false;
  7026. }
  7027. var is_shadow_root_default = isShadowRoot;
  7028. var dom_exports = {};
  7029. __export(dom_exports, {
  7030. createGrid: function createGrid() {
  7031. return _createGrid;
  7032. },
  7033. findElmsInContext: function findElmsInContext() {
  7034. return find_elms_in_context_default;
  7035. },
  7036. findNearbyElms: function findNearbyElms() {
  7037. return _findNearbyElms;
  7038. },
  7039. findUp: function findUp() {
  7040. return find_up_default;
  7041. },
  7042. findUpVirtual: function findUpVirtual() {
  7043. return find_up_virtual_default;
  7044. },
  7045. focusDisabled: function focusDisabled() {
  7046. return focus_disabled_default;
  7047. },
  7048. getComposedParent: function getComposedParent() {
  7049. return get_composed_parent_default;
  7050. },
  7051. getElementByReference: function getElementByReference() {
  7052. return get_element_by_reference_default;
  7053. },
  7054. getElementCoordinates: function getElementCoordinates() {
  7055. return get_element_coordinates_default;
  7056. },
  7057. getElementStack: function getElementStack() {
  7058. return get_element_stack_default;
  7059. },
  7060. getModalDialog: function getModalDialog() {
  7061. return get_modal_dialog_default;
  7062. },
  7063. getOverflowHiddenAncestors: function getOverflowHiddenAncestors() {
  7064. return get_overflow_hidden_ancestors_default;
  7065. },
  7066. getRootNode: function getRootNode() {
  7067. return get_root_node_default2;
  7068. },
  7069. getScrollOffset: function getScrollOffset() {
  7070. return get_scroll_offset_default;
  7071. },
  7072. getTabbableElements: function getTabbableElements() {
  7073. return get_tabbable_elements_default;
  7074. },
  7075. getTextElementStack: function getTextElementStack() {
  7076. return get_text_element_stack_default;
  7077. },
  7078. getViewportSize: function getViewportSize() {
  7079. return get_viewport_size_default;
  7080. },
  7081. getVisibleChildTextRects: function getVisibleChildTextRects() {
  7082. return get_visible_child_text_rects_default;
  7083. },
  7084. hasContent: function hasContent() {
  7085. return has_content_default;
  7086. },
  7087. hasContentVirtual: function hasContentVirtual() {
  7088. return has_content_virtual_default;
  7089. },
  7090. hasLangText: function hasLangText() {
  7091. return _hasLangText;
  7092. },
  7093. idrefs: function idrefs() {
  7094. return idrefs_default;
  7095. },
  7096. insertedIntoFocusOrder: function insertedIntoFocusOrder() {
  7097. return inserted_into_focus_order_default;
  7098. },
  7099. isCurrentPageLink: function isCurrentPageLink() {
  7100. return _isCurrentPageLink;
  7101. },
  7102. isFocusable: function isFocusable() {
  7103. return _isFocusable;
  7104. },
  7105. isHTML5: function isHTML5() {
  7106. return is_html5_default;
  7107. },
  7108. isHiddenForEveryone: function isHiddenForEveryone() {
  7109. return _isHiddenForEveryone;
  7110. },
  7111. isHiddenWithCSS: function isHiddenWithCSS() {
  7112. return is_hidden_with_css_default;
  7113. },
  7114. isInTabOrder: function isInTabOrder() {
  7115. return _isInTabOrder;
  7116. },
  7117. isInTextBlock: function isInTextBlock() {
  7118. return is_in_text_block_default;
  7119. },
  7120. isInert: function isInert() {
  7121. return _isInert;
  7122. },
  7123. isModalOpen: function isModalOpen() {
  7124. return is_modal_open_default;
  7125. },
  7126. isMultiline: function isMultiline() {
  7127. return _isMultiline;
  7128. },
  7129. isNativelyFocusable: function isNativelyFocusable() {
  7130. return is_natively_focusable_default;
  7131. },
  7132. isNode: function isNode() {
  7133. return is_node_default;
  7134. },
  7135. isOffscreen: function isOffscreen() {
  7136. return is_offscreen_default;
  7137. },
  7138. isOpaque: function isOpaque() {
  7139. return is_opaque_default;
  7140. },
  7141. isSkipLink: function isSkipLink() {
  7142. return _isSkipLink;
  7143. },
  7144. isVisible: function isVisible() {
  7145. return is_visible_default;
  7146. },
  7147. isVisibleOnScreen: function isVisibleOnScreen() {
  7148. return _isVisibleOnScreen;
  7149. },
  7150. isVisibleToScreenReaders: function isVisibleToScreenReaders() {
  7151. return _isVisibleToScreenReaders;
  7152. },
  7153. isVisualContent: function isVisualContent() {
  7154. return is_visual_content_default;
  7155. },
  7156. reduceToElementsBelowFloating: function reduceToElementsBelowFloating() {
  7157. return reduce_to_elements_below_floating_default;
  7158. },
  7159. shadowElementsFromPoint: function shadowElementsFromPoint() {
  7160. return shadow_elements_from_point_default;
  7161. },
  7162. urlPropsFromAttribute: function urlPropsFromAttribute() {
  7163. return url_props_from_attribute_default;
  7164. },
  7165. visuallyContains: function visuallyContains() {
  7166. return _visuallyContains;
  7167. },
  7168. visuallyOverlaps: function visuallyOverlaps() {
  7169. return visually_overlaps_default;
  7170. },
  7171. visuallySort: function visuallySort() {
  7172. return _visuallySort;
  7173. }
  7174. });
  7175. function getRootNode(node) {
  7176. var doc = node.getRootNode && node.getRootNode() || document;
  7177. if (doc === node) {
  7178. doc = document;
  7179. }
  7180. return doc;
  7181. }
  7182. var get_root_node_default = getRootNode;
  7183. var get_root_node_default2 = get_root_node_default;
  7184. function findElmsInContext(_ref7) {
  7185. var context = _ref7.context, value = _ref7.value, attr = _ref7.attr, _ref7$elm = _ref7.elm, elm = _ref7$elm === void 0 ? '' : _ref7$elm;
  7186. var root;
  7187. var escapedValue = escape_selector_default(value);
  7188. if (context.nodeType === 9 || context.nodeType === 11) {
  7189. root = context;
  7190. } else {
  7191. root = get_root_node_default2(context);
  7192. }
  7193. return Array.from(root.querySelectorAll(elm + '[' + attr + '=' + escapedValue + ']'));
  7194. }
  7195. var find_elms_in_context_default = findElmsInContext;
  7196. function findUpVirtual(element, target) {
  7197. var parent;
  7198. parent = element.actualNode;
  7199. if (!element.shadowId && typeof element.actualNode.closest === 'function') {
  7200. var match = element.actualNode.closest(target);
  7201. if (match) {
  7202. return match;
  7203. }
  7204. return null;
  7205. }
  7206. do {
  7207. parent = parent.assignedSlot ? parent.assignedSlot : parent.parentNode;
  7208. if (parent && parent.nodeType === 11) {
  7209. parent = parent.host;
  7210. }
  7211. } while (parent && !element_matches_default(parent, target) && parent !== document.documentElement);
  7212. if (!parent) {
  7213. return null;
  7214. }
  7215. if (!element_matches_default(parent, target)) {
  7216. return null;
  7217. }
  7218. return parent;
  7219. }
  7220. var find_up_virtual_default = findUpVirtual;
  7221. function findUp(element, target) {
  7222. return find_up_virtual_default(get_node_from_tree_default(element), target);
  7223. }
  7224. var find_up_default = findUp;
  7225. var import_memoizee = __toModule(require_memoizee());
  7226. axe._memoizedFns = [];
  7227. function memoizeImplementation(fn) {
  7228. var memoized = (0, import_memoizee['default'])(fn);
  7229. axe._memoizedFns.push(memoized);
  7230. return memoized;
  7231. }
  7232. var memoize_default = memoizeImplementation;
  7233. function _rectsOverlap(rect1, rect2) {
  7234. return (rect1.left | 0) < (rect2.right | 0) && (rect1.right | 0) > (rect2.left | 0) && (rect1.top | 0) < (rect2.bottom | 0) && (rect1.bottom | 0) > (rect2.top | 0);
  7235. }
  7236. var getOverflowHiddenAncestors = memoize_default(function getOverflowHiddenAncestorsMemoized(vNode) {
  7237. var ancestors = [];
  7238. if (!vNode) {
  7239. return ancestors;
  7240. }
  7241. var overflow = vNode.getComputedStylePropertyValue('overflow');
  7242. if (overflow === 'hidden') {
  7243. ancestors.push(vNode);
  7244. }
  7245. return ancestors.concat(getOverflowHiddenAncestors(vNode.parent));
  7246. });
  7247. var get_overflow_hidden_ancestors_default = getOverflowHiddenAncestors;
  7248. var clipRegex = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/;
  7249. var clipPathRegex = /(\w+)\((\d+)/;
  7250. function nativelyHidden(vNode) {
  7251. return [ 'style', 'script', 'noscript', 'template' ].includes(vNode.props.nodeName);
  7252. }
  7253. function displayHidden(vNode) {
  7254. if (vNode.props.nodeName === 'area') {
  7255. return false;
  7256. }
  7257. return vNode.getComputedStylePropertyValue('display') === 'none';
  7258. }
  7259. function visibilityHidden(vNode) {
  7260. var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref8.isAncestor;
  7261. return !isAncestor && [ 'hidden', 'collapse' ].includes(vNode.getComputedStylePropertyValue('visibility'));
  7262. }
  7263. function contentVisibiltyHidden(vNode) {
  7264. var _ref9 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref9.isAncestor;
  7265. return !!isAncestor && vNode.getComputedStylePropertyValue('content-visibility') === 'hidden';
  7266. }
  7267. function ariaHidden(vNode) {
  7268. return vNode.attr('aria-hidden') === 'true';
  7269. }
  7270. function opacityHidden(vNode) {
  7271. return vNode.getComputedStylePropertyValue('opacity') === '0';
  7272. }
  7273. function scrollHidden(vNode) {
  7274. var scroll = _getScroll(vNode.actualNode);
  7275. var elHeight = parseInt(vNode.getComputedStylePropertyValue('height'));
  7276. var elWidth = parseInt(vNode.getComputedStylePropertyValue('width'));
  7277. return !!scroll && (elHeight === 0 || elWidth === 0);
  7278. }
  7279. function overflowHidden(vNode) {
  7280. var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref10.isAncestor;
  7281. if (isAncestor) {
  7282. return false;
  7283. }
  7284. var rect = vNode.boundingClientRect;
  7285. var nodes = get_overflow_hidden_ancestors_default(vNode);
  7286. if (!nodes.length) {
  7287. return false;
  7288. }
  7289. return nodes.some(function(node) {
  7290. var nodeRect = node.boundingClientRect;
  7291. if (nodeRect.width < 2 || nodeRect.height < 2) {
  7292. return true;
  7293. }
  7294. return !_rectsOverlap(rect, nodeRect);
  7295. });
  7296. }
  7297. function clipHidden(vNode) {
  7298. var matchesClip = vNode.getComputedStylePropertyValue('clip').match(clipRegex);
  7299. var matchesClipPath = vNode.getComputedStylePropertyValue('clip-path').match(clipPathRegex);
  7300. if (matchesClip && matchesClip.length === 5) {
  7301. var position = vNode.getComputedStylePropertyValue('position');
  7302. if ([ 'fixed', 'absolute' ].includes(position)) {
  7303. return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0;
  7304. }
  7305. }
  7306. if (matchesClipPath) {
  7307. var type = matchesClipPath[1];
  7308. var value = parseInt(matchesClipPath[2], 10);
  7309. switch (type) {
  7310. case 'inset':
  7311. return value >= 50;
  7312. case 'circle':
  7313. return value === 0;
  7314. default:
  7315. }
  7316. }
  7317. return false;
  7318. }
  7319. function areaHidden(vNode, visibleFunction) {
  7320. var mapEl = closest_default(vNode, 'map');
  7321. if (!mapEl) {
  7322. return true;
  7323. }
  7324. var mapElName = mapEl.attr('name');
  7325. if (!mapElName) {
  7326. return true;
  7327. }
  7328. var mapElRootNode = get_root_node_default(vNode.actualNode);
  7329. if (!mapElRootNode || mapElRootNode.nodeType !== 9) {
  7330. return true;
  7331. }
  7332. var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]'));
  7333. if (!refs || !refs.length) {
  7334. return true;
  7335. }
  7336. return refs.some(function(ref) {
  7337. return !visibleFunction(ref);
  7338. });
  7339. }
  7340. function detailsHidden(vNode) {
  7341. var _vNode$parent;
  7342. if (((_vNode$parent = vNode.parent) === null || _vNode$parent === void 0 ? void 0 : _vNode$parent.props.nodeName) !== 'details') {
  7343. return false;
  7344. }
  7345. if (vNode.props.nodeName === 'summary') {
  7346. var firstSummary = vNode.parent.children.find(function(node) {
  7347. return node.props.nodeName === 'summary';
  7348. });
  7349. if (firstSummary === vNode) {
  7350. return false;
  7351. }
  7352. }
  7353. return !vNode.parent.hasAttr('open');
  7354. }
  7355. var hiddenMethods = [ displayHidden, visibilityHidden, contentVisibiltyHidden, detailsHidden ];
  7356. function _isHiddenForEveryone(vNode) {
  7357. var _ref11 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, skipAncestors = _ref11.skipAncestors, _ref11$isAncestor = _ref11.isAncestor, isAncestor = _ref11$isAncestor === void 0 ? false : _ref11$isAncestor;
  7358. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  7359. if (skipAncestors) {
  7360. return isHiddenSelf(vNode, isAncestor);
  7361. }
  7362. return isHiddenAncestors(vNode, isAncestor);
  7363. }
  7364. var isHiddenSelf = memoize_default(function isHiddenSelfMemoized(vNode, isAncestor) {
  7365. if (nativelyHidden(vNode)) {
  7366. return true;
  7367. }
  7368. if (!vNode.actualNode) {
  7369. return false;
  7370. }
  7371. if (hiddenMethods.some(function(method) {
  7372. return method(vNode, {
  7373. isAncestor: isAncestor
  7374. });
  7375. })) {
  7376. return true;
  7377. }
  7378. if (!vNode.actualNode.isConnected) {
  7379. return true;
  7380. }
  7381. return false;
  7382. });
  7383. var isHiddenAncestors = memoize_default(function isHiddenAncestorsMemoized(vNode, isAncestor) {
  7384. if (isHiddenSelf(vNode, isAncestor)) {
  7385. return true;
  7386. }
  7387. if (!vNode.parent) {
  7388. return false;
  7389. }
  7390. return isHiddenAncestors(vNode.parent, true);
  7391. });
  7392. function getComposedParent(element) {
  7393. if (element.assignedSlot) {
  7394. return getComposedParent(element.assignedSlot);
  7395. } else if (element.parentNode) {
  7396. var parentNode = element.parentNode;
  7397. if (parentNode.nodeType === 1) {
  7398. return parentNode;
  7399. } else if (parentNode.host) {
  7400. return parentNode.host;
  7401. }
  7402. }
  7403. return null;
  7404. }
  7405. var get_composed_parent_default = getComposedParent;
  7406. function getScrollOffset(element) {
  7407. if (!element.nodeType && element.document) {
  7408. element = element.document;
  7409. }
  7410. if (element.nodeType === 9) {
  7411. var docElement = element.documentElement, body = element.body;
  7412. return {
  7413. left: docElement && docElement.scrollLeft || body && body.scrollLeft || 0,
  7414. top: docElement && docElement.scrollTop || body && body.scrollTop || 0
  7415. };
  7416. }
  7417. return {
  7418. left: element.scrollLeft,
  7419. top: element.scrollTop
  7420. };
  7421. }
  7422. var get_scroll_offset_default = getScrollOffset;
  7423. function getElementCoordinates(element) {
  7424. var scrollOffset = get_scroll_offset_default(document), xOffset = scrollOffset.left, yOffset = scrollOffset.top, coords = element.getBoundingClientRect();
  7425. return {
  7426. top: coords.top + yOffset,
  7427. right: coords.right + xOffset,
  7428. bottom: coords.bottom + yOffset,
  7429. left: coords.left + xOffset,
  7430. width: coords.right - coords.left,
  7431. height: coords.bottom - coords.top
  7432. };
  7433. }
  7434. var get_element_coordinates_default = getElementCoordinates;
  7435. function getViewportSize(win) {
  7436. var doc = win.document;
  7437. var docElement = doc.documentElement;
  7438. if (win.innerWidth) {
  7439. return {
  7440. width: win.innerWidth,
  7441. height: win.innerHeight
  7442. };
  7443. }
  7444. if (docElement) {
  7445. return {
  7446. width: docElement.clientWidth,
  7447. height: docElement.clientHeight
  7448. };
  7449. }
  7450. var body = doc.body;
  7451. return {
  7452. width: body.clientWidth,
  7453. height: body.clientHeight
  7454. };
  7455. }
  7456. var get_viewport_size_default = getViewportSize;
  7457. function noParentScrolled(element, offset) {
  7458. element = get_composed_parent_default(element);
  7459. while (element && element.nodeName.toLowerCase() !== 'html') {
  7460. if (element.scrollTop) {
  7461. offset += element.scrollTop;
  7462. if (offset >= 0) {
  7463. return false;
  7464. }
  7465. }
  7466. element = get_composed_parent_default(element);
  7467. }
  7468. return true;
  7469. }
  7470. function isOffscreen(element) {
  7471. var _ref12 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref12.isAncestor;
  7472. if (isAncestor) {
  7473. return false;
  7474. }
  7475. element = element instanceof abstract_virtual_node_default ? element.actualNode : element;
  7476. if (!element) {
  7477. return void 0;
  7478. }
  7479. var leftBoundary;
  7480. var docElement = document.documentElement;
  7481. var styl = window.getComputedStyle(element);
  7482. var dir = window.getComputedStyle(document.body || docElement).getPropertyValue('direction');
  7483. var coords = get_element_coordinates_default(element);
  7484. if (coords.bottom < 0 && (noParentScrolled(element, coords.bottom) || styl.position === 'absolute')) {
  7485. return true;
  7486. }
  7487. if (coords.left === 0 && coords.right === 0) {
  7488. return false;
  7489. }
  7490. if (dir === 'ltr') {
  7491. if (coords.right <= 0) {
  7492. return true;
  7493. }
  7494. } else {
  7495. leftBoundary = Math.max(docElement.scrollWidth, get_viewport_size_default(window).width);
  7496. if (coords.left >= leftBoundary) {
  7497. return true;
  7498. }
  7499. }
  7500. return false;
  7501. }
  7502. var is_offscreen_default = isOffscreen;
  7503. var hiddenMethods2 = [ opacityHidden, scrollHidden, overflowHidden, clipHidden, is_offscreen_default ];
  7504. function _isVisibleOnScreen(vNode) {
  7505. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  7506. return isVisibleOnScreenVirtual(vNode);
  7507. }
  7508. var isVisibleOnScreenVirtual = memoize_default(function isVisibleOnScreenMemoized(vNode, isAncestor) {
  7509. if (vNode.actualNode && vNode.props.nodeName === 'area') {
  7510. return !areaHidden(vNode, isVisibleOnScreenVirtual);
  7511. }
  7512. if (_isHiddenForEveryone(vNode, {
  7513. skipAncestors: true,
  7514. isAncestor: isAncestor
  7515. })) {
  7516. return false;
  7517. }
  7518. if (vNode.actualNode && hiddenMethods2.some(function(method) {
  7519. return method(vNode, {
  7520. isAncestor: isAncestor
  7521. });
  7522. })) {
  7523. return false;
  7524. }
  7525. if (!vNode.parent) {
  7526. return true;
  7527. }
  7528. return isVisibleOnScreenVirtual(vNode.parent, true);
  7529. });
  7530. function _getBoundingRect(rectA, rectB) {
  7531. var top = Math.min(rectA.top, rectB.top);
  7532. var right = Math.max(rectA.right, rectB.right);
  7533. var bottom = Math.max(rectA.bottom, rectB.bottom);
  7534. var left = Math.min(rectA.left, rectB.left);
  7535. return new window.DOMRect(left, top, right - left, bottom - top);
  7536. }
  7537. function _isPointInRect(_ref13, _ref14) {
  7538. var x = _ref13.x, y = _ref13.y;
  7539. var top = _ref14.top, right = _ref14.right, bottom = _ref14.bottom, left = _ref14.left;
  7540. return y >= top && x <= right && y <= bottom && x >= left;
  7541. }
  7542. var ROOT_ORDER = 0;
  7543. var DEFAULT_ORDER = .1;
  7544. var FLOAT_ORDER = .2;
  7545. var POSITION_STATIC_ORDER = .3;
  7546. var nodeIndex = 0;
  7547. function _createGrid() {
  7548. var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
  7549. var rootGrid = arguments.length > 1 ? arguments[1] : undefined;
  7550. var parentVNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  7551. if (cache_default.get('gridCreated') && !parentVNode) {
  7552. return constants_default.gridSize;
  7553. }
  7554. cache_default.set('gridCreated', true);
  7555. if (!parentVNode) {
  7556. var _rootGrid;
  7557. var vNode = get_node_from_tree_default(document.documentElement);
  7558. if (!vNode) {
  7559. vNode = new virtual_node_default(document.documentElement);
  7560. }
  7561. nodeIndex = 0;
  7562. vNode._stackingOrder = [ createContext(ROOT_ORDER, null) ];
  7563. (_rootGrid = rootGrid) !== null && _rootGrid !== void 0 ? _rootGrid : rootGrid = new Grid();
  7564. addNodeToGrid(rootGrid, vNode);
  7565. if (_getScroll(vNode.actualNode)) {
  7566. var subGrid = new Grid(vNode);
  7567. vNode._subGrid = subGrid;
  7568. }
  7569. }
  7570. var treeWalker = document.createTreeWalker(root, window.NodeFilter.SHOW_ELEMENT, null, false);
  7571. var node = parentVNode ? treeWalker.nextNode() : treeWalker.currentNode;
  7572. while (node) {
  7573. var _vNode = get_node_from_tree_default(node);
  7574. if (_vNode && _vNode.parent) {
  7575. parentVNode = _vNode.parent;
  7576. } else if (node.assignedSlot) {
  7577. parentVNode = get_node_from_tree_default(node.assignedSlot);
  7578. } else if (node.parentElement) {
  7579. parentVNode = get_node_from_tree_default(node.parentElement);
  7580. } else if (node.parentNode && get_node_from_tree_default(node.parentNode)) {
  7581. parentVNode = get_node_from_tree_default(node.parentNode);
  7582. }
  7583. if (!_vNode) {
  7584. _vNode = new axe.VirtualNode(node, parentVNode);
  7585. }
  7586. _vNode._stackingOrder = createStackingOrder(_vNode, parentVNode, nodeIndex++);
  7587. var scrollRegionParent = findScrollRegionParent(_vNode, parentVNode);
  7588. var grid = scrollRegionParent ? scrollRegionParent._subGrid : rootGrid;
  7589. if (_getScroll(_vNode.actualNode)) {
  7590. var _subGrid = new Grid(_vNode);
  7591. _vNode._subGrid = _subGrid;
  7592. }
  7593. var rect = _vNode.boundingClientRect;
  7594. if (rect.width !== 0 && rect.height !== 0 && _isVisibleOnScreen(node)) {
  7595. addNodeToGrid(grid, _vNode);
  7596. }
  7597. if (is_shadow_root_default(node)) {
  7598. _createGrid(node.shadowRoot, grid, _vNode);
  7599. }
  7600. node = treeWalker.nextNode();
  7601. }
  7602. return constants_default.gridSize;
  7603. }
  7604. function isStackingContext(vNode, parentVNode) {
  7605. var position = vNode.getComputedStylePropertyValue('position');
  7606. var zIndex = vNode.getComputedStylePropertyValue('z-index');
  7607. if (position === 'fixed' || position === 'sticky') {
  7608. return true;
  7609. }
  7610. if (zIndex !== 'auto' && position !== 'static') {
  7611. return true;
  7612. }
  7613. if (vNode.getComputedStylePropertyValue('opacity') !== '1') {
  7614. return true;
  7615. }
  7616. var transform = vNode.getComputedStylePropertyValue('-webkit-transform') || vNode.getComputedStylePropertyValue('-ms-transform') || vNode.getComputedStylePropertyValue('transform') || 'none';
  7617. if (transform !== 'none') {
  7618. return true;
  7619. }
  7620. var mixBlendMode = vNode.getComputedStylePropertyValue('mix-blend-mode');
  7621. if (mixBlendMode && mixBlendMode !== 'normal') {
  7622. return true;
  7623. }
  7624. var filter = vNode.getComputedStylePropertyValue('filter');
  7625. if (filter && filter !== 'none') {
  7626. return true;
  7627. }
  7628. var perspective = vNode.getComputedStylePropertyValue('perspective');
  7629. if (perspective && perspective !== 'none') {
  7630. return true;
  7631. }
  7632. var clipPath = vNode.getComputedStylePropertyValue('clip-path');
  7633. if (clipPath && clipPath !== 'none') {
  7634. return true;
  7635. }
  7636. var mask = vNode.getComputedStylePropertyValue('-webkit-mask') || vNode.getComputedStylePropertyValue('mask') || 'none';
  7637. if (mask !== 'none') {
  7638. return true;
  7639. }
  7640. var maskImage = vNode.getComputedStylePropertyValue('-webkit-mask-image') || vNode.getComputedStylePropertyValue('mask-image') || 'none';
  7641. if (maskImage !== 'none') {
  7642. return true;
  7643. }
  7644. var maskBorder = vNode.getComputedStylePropertyValue('-webkit-mask-border') || vNode.getComputedStylePropertyValue('mask-border') || 'none';
  7645. if (maskBorder !== 'none') {
  7646. return true;
  7647. }
  7648. if (vNode.getComputedStylePropertyValue('isolation') === 'isolate') {
  7649. return true;
  7650. }
  7651. var willChange = vNode.getComputedStylePropertyValue('will-change');
  7652. if (willChange === 'transform' || willChange === 'opacity') {
  7653. return true;
  7654. }
  7655. if (vNode.getComputedStylePropertyValue('-webkit-overflow-scrolling') === 'touch') {
  7656. return true;
  7657. }
  7658. var contain = vNode.getComputedStylePropertyValue('contain');
  7659. if ([ 'layout', 'paint', 'strict', 'content' ].includes(contain)) {
  7660. return true;
  7661. }
  7662. if (zIndex !== 'auto' && isFlexOrGridContainer(parentVNode)) {
  7663. return true;
  7664. }
  7665. return false;
  7666. }
  7667. function isFlexOrGridContainer(vNode) {
  7668. if (!vNode) {
  7669. return false;
  7670. }
  7671. var display = vNode.getComputedStylePropertyValue('display');
  7672. return [ 'flex', 'inline-flex', 'grid', 'inline-grid' ].includes(display);
  7673. }
  7674. function createStackingOrder(vNode, parentVNode, nodeIndex3) {
  7675. var stackingOrder = parentVNode._stackingOrder.slice();
  7676. if (!isStackingContext(vNode, parentVNode)) {
  7677. if (vNode.getComputedStylePropertyValue('position') !== 'static') {
  7678. stackingOrder.push(createContext(POSITION_STATIC_ORDER, vNode));
  7679. } else if (vNode.getComputedStylePropertyValue('float') !== 'none') {
  7680. stackingOrder.push(createContext(FLOAT_ORDER, vNode));
  7681. }
  7682. return stackingOrder;
  7683. }
  7684. var index = stackingOrder.findIndex(function(_ref15) {
  7685. var value = _ref15.value;
  7686. return [ ROOT_ORDER, FLOAT_ORDER, POSITION_STATIC_ORDER ].includes(value);
  7687. });
  7688. if (index !== -1) {
  7689. stackingOrder.splice(index, stackingOrder.length - index);
  7690. }
  7691. var zIndex = getRealZIndex(vNode, parentVNode);
  7692. if (![ 'auto', '0' ].includes(zIndex)) {
  7693. stackingOrder.push(createContext(parseInt(zIndex), vNode));
  7694. return stackingOrder;
  7695. }
  7696. var _float = nodeIndex3.toString();
  7697. while (_float.length < 10) {
  7698. _float = '0' + _float;
  7699. }
  7700. stackingOrder.push(createContext(parseFloat(''.concat(DEFAULT_ORDER).concat(_float)), vNode));
  7701. return stackingOrder;
  7702. }
  7703. function createContext(value, vNode) {
  7704. return {
  7705. value: value,
  7706. vNode: vNode
  7707. };
  7708. }
  7709. function getRealZIndex(vNode, parentVNode) {
  7710. var position = vNode.getComputedStylePropertyValue('position');
  7711. if (position === 'static' && !isFlexOrGridContainer(parentVNode)) {
  7712. return 'auto';
  7713. }
  7714. return vNode.getComputedStylePropertyValue('z-index');
  7715. }
  7716. function findScrollRegionParent(vNode, parentVNode) {
  7717. var scrollRegionParent = null;
  7718. var checkedNodes = [ vNode ];
  7719. while (parentVNode) {
  7720. if (_getScroll(parentVNode.actualNode)) {
  7721. scrollRegionParent = parentVNode;
  7722. break;
  7723. }
  7724. if (parentVNode._scrollRegionParent) {
  7725. scrollRegionParent = parentVNode._scrollRegionParent;
  7726. break;
  7727. }
  7728. checkedNodes.push(parentVNode);
  7729. parentVNode = get_node_from_tree_default(parentVNode.actualNode.parentElement || parentVNode.actualNode.parentNode);
  7730. }
  7731. checkedNodes.forEach(function(vNode2) {
  7732. return vNode2._scrollRegionParent = scrollRegionParent;
  7733. });
  7734. return scrollRegionParent;
  7735. }
  7736. function addNodeToGrid(grid, vNode) {
  7737. vNode.clientRects.forEach(function(rect) {
  7738. var _vNode$_grid;
  7739. (_vNode$_grid = vNode._grid) !== null && _vNode$_grid !== void 0 ? _vNode$_grid : vNode._grid = grid;
  7740. var gridRect = grid.getGridPositionOfRect(rect);
  7741. grid.loopGridPosition(gridRect, function(gridCell) {
  7742. if (!gridCell.includes(vNode)) {
  7743. gridCell.push(vNode);
  7744. }
  7745. });
  7746. });
  7747. }
  7748. var Grid = function() {
  7749. function Grid() {
  7750. var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7751. _classCallCheck(this, Grid);
  7752. this.container = container;
  7753. this.cells = [];
  7754. }
  7755. _createClass(Grid, [ {
  7756. key: 'toGridIndex',
  7757. value: function toGridIndex(num) {
  7758. return Math.floor(num / constants_default.gridSize);
  7759. }
  7760. }, {
  7761. key: 'getCellFromPoint',
  7762. value: function getCellFromPoint(_ref16) {
  7763. var _this$cells, _row;
  7764. var x = _ref16.x, y = _ref16.y;
  7765. assert_default(this.boundaries, 'Grid does not have cells added');
  7766. var rowIndex = this.toGridIndex(y);
  7767. var colIndex = this.toGridIndex(x);
  7768. assert_default(_isPointInRect({
  7769. y: rowIndex,
  7770. x: colIndex
  7771. }, this.boundaries), 'Element midpoint exceeds the grid bounds');
  7772. var row = (_this$cells = this.cells[rowIndex - this.cells._negativeIndex]) !== null && _this$cells !== void 0 ? _this$cells : [];
  7773. return (_row = row[colIndex - row._negativeIndex]) !== null && _row !== void 0 ? _row : [];
  7774. }
  7775. }, {
  7776. key: 'loopGridPosition',
  7777. value: function loopGridPosition(gridPosition, callback) {
  7778. var _gridPosition = gridPosition, left = _gridPosition.left, right = _gridPosition.right, top = _gridPosition.top, bottom = _gridPosition.bottom;
  7779. if (this.boundaries) {
  7780. gridPosition = _getBoundingRect(this.boundaries, gridPosition);
  7781. }
  7782. this.boundaries = gridPosition;
  7783. loopNegativeIndexMatrix(this.cells, top, bottom, function(gridRow, row) {
  7784. loopNegativeIndexMatrix(gridRow, left, right, function(gridCell, col) {
  7785. callback(gridCell, {
  7786. row: row,
  7787. col: col
  7788. });
  7789. });
  7790. });
  7791. }
  7792. }, {
  7793. key: 'getGridPositionOfRect',
  7794. value: function getGridPositionOfRect(_ref17) {
  7795. var top = _ref17.top, right = _ref17.right, bottom = _ref17.bottom, left = _ref17.left;
  7796. var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  7797. top = this.toGridIndex(top - margin);
  7798. right = this.toGridIndex(right + margin - 1);
  7799. bottom = this.toGridIndex(bottom + margin - 1);
  7800. left = this.toGridIndex(left - margin);
  7801. return new window.DOMRect(left, top, right - left, bottom - top);
  7802. }
  7803. } ]);
  7804. return Grid;
  7805. }();
  7806. function loopNegativeIndexMatrix(matrix, start, end, callback) {
  7807. var _matrix$_negativeInde;
  7808. (_matrix$_negativeInde = matrix._negativeIndex) !== null && _matrix$_negativeInde !== void 0 ? _matrix$_negativeInde : matrix._negativeIndex = 0;
  7809. if (start < matrix._negativeIndex) {
  7810. for (var _i5 = 0; _i5 < matrix._negativeIndex - start; _i5++) {
  7811. matrix.splice(0, 0, []);
  7812. }
  7813. matrix._negativeIndex = start;
  7814. }
  7815. var startOffset = start - matrix._negativeIndex;
  7816. var endOffset = end - matrix._negativeIndex;
  7817. for (var index = startOffset; index <= endOffset; index++) {
  7818. var _index, _matrix$_index;
  7819. (_matrix$_index = matrix[_index = index]) !== null && _matrix$_index !== void 0 ? _matrix$_index : matrix[_index] = [];
  7820. callback(matrix[index], index + matrix._negativeIndex);
  7821. }
  7822. }
  7823. function _findNearbyElms(vNode) {
  7824. var _vNode$_grid2, _vNode$_grid2$cells;
  7825. var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  7826. _createGrid();
  7827. if (!((_vNode$_grid2 = vNode._grid) !== null && _vNode$_grid2 !== void 0 && (_vNode$_grid2$cells = _vNode$_grid2.cells) !== null && _vNode$_grid2$cells !== void 0 && _vNode$_grid2$cells.length)) {
  7828. return [];
  7829. }
  7830. var rect = vNode.boundingClientRect;
  7831. var grid = vNode._grid;
  7832. var selfIsFixed = hasFixedPosition(vNode);
  7833. var gridPosition = grid.getGridPositionOfRect(rect, margin);
  7834. var neighbors = [];
  7835. grid.loopGridPosition(gridPosition, function(vNeighbors) {
  7836. var _iterator2 = _createForOfIteratorHelper(vNeighbors), _step2;
  7837. try {
  7838. for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
  7839. var vNeighbor = _step2.value;
  7840. if (vNeighbor && vNeighbor !== vNode && !neighbors.includes(vNeighbor) && selfIsFixed === hasFixedPosition(vNeighbor)) {
  7841. neighbors.push(vNeighbor);
  7842. }
  7843. }
  7844. } catch (err) {
  7845. _iterator2.e(err);
  7846. } finally {
  7847. _iterator2.f();
  7848. }
  7849. });
  7850. return neighbors;
  7851. }
  7852. var hasFixedPosition = memoize_default(function(vNode) {
  7853. if (!vNode) {
  7854. return false;
  7855. }
  7856. if (vNode.getComputedStylePropertyValue('position') === 'fixed') {
  7857. return true;
  7858. }
  7859. return hasFixedPosition(vNode.parent);
  7860. });
  7861. function _getIntersectionRect(rect1, rect2) {
  7862. var leftX = Math.max(rect1.left, rect2.left);
  7863. var rightX = Math.min(rect1.right, rect2.right);
  7864. var topY = Math.max(rect1.top, rect2.top);
  7865. var bottomY = Math.min(rect1.bottom, rect2.bottom);
  7866. if (leftX >= rightX || topY >= bottomY) {
  7867. return null;
  7868. }
  7869. return new window.DOMRect(leftX, topY, rightX - leftX, bottomY - topY);
  7870. }
  7871. var getModalDialog = memoize_default(function getModalDialogMemoized() {
  7872. var _dialogs$find;
  7873. if (!axe._tree) {
  7874. return null;
  7875. }
  7876. var dialogs = query_selector_all_filter_default(axe._tree[0], 'dialog[open]', function(vNode) {
  7877. var rect = vNode.boundingClientRect;
  7878. var stack = document.elementsFromPoint(rect.left + 1, rect.top + 1);
  7879. return stack.includes(vNode.actualNode) && _isVisibleOnScreen(vNode);
  7880. });
  7881. if (!dialogs.length) {
  7882. return null;
  7883. }
  7884. var modalDialog = dialogs.find(function(dialog) {
  7885. var rect = dialog.boundingClientRect;
  7886. var stack = document.elementsFromPoint(rect.left - 10, rect.top - 10);
  7887. return stack.includes(dialog.actualNode);
  7888. });
  7889. if (modalDialog) {
  7890. return modalDialog;
  7891. }
  7892. return (_dialogs$find = dialogs.find(function(dialog) {
  7893. var _getNodeFromGrid;
  7894. var _ref18 = (_getNodeFromGrid = getNodeFromGrid(dialog)) !== null && _getNodeFromGrid !== void 0 ? _getNodeFromGrid : {}, vNode = _ref18.vNode, rect = _ref18.rect;
  7895. if (!vNode) {
  7896. return false;
  7897. }
  7898. var stack = document.elementsFromPoint(rect.left + 1, rect.top + 1);
  7899. return !stack.includes(vNode.actualNode);
  7900. })) !== null && _dialogs$find !== void 0 ? _dialogs$find : null;
  7901. });
  7902. var get_modal_dialog_default = getModalDialog;
  7903. function getNodeFromGrid(dialog) {
  7904. _createGrid();
  7905. var grid = axe._tree[0]._grid;
  7906. var viewRect = new window.DOMRect(0, 0, window.innerWidth, window.innerHeight);
  7907. if (!grid) {
  7908. return;
  7909. }
  7910. for (var row = 0; row < grid.cells.length; row++) {
  7911. var cols = grid.cells[row];
  7912. if (!cols) {
  7913. continue;
  7914. }
  7915. for (var col = 0; col < cols.length; col++) {
  7916. var cells = cols[col];
  7917. if (!cells) {
  7918. continue;
  7919. }
  7920. for (var _i6 = 0; _i6 < cells.length; _i6++) {
  7921. var vNode = cells[_i6];
  7922. var rect = vNode.boundingClientRect;
  7923. var intersection = _getIntersectionRect(rect, viewRect);
  7924. if (vNode.props.nodeName !== 'html' && vNode !== dialog && vNode.getComputedStylePropertyValue('pointer-events') !== 'none' && intersection) {
  7925. return {
  7926. vNode: vNode,
  7927. rect: intersection
  7928. };
  7929. }
  7930. }
  7931. }
  7932. }
  7933. }
  7934. function _isInert(vNode) {
  7935. var _ref19 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, skipAncestors = _ref19.skipAncestors, isAncestor = _ref19.isAncestor;
  7936. if (skipAncestors) {
  7937. return isInertSelf(vNode, isAncestor);
  7938. }
  7939. return isInertAncestors(vNode, isAncestor);
  7940. }
  7941. var isInertSelf = memoize_default(function isInertSelfMemoized(vNode, isAncestor) {
  7942. if (vNode.hasAttr('inert')) {
  7943. return true;
  7944. }
  7945. if (!isAncestor && vNode.actualNode) {
  7946. var modalDialog = get_modal_dialog_default();
  7947. if (modalDialog && !_contains(modalDialog, vNode)) {
  7948. return true;
  7949. }
  7950. }
  7951. return false;
  7952. });
  7953. var isInertAncestors = memoize_default(function isInertAncestorsMemoized(vNode, isAncestor) {
  7954. if (isInertSelf(vNode, isAncestor)) {
  7955. return true;
  7956. }
  7957. if (!vNode.parent) {
  7958. return false;
  7959. }
  7960. return isInertAncestors(vNode.parent, true);
  7961. });
  7962. var allowedDisabledNodeNames = [ 'button', 'command', 'fieldset', 'keygen', 'optgroup', 'option', 'select', 'textarea', 'input' ];
  7963. function isDisabledAttrAllowed(nodeName2) {
  7964. return allowedDisabledNodeNames.includes(nodeName2);
  7965. }
  7966. function focusDisabled(el) {
  7967. var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
  7968. if (isDisabledAttrAllowed(vNode.props.nodeName) && vNode.hasAttr('disabled') || _isInert(vNode)) {
  7969. return true;
  7970. }
  7971. var parentNode = vNode.parent;
  7972. var ancestors = [];
  7973. var fieldsetDisabled = false;
  7974. while (parentNode && parentNode.shadowId === vNode.shadowId && !fieldsetDisabled) {
  7975. ancestors.push(parentNode);
  7976. if (parentNode.props.nodeName === 'legend') {
  7977. break;
  7978. }
  7979. if (parentNode._inDisabledFieldset !== void 0) {
  7980. fieldsetDisabled = parentNode._inDisabledFieldset;
  7981. break;
  7982. }
  7983. if (parentNode.props.nodeName === 'fieldset' && parentNode.hasAttr('disabled')) {
  7984. fieldsetDisabled = true;
  7985. }
  7986. parentNode = parentNode.parent;
  7987. }
  7988. ancestors.forEach(function(ancestor) {
  7989. return ancestor._inDisabledFieldset = fieldsetDisabled;
  7990. });
  7991. if (fieldsetDisabled) {
  7992. return true;
  7993. }
  7994. if (vNode.props.nodeName !== 'area') {
  7995. if (!vNode.actualNode) {
  7996. return false;
  7997. }
  7998. return _isHiddenForEveryone(vNode);
  7999. }
  8000. return false;
  8001. }
  8002. var focus_disabled_default = focusDisabled;
  8003. var angularSkipLinkRegex = /^\/\#/;
  8004. var angularRouterLinkRegex = /^#[!/]/;
  8005. function _isCurrentPageLink(anchor) {
  8006. var _window$location;
  8007. var href = anchor.getAttribute('href');
  8008. if (!href || href === '#') {
  8009. return false;
  8010. }
  8011. if (angularSkipLinkRegex.test(href)) {
  8012. return true;
  8013. }
  8014. var hash = anchor.hash, protocol = anchor.protocol, hostname = anchor.hostname, port = anchor.port, pathname = anchor.pathname;
  8015. if (angularRouterLinkRegex.test(hash)) {
  8016. return false;
  8017. }
  8018. if (href.charAt(0) === '#') {
  8019. return true;
  8020. }
  8021. if (typeof ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.origin) !== 'string' || window.location.origin.indexOf('://') === -1) {
  8022. return null;
  8023. }
  8024. var currentPageUrl = window.location.origin + window.location.pathname;
  8025. var url;
  8026. if (!hostname) {
  8027. url = window.location.origin;
  8028. } else {
  8029. url = ''.concat(protocol, '//').concat(hostname).concat(port ? ':'.concat(port) : '');
  8030. }
  8031. if (!pathname) {
  8032. url += window.location.pathname;
  8033. } else {
  8034. url += (pathname[0] !== '/' ? '/' : '') + pathname;
  8035. }
  8036. return url === currentPageUrl;
  8037. }
  8038. function getElementByReference(node, attr) {
  8039. var fragment = node.getAttribute(attr);
  8040. if (!fragment) {
  8041. return null;
  8042. }
  8043. if (attr === 'href' && !_isCurrentPageLink(node)) {
  8044. return null;
  8045. }
  8046. if (fragment.indexOf('#') !== -1) {
  8047. fragment = decodeURIComponent(fragment.substr(fragment.indexOf('#') + 1));
  8048. }
  8049. var candidate = document.getElementById(fragment);
  8050. if (candidate) {
  8051. return candidate;
  8052. }
  8053. candidate = document.getElementsByName(fragment);
  8054. if (candidate.length) {
  8055. return candidate[0];
  8056. }
  8057. return null;
  8058. }
  8059. var get_element_by_reference_default = getElementByReference;
  8060. function _visuallySort(a, b) {
  8061. _createGrid();
  8062. var length = Math.max(a._stackingOrder.length, b._stackingOrder.length);
  8063. for (var _i7 = 0; _i7 < length; _i7++) {
  8064. if (typeof b._stackingOrder[_i7] === 'undefined') {
  8065. return -1;
  8066. } else if (typeof a._stackingOrder[_i7] === 'undefined') {
  8067. return 1;
  8068. }
  8069. if (b._stackingOrder[_i7].value > a._stackingOrder[_i7].value) {
  8070. return 1;
  8071. }
  8072. if (b._stackingOrder[_i7].value < a._stackingOrder[_i7].value) {
  8073. return -1;
  8074. }
  8075. }
  8076. var aNode = a.actualNode;
  8077. var bNode = b.actualNode;
  8078. if (aNode.getRootNode && aNode.getRootNode() !== bNode.getRootNode()) {
  8079. var boundaries = [];
  8080. while (aNode) {
  8081. boundaries.push({
  8082. root: aNode.getRootNode(),
  8083. node: aNode
  8084. });
  8085. aNode = aNode.getRootNode().host;
  8086. }
  8087. while (bNode && !boundaries.find(function(boundary) {
  8088. return boundary.root === bNode.getRootNode();
  8089. })) {
  8090. bNode = bNode.getRootNode().host;
  8091. }
  8092. aNode = boundaries.find(function(boundary) {
  8093. return boundary.root === bNode.getRootNode();
  8094. }).node;
  8095. if (aNode === bNode) {
  8096. return a.actualNode.getRootNode() !== aNode.getRootNode() ? -1 : 1;
  8097. }
  8098. }
  8099. var _window$Node = window.Node, DOCUMENT_POSITION_FOLLOWING = _window$Node.DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_CONTAINS = _window$Node.DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_CONTAINED_BY = _window$Node.DOCUMENT_POSITION_CONTAINED_BY;
  8100. var docPosition = aNode.compareDocumentPosition(bNode);
  8101. var DOMOrder = docPosition & DOCUMENT_POSITION_FOLLOWING ? 1 : -1;
  8102. var isDescendant = docPosition & DOCUMENT_POSITION_CONTAINS || docPosition & DOCUMENT_POSITION_CONTAINED_BY;
  8103. var aPosition = getPositionOrder(a);
  8104. var bPosition = getPositionOrder(b);
  8105. if (aPosition === bPosition || isDescendant) {
  8106. return DOMOrder;
  8107. }
  8108. return bPosition - aPosition;
  8109. }
  8110. function getPositionOrder(vNode) {
  8111. if (vNode.getComputedStylePropertyValue('display').indexOf('inline') !== -1) {
  8112. return 2;
  8113. }
  8114. if (isFloated(vNode)) {
  8115. return 1;
  8116. }
  8117. return 0;
  8118. }
  8119. function isFloated(vNode) {
  8120. if (!vNode) {
  8121. return false;
  8122. }
  8123. if (vNode._isFloated !== void 0) {
  8124. return vNode._isFloated;
  8125. }
  8126. var floatStyle = vNode.getComputedStylePropertyValue('float');
  8127. if (floatStyle !== 'none') {
  8128. vNode._isFloated = true;
  8129. return true;
  8130. }
  8131. var floated = isFloated(vNode.parent);
  8132. vNode._isFloated = floated;
  8133. return floated;
  8134. }
  8135. var math_exports = {};
  8136. __export(math_exports, {
  8137. getBoundingRect: function getBoundingRect() {
  8138. return _getBoundingRect;
  8139. },
  8140. getIntersectionRect: function getIntersectionRect() {
  8141. return _getIntersectionRect;
  8142. },
  8143. getOffset: function getOffset() {
  8144. return _getOffset;
  8145. },
  8146. getRectCenter: function getRectCenter() {
  8147. return _getRectCenter;
  8148. },
  8149. hasVisualOverlap: function hasVisualOverlap() {
  8150. return _hasVisualOverlap;
  8151. },
  8152. isPointInRect: function isPointInRect() {
  8153. return _isPointInRect;
  8154. },
  8155. rectsOverlap: function rectsOverlap() {
  8156. return _rectsOverlap;
  8157. },
  8158. splitRects: function splitRects() {
  8159. return _splitRects;
  8160. }
  8161. });
  8162. function _getOffset(vNodeA, vNodeB) {
  8163. var rectA = vNodeA.boundingClientRect;
  8164. var rectB = vNodeB.boundingClientRect;
  8165. var pointA = getFarthestPoint(rectA, rectB);
  8166. var pointB = getClosestPoint(pointA, rectA, rectB);
  8167. return pointDistance(pointA, pointB);
  8168. }
  8169. function getFarthestPoint(rectA, rectB) {
  8170. var dimensionProps = [ [ 'x', 'left', 'right', 'width' ], [ 'y', 'top', 'bottom', 'height' ] ];
  8171. var farthestPoint = {};
  8172. dimensionProps.forEach(function(_ref20) {
  8173. var _ref21 = _slicedToArray(_ref20, 4), axis = _ref21[0], start = _ref21[1], end = _ref21[2], diameter = _ref21[3];
  8174. if (rectB[start] < rectA[start] && rectB[end] > rectA[end]) {
  8175. farthestPoint[axis] = rectA[start] + rectA[diameter] / 2;
  8176. return;
  8177. }
  8178. var centerB = rectB[start] + rectB[diameter] / 2;
  8179. var startDistance = Math.abs(centerB - rectA[start]);
  8180. var endDistance = Math.abs(centerB - rectA[end]);
  8181. if (startDistance >= endDistance) {
  8182. farthestPoint[axis] = rectA[start];
  8183. } else {
  8184. farthestPoint[axis] = rectA[end];
  8185. }
  8186. });
  8187. return farthestPoint;
  8188. }
  8189. function getClosestPoint(_ref22, ownRect, adjacentRect) {
  8190. var x = _ref22.x, y = _ref22.y;
  8191. if (pointInRect({
  8192. x: x,
  8193. y: y
  8194. }, adjacentRect)) {
  8195. var closestPoint = getCornerInAdjacentRect({
  8196. x: x,
  8197. y: y
  8198. }, ownRect, adjacentRect);
  8199. if (closestPoint !== null) {
  8200. return closestPoint;
  8201. }
  8202. adjacentRect = ownRect;
  8203. }
  8204. var _adjacentRect = adjacentRect, top = _adjacentRect.top, right = _adjacentRect.right, bottom = _adjacentRect.bottom, left = _adjacentRect.left;
  8205. var xAligned = x >= left && x <= right;
  8206. var yAligned = y >= top && y <= bottom;
  8207. var closestX = Math.abs(left - x) < Math.abs(right - x) ? left : right;
  8208. var closestY = Math.abs(top - y) < Math.abs(bottom - y) ? top : bottom;
  8209. if (!xAligned && yAligned) {
  8210. return {
  8211. x: closestX,
  8212. y: y
  8213. };
  8214. } else if (xAligned && !yAligned) {
  8215. return {
  8216. x: x,
  8217. y: closestY
  8218. };
  8219. } else if (!xAligned && !yAligned) {
  8220. return {
  8221. x: closestX,
  8222. y: closestY
  8223. };
  8224. }
  8225. if (Math.abs(x - closestX) < Math.abs(y - closestY)) {
  8226. return {
  8227. x: closestX,
  8228. y: y
  8229. };
  8230. } else {
  8231. return {
  8232. x: x,
  8233. y: closestY
  8234. };
  8235. }
  8236. }
  8237. function pointDistance(pointA, pointB) {
  8238. var xDistance = Math.abs(pointA.x - pointB.x);
  8239. var yDistance = Math.abs(pointA.y - pointB.y);
  8240. if (!xDistance || !yDistance) {
  8241. return xDistance || yDistance;
  8242. }
  8243. return Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2));
  8244. }
  8245. function pointInRect(_ref23, rect) {
  8246. var x = _ref23.x, y = _ref23.y;
  8247. return y >= rect.top && x <= rect.right && y <= rect.bottom && x >= rect.left;
  8248. }
  8249. function getCornerInAdjacentRect(_ref24, ownRect, adjacentRect) {
  8250. var x = _ref24.x, y = _ref24.y;
  8251. var closestX, closestY;
  8252. if (x === ownRect.left && ownRect.right < adjacentRect.right) {
  8253. closestX = ownRect.right;
  8254. } else if (x === ownRect.right && ownRect.left > adjacentRect.left) {
  8255. closestX = ownRect.left;
  8256. }
  8257. if (y === ownRect.top && ownRect.bottom < adjacentRect.bottom) {
  8258. closestY = ownRect.bottom;
  8259. } else if (y === ownRect.bottom && ownRect.top > adjacentRect.top) {
  8260. closestY = ownRect.top;
  8261. }
  8262. if (!closestX && !closestY) {
  8263. return null;
  8264. } else if (!closestY) {
  8265. return {
  8266. x: closestX,
  8267. y: y
  8268. };
  8269. } else if (!closestX) {
  8270. return {
  8271. x: x,
  8272. y: closestY
  8273. };
  8274. }
  8275. if (Math.abs(x - closestX) < Math.abs(y - closestY)) {
  8276. return {
  8277. x: closestX,
  8278. y: y
  8279. };
  8280. } else {
  8281. return {
  8282. x: x,
  8283. y: closestY
  8284. };
  8285. }
  8286. }
  8287. function _getRectCenter(_ref25) {
  8288. var left = _ref25.left, top = _ref25.top, width = _ref25.width, height = _ref25.height;
  8289. return new window.DOMPoint(left + width / 2, top + height / 2);
  8290. }
  8291. function _hasVisualOverlap(vNodeA, vNodeB) {
  8292. var rectA = vNodeA.boundingClientRect;
  8293. var rectB = vNodeB.boundingClientRect;
  8294. if (rectA.left >= rectB.right || rectA.right <= rectB.left || rectA.top >= rectB.bottom || rectA.bottom <= rectB.top) {
  8295. return false;
  8296. }
  8297. return _visuallySort(vNodeA, vNodeB) > 0;
  8298. }
  8299. function _splitRects(outerRect, overlapRects) {
  8300. var uniqueRects = [ outerRect ];
  8301. var _iterator3 = _createForOfIteratorHelper(overlapRects), _step3;
  8302. try {
  8303. var _loop3 = function _loop3() {
  8304. var overlapRect = _step3.value;
  8305. uniqueRects = uniqueRects.reduce(function(uniqueRects2, inputRect) {
  8306. return uniqueRects2.concat(splitRect(inputRect, overlapRect));
  8307. }, []);
  8308. };
  8309. for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
  8310. _loop3();
  8311. }
  8312. } catch (err) {
  8313. _iterator3.e(err);
  8314. } finally {
  8315. _iterator3.f();
  8316. }
  8317. return uniqueRects;
  8318. }
  8319. function splitRect(inputRect, clipRect) {
  8320. var top = inputRect.top, left = inputRect.left, bottom = inputRect.bottom, right = inputRect.right;
  8321. var yAligned = top < clipRect.bottom && bottom > clipRect.top;
  8322. var xAligned = left < clipRect.right && right > clipRect.left;
  8323. var rects = [];
  8324. if (between(clipRect.top, top, bottom) && xAligned) {
  8325. rects.push({
  8326. top: top,
  8327. left: left,
  8328. bottom: clipRect.top,
  8329. right: right
  8330. });
  8331. }
  8332. if (between(clipRect.right, left, right) && yAligned) {
  8333. rects.push({
  8334. top: top,
  8335. left: clipRect.right,
  8336. bottom: bottom,
  8337. right: right
  8338. });
  8339. }
  8340. if (between(clipRect.bottom, top, bottom) && xAligned) {
  8341. rects.push({
  8342. top: clipRect.bottom,
  8343. right: right,
  8344. bottom: bottom,
  8345. left: left
  8346. });
  8347. }
  8348. if (between(clipRect.left, left, right) && yAligned) {
  8349. rects.push({
  8350. top: top,
  8351. left: left,
  8352. bottom: bottom,
  8353. right: clipRect.left
  8354. });
  8355. }
  8356. if (rects.length === 0) {
  8357. rects.push(inputRect);
  8358. }
  8359. return rects.map(computeRect);
  8360. }
  8361. var between = function between(num, min, max) {
  8362. return num > min && num < max;
  8363. };
  8364. function computeRect(baseRect) {
  8365. return _extends({}, baseRect, {
  8366. x: baseRect.left,
  8367. y: baseRect.top,
  8368. height: baseRect.bottom - baseRect.top,
  8369. width: baseRect.right - baseRect.left
  8370. });
  8371. }
  8372. function getRectStack(grid, rect) {
  8373. var recursed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  8374. var center = _getRectCenter(rect);
  8375. var gridCell = grid.getCellFromPoint(center) || [];
  8376. var floorX = Math.floor(center.x);
  8377. var floorY = Math.floor(center.y);
  8378. var stack = gridCell.filter(function(gridCellNode) {
  8379. return gridCellNode.clientRects.some(function(clientRect) {
  8380. var rectX = clientRect.left;
  8381. var rectY = clientRect.top;
  8382. return floorX < Math.floor(rectX + clientRect.width) && floorX >= Math.floor(rectX) && floorY < Math.floor(rectY + clientRect.height) && floorY >= Math.floor(rectY);
  8383. });
  8384. });
  8385. var gridContainer = grid.container;
  8386. if (gridContainer) {
  8387. stack = getRectStack(gridContainer._grid, gridContainer.boundingClientRect, true).concat(stack);
  8388. }
  8389. if (!recursed) {
  8390. stack = stack.sort(_visuallySort).map(function(vNode) {
  8391. return vNode.actualNode;
  8392. }).concat(document.documentElement).filter(function(node, index, array) {
  8393. return array.indexOf(node) === index;
  8394. });
  8395. }
  8396. return stack;
  8397. }
  8398. function getElementStack(node) {
  8399. _createGrid();
  8400. var vNode = get_node_from_tree_default(node);
  8401. var grid = vNode._grid;
  8402. if (!grid) {
  8403. return [];
  8404. }
  8405. return getRectStack(grid, vNode.boundingClientRect);
  8406. }
  8407. var get_element_stack_default = getElementStack;
  8408. function getTabbableElements(virtualNode) {
  8409. var nodeAndDescendents = query_selector_all_default(virtualNode, '*');
  8410. var tabbableElements = nodeAndDescendents.filter(function(vNode) {
  8411. var isFocusable2 = vNode.isFocusable;
  8412. var tabIndex = vNode.actualNode.getAttribute('tabindex');
  8413. tabIndex = tabIndex && !isNaN(parseInt(tabIndex, 10)) ? parseInt(tabIndex) : null;
  8414. return tabIndex ? isFocusable2 && tabIndex >= 0 : isFocusable2;
  8415. });
  8416. return tabbableElements;
  8417. }
  8418. var get_tabbable_elements_default = getTabbableElements;
  8419. var text_exports = {};
  8420. __export(text_exports, {
  8421. accessibleText: function accessibleText() {
  8422. return accessible_text_default;
  8423. },
  8424. accessibleTextVirtual: function accessibleTextVirtual() {
  8425. return accessible_text_virtual_default;
  8426. },
  8427. autocomplete: function autocomplete() {
  8428. return _autocomplete;
  8429. },
  8430. formControlValue: function formControlValue() {
  8431. return form_control_value_default;
  8432. },
  8433. formControlValueMethods: function formControlValueMethods() {
  8434. return _formControlValueMethods;
  8435. },
  8436. hasUnicode: function hasUnicode() {
  8437. return has_unicode_default;
  8438. },
  8439. isHumanInterpretable: function isHumanInterpretable() {
  8440. return is_human_interpretable_default;
  8441. },
  8442. isIconLigature: function isIconLigature() {
  8443. return is_icon_ligature_default;
  8444. },
  8445. isValidAutocomplete: function isValidAutocomplete() {
  8446. return is_valid_autocomplete_default;
  8447. },
  8448. label: function label() {
  8449. return label_default;
  8450. },
  8451. labelText: function labelText() {
  8452. return label_text_default;
  8453. },
  8454. labelVirtual: function labelVirtual() {
  8455. return label_virtual_default2;
  8456. },
  8457. nativeElementType: function nativeElementType() {
  8458. return native_element_type_default;
  8459. },
  8460. nativeTextAlternative: function nativeTextAlternative() {
  8461. return native_text_alternative_default;
  8462. },
  8463. nativeTextMethods: function nativeTextMethods() {
  8464. return native_text_methods_default;
  8465. },
  8466. removeUnicode: function removeUnicode() {
  8467. return remove_unicode_default;
  8468. },
  8469. sanitize: function sanitize() {
  8470. return sanitize_default;
  8471. },
  8472. subtreeText: function subtreeText() {
  8473. return subtree_text_default;
  8474. },
  8475. titleText: function titleText() {
  8476. return title_text_default;
  8477. },
  8478. unsupported: function unsupported() {
  8479. return unsupported_default;
  8480. },
  8481. visible: function visible() {
  8482. return visible_default;
  8483. },
  8484. visibleTextNodes: function visibleTextNodes() {
  8485. return visible_text_nodes_default;
  8486. },
  8487. visibleVirtual: function visibleVirtual() {
  8488. return visible_virtual_default;
  8489. }
  8490. });
  8491. function idrefs(node, attr) {
  8492. node = node.actualNode || node;
  8493. try {
  8494. var doc = get_root_node_default2(node);
  8495. var result = [];
  8496. var attrValue = node.getAttribute(attr);
  8497. if (attrValue) {
  8498. attrValue = token_list_default(attrValue);
  8499. for (var index = 0; index < attrValue.length; index++) {
  8500. result.push(doc.getElementById(attrValue[index]));
  8501. }
  8502. }
  8503. return result;
  8504. } catch (e) {
  8505. throw new TypeError('Cannot resolve id references for non-DOM nodes');
  8506. }
  8507. }
  8508. var idrefs_default = idrefs;
  8509. function accessibleText(element, context) {
  8510. var virtualNode = get_node_from_tree_default(element);
  8511. return accessible_text_virtual_default(virtualNode, context);
  8512. }
  8513. var accessible_text_default = accessibleText;
  8514. function arialabelledbyText(vNode) {
  8515. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8516. if (!(vNode instanceof abstract_virtual_node_default)) {
  8517. if (vNode.nodeType !== 1) {
  8518. return '';
  8519. }
  8520. vNode = get_node_from_tree_default(vNode);
  8521. }
  8522. if (vNode.props.nodeType !== 1 || context.inLabelledByContext || context.inControlContext || !vNode.attr('aria-labelledby')) {
  8523. return '';
  8524. }
  8525. var refs = idrefs_default(vNode, 'aria-labelledby').filter(function(elm) {
  8526. return elm;
  8527. });
  8528. return refs.reduce(function(accessibleName, elm) {
  8529. var accessibleNameAdd = accessible_text_default(elm, _extends({
  8530. inLabelledByContext: true,
  8531. startNode: context.startNode || vNode
  8532. }, context));
  8533. if (!accessibleName) {
  8534. return accessibleNameAdd;
  8535. } else {
  8536. return ''.concat(accessibleName, ' ').concat(accessibleNameAdd);
  8537. }
  8538. }, '');
  8539. }
  8540. var arialabelledby_text_default = arialabelledbyText;
  8541. function arialabelText(vNode) {
  8542. if (!(vNode instanceof abstract_virtual_node_default)) {
  8543. if (vNode.nodeType !== 1) {
  8544. return '';
  8545. }
  8546. vNode = get_node_from_tree_default(vNode);
  8547. }
  8548. return vNode.attr('aria-label') || '';
  8549. }
  8550. var arialabel_text_default = arialabelText;
  8551. var ariaAttrs = {
  8552. 'aria-activedescendant': {
  8553. type: 'idref',
  8554. allowEmpty: true
  8555. },
  8556. 'aria-atomic': {
  8557. type: 'boolean',
  8558. global: true
  8559. },
  8560. 'aria-autocomplete': {
  8561. type: 'nmtoken',
  8562. values: [ 'inline', 'list', 'both', 'none' ]
  8563. },
  8564. 'aria-braillelabel': {
  8565. type: 'string',
  8566. global: true
  8567. },
  8568. 'aria-brailleroledescription': {
  8569. type: 'string',
  8570. global: true
  8571. },
  8572. 'aria-busy': {
  8573. type: 'boolean',
  8574. global: true
  8575. },
  8576. 'aria-checked': {
  8577. type: 'nmtoken',
  8578. values: [ 'false', 'mixed', 'true', 'undefined' ]
  8579. },
  8580. 'aria-colcount': {
  8581. type: 'int',
  8582. minValue: -1
  8583. },
  8584. 'aria-colindex': {
  8585. type: 'int',
  8586. minValue: 1
  8587. },
  8588. 'aria-colspan': {
  8589. type: 'int',
  8590. minValue: 1
  8591. },
  8592. 'aria-controls': {
  8593. type: 'idrefs',
  8594. allowEmpty: true,
  8595. global: true
  8596. },
  8597. 'aria-current': {
  8598. type: 'nmtoken',
  8599. allowEmpty: true,
  8600. values: [ 'page', 'step', 'location', 'date', 'time', 'true', 'false' ],
  8601. global: true
  8602. },
  8603. 'aria-describedby': {
  8604. type: 'idrefs',
  8605. allowEmpty: true,
  8606. global: true
  8607. },
  8608. 'aria-description': {
  8609. type: 'string',
  8610. allowEmpty: true,
  8611. global: true
  8612. },
  8613. 'aria-details': {
  8614. type: 'idref',
  8615. allowEmpty: true,
  8616. global: true
  8617. },
  8618. 'aria-disabled': {
  8619. type: 'boolean',
  8620. global: true
  8621. },
  8622. 'aria-dropeffect': {
  8623. type: 'nmtokens',
  8624. values: [ 'copy', 'execute', 'link', 'move', 'none', 'popup' ],
  8625. global: true
  8626. },
  8627. 'aria-errormessage': {
  8628. type: 'idref',
  8629. allowEmpty: true,
  8630. global: true
  8631. },
  8632. 'aria-expanded': {
  8633. type: 'nmtoken',
  8634. values: [ 'true', 'false', 'undefined' ]
  8635. },
  8636. 'aria-flowto': {
  8637. type: 'idrefs',
  8638. allowEmpty: true,
  8639. global: true
  8640. },
  8641. 'aria-grabbed': {
  8642. type: 'nmtoken',
  8643. values: [ 'true', 'false', 'undefined' ],
  8644. global: true
  8645. },
  8646. 'aria-haspopup': {
  8647. type: 'nmtoken',
  8648. allowEmpty: true,
  8649. values: [ 'true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog' ],
  8650. global: true
  8651. },
  8652. 'aria-hidden': {
  8653. type: 'nmtoken',
  8654. values: [ 'true', 'false', 'undefined' ],
  8655. global: true
  8656. },
  8657. 'aria-invalid': {
  8658. type: 'nmtoken',
  8659. values: [ 'grammar', 'false', 'spelling', 'true' ],
  8660. global: true
  8661. },
  8662. 'aria-keyshortcuts': {
  8663. type: 'string',
  8664. allowEmpty: true,
  8665. global: true
  8666. },
  8667. 'aria-label': {
  8668. type: 'string',
  8669. allowEmpty: true,
  8670. global: true
  8671. },
  8672. 'aria-labelledby': {
  8673. type: 'idrefs',
  8674. allowEmpty: true,
  8675. global: true
  8676. },
  8677. 'aria-level': {
  8678. type: 'int',
  8679. minValue: 1
  8680. },
  8681. 'aria-live': {
  8682. type: 'nmtoken',
  8683. values: [ 'assertive', 'off', 'polite' ],
  8684. global: true
  8685. },
  8686. 'aria-modal': {
  8687. type: 'boolean'
  8688. },
  8689. 'aria-multiline': {
  8690. type: 'boolean'
  8691. },
  8692. 'aria-multiselectable': {
  8693. type: 'boolean'
  8694. },
  8695. 'aria-orientation': {
  8696. type: 'nmtoken',
  8697. values: [ 'horizontal', 'undefined', 'vertical' ]
  8698. },
  8699. 'aria-owns': {
  8700. type: 'idrefs',
  8701. allowEmpty: true,
  8702. global: true
  8703. },
  8704. 'aria-placeholder': {
  8705. type: 'string',
  8706. allowEmpty: true
  8707. },
  8708. 'aria-posinset': {
  8709. type: 'int',
  8710. minValue: 1
  8711. },
  8712. 'aria-pressed': {
  8713. type: 'nmtoken',
  8714. values: [ 'false', 'mixed', 'true', 'undefined' ]
  8715. },
  8716. 'aria-readonly': {
  8717. type: 'boolean'
  8718. },
  8719. 'aria-relevant': {
  8720. type: 'nmtokens',
  8721. values: [ 'additions', 'all', 'removals', 'text' ],
  8722. global: true
  8723. },
  8724. 'aria-required': {
  8725. type: 'boolean'
  8726. },
  8727. 'aria-roledescription': {
  8728. type: 'string',
  8729. allowEmpty: true,
  8730. global: true
  8731. },
  8732. 'aria-rowcount': {
  8733. type: 'int',
  8734. minValue: -1
  8735. },
  8736. 'aria-rowindex': {
  8737. type: 'int',
  8738. minValue: 1
  8739. },
  8740. 'aria-rowspan': {
  8741. type: 'int',
  8742. minValue: 0
  8743. },
  8744. 'aria-selected': {
  8745. type: 'nmtoken',
  8746. values: [ 'false', 'true', 'undefined' ]
  8747. },
  8748. 'aria-setsize': {
  8749. type: 'int',
  8750. minValue: -1
  8751. },
  8752. 'aria-sort': {
  8753. type: 'nmtoken',
  8754. values: [ 'ascending', 'descending', 'none', 'other' ]
  8755. },
  8756. 'aria-valuemax': {
  8757. type: 'decimal'
  8758. },
  8759. 'aria-valuemin': {
  8760. type: 'decimal'
  8761. },
  8762. 'aria-valuenow': {
  8763. type: 'decimal'
  8764. },
  8765. 'aria-valuetext': {
  8766. type: 'string'
  8767. }
  8768. };
  8769. var aria_attrs_default = ariaAttrs;
  8770. var ariaRoles = {
  8771. alert: {
  8772. type: 'widget',
  8773. allowedAttrs: [ 'aria-expanded' ],
  8774. superclassRole: [ 'section' ]
  8775. },
  8776. alertdialog: {
  8777. type: 'widget',
  8778. allowedAttrs: [ 'aria-expanded', 'aria-modal' ],
  8779. superclassRole: [ 'alert', 'dialog' ],
  8780. accessibleNameRequired: true
  8781. },
  8782. application: {
  8783. type: 'landmark',
  8784. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded' ],
  8785. superclassRole: [ 'structure' ],
  8786. accessibleNameRequired: true
  8787. },
  8788. article: {
  8789. type: 'structure',
  8790. allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
  8791. superclassRole: [ 'document' ]
  8792. },
  8793. banner: {
  8794. type: 'landmark',
  8795. allowedAttrs: [ 'aria-expanded' ],
  8796. superclassRole: [ 'landmark' ]
  8797. },
  8798. blockquote: {
  8799. type: 'structure',
  8800. superclassRole: [ 'section' ]
  8801. },
  8802. button: {
  8803. type: 'widget',
  8804. allowedAttrs: [ 'aria-expanded', 'aria-pressed' ],
  8805. superclassRole: [ 'command' ],
  8806. accessibleNameRequired: true,
  8807. nameFromContent: true,
  8808. childrenPresentational: true
  8809. },
  8810. caption: {
  8811. type: 'structure',
  8812. requiredContext: [ 'figure', 'table', 'grid', 'treegrid' ],
  8813. superclassRole: [ 'section' ],
  8814. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  8815. },
  8816. cell: {
  8817. type: 'structure',
  8818. requiredContext: [ 'row' ],
  8819. allowedAttrs: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-expanded' ],
  8820. superclassRole: [ 'section' ],
  8821. nameFromContent: true
  8822. },
  8823. checkbox: {
  8824. type: 'widget',
  8825. requiredAttrs: [ 'aria-checked' ],
  8826. allowedAttrs: [ 'aria-readonly', 'aria-required' ],
  8827. superclassRole: [ 'input' ],
  8828. accessibleNameRequired: true,
  8829. nameFromContent: true,
  8830. childrenPresentational: true
  8831. },
  8832. code: {
  8833. type: 'structure',
  8834. superclassRole: [ 'section' ],
  8835. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  8836. },
  8837. columnheader: {
  8838. type: 'structure',
  8839. requiredContext: [ 'row' ],
  8840. allowedAttrs: [ 'aria-sort', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-readonly', 'aria-required', 'aria-rowindex', 'aria-rowspan', 'aria-selected' ],
  8841. superclassRole: [ 'cell', 'gridcell', 'sectionhead' ],
  8842. accessibleNameRequired: false,
  8843. nameFromContent: true
  8844. },
  8845. combobox: {
  8846. type: 'widget',
  8847. requiredAttrs: [ 'aria-expanded', 'aria-controls' ],
  8848. allowedAttrs: [ 'aria-owns', 'aria-autocomplete', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-orientation' ],
  8849. superclassRole: [ 'select' ],
  8850. accessibleNameRequired: true
  8851. },
  8852. command: {
  8853. type: 'abstract',
  8854. superclassRole: [ 'widget' ]
  8855. },
  8856. complementary: {
  8857. type: 'landmark',
  8858. allowedAttrs: [ 'aria-expanded' ],
  8859. superclassRole: [ 'landmark' ]
  8860. },
  8861. composite: {
  8862. type: 'abstract',
  8863. superclassRole: [ 'widget' ]
  8864. },
  8865. contentinfo: {
  8866. type: 'landmark',
  8867. allowedAttrs: [ 'aria-expanded' ],
  8868. superclassRole: [ 'landmark' ]
  8869. },
  8870. comment: {
  8871. type: 'structure',
  8872. allowedAttrs: [ 'aria-level', 'aria-posinset', 'aria-setsize' ],
  8873. superclassRole: [ 'article' ]
  8874. },
  8875. definition: {
  8876. type: 'structure',
  8877. allowedAttrs: [ 'aria-expanded' ],
  8878. superclassRole: [ 'section' ]
  8879. },
  8880. deletion: {
  8881. type: 'structure',
  8882. superclassRole: [ 'section' ],
  8883. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  8884. },
  8885. dialog: {
  8886. type: 'widget',
  8887. allowedAttrs: [ 'aria-expanded', 'aria-modal' ],
  8888. superclassRole: [ 'window' ],
  8889. accessibleNameRequired: true
  8890. },
  8891. directory: {
  8892. type: 'structure',
  8893. deprecated: true,
  8894. allowedAttrs: [ 'aria-expanded' ],
  8895. superclassRole: [ 'list' ],
  8896. nameFromContent: true
  8897. },
  8898. document: {
  8899. type: 'structure',
  8900. allowedAttrs: [ 'aria-expanded' ],
  8901. superclassRole: [ 'structure' ]
  8902. },
  8903. emphasis: {
  8904. type: 'structure',
  8905. superclassRole: [ 'section' ],
  8906. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  8907. },
  8908. feed: {
  8909. type: 'structure',
  8910. requiredOwned: [ 'article' ],
  8911. allowedAttrs: [ 'aria-expanded' ],
  8912. superclassRole: [ 'list' ]
  8913. },
  8914. figure: {
  8915. type: 'structure',
  8916. allowedAttrs: [ 'aria-expanded' ],
  8917. superclassRole: [ 'section' ],
  8918. nameFromContent: true
  8919. },
  8920. form: {
  8921. type: 'landmark',
  8922. allowedAttrs: [ 'aria-expanded' ],
  8923. superclassRole: [ 'landmark' ]
  8924. },
  8925. grid: {
  8926. type: 'composite',
  8927. requiredOwned: [ 'rowgroup', 'row' ],
  8928. allowedAttrs: [ 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-rowcount' ],
  8929. superclassRole: [ 'composite', 'table' ],
  8930. accessibleNameRequired: false
  8931. },
  8932. gridcell: {
  8933. type: 'widget',
  8934. requiredContext: [ 'row' ],
  8935. allowedAttrs: [ 'aria-readonly', 'aria-required', 'aria-selected', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan' ],
  8936. superclassRole: [ 'cell', 'widget' ],
  8937. nameFromContent: true
  8938. },
  8939. group: {
  8940. type: 'structure',
  8941. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded' ],
  8942. superclassRole: [ 'section' ]
  8943. },
  8944. heading: {
  8945. type: 'structure',
  8946. requiredAttrs: [ 'aria-level' ],
  8947. allowedAttrs: [ 'aria-expanded' ],
  8948. superclassRole: [ 'sectionhead' ],
  8949. accessibleNameRequired: false,
  8950. nameFromContent: true
  8951. },
  8952. img: {
  8953. type: 'structure',
  8954. allowedAttrs: [ 'aria-expanded' ],
  8955. superclassRole: [ 'section' ],
  8956. accessibleNameRequired: true,
  8957. childrenPresentational: true
  8958. },
  8959. input: {
  8960. type: 'abstract',
  8961. superclassRole: [ 'widget' ]
  8962. },
  8963. insertion: {
  8964. type: 'structure',
  8965. superclassRole: [ 'section' ],
  8966. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  8967. },
  8968. landmark: {
  8969. type: 'abstract',
  8970. superclassRole: [ 'section' ]
  8971. },
  8972. link: {
  8973. type: 'widget',
  8974. allowedAttrs: [ 'aria-expanded' ],
  8975. superclassRole: [ 'command' ],
  8976. accessibleNameRequired: true,
  8977. nameFromContent: true
  8978. },
  8979. list: {
  8980. type: 'structure',
  8981. requiredOwned: [ 'listitem' ],
  8982. allowedAttrs: [ 'aria-expanded' ],
  8983. superclassRole: [ 'section' ]
  8984. },
  8985. listbox: {
  8986. type: 'widget',
  8987. requiredOwned: [ 'group', 'option' ],
  8988. allowedAttrs: [ 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  8989. superclassRole: [ 'select' ],
  8990. accessibleNameRequired: true
  8991. },
  8992. listitem: {
  8993. type: 'structure',
  8994. requiredContext: [ 'list' ],
  8995. allowedAttrs: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
  8996. superclassRole: [ 'section' ],
  8997. nameFromContent: true
  8998. },
  8999. log: {
  9000. type: 'widget',
  9001. allowedAttrs: [ 'aria-expanded' ],
  9002. superclassRole: [ 'section' ]
  9003. },
  9004. main: {
  9005. type: 'landmark',
  9006. allowedAttrs: [ 'aria-expanded' ],
  9007. superclassRole: [ 'landmark' ]
  9008. },
  9009. marquee: {
  9010. type: 'widget',
  9011. allowedAttrs: [ 'aria-expanded' ],
  9012. superclassRole: [ 'section' ]
  9013. },
  9014. math: {
  9015. type: 'structure',
  9016. allowedAttrs: [ 'aria-expanded' ],
  9017. superclassRole: [ 'section' ],
  9018. childrenPresentational: true
  9019. },
  9020. menu: {
  9021. type: 'composite',
  9022. requiredOwned: [ 'group', 'menuitemradio', 'menuitem', 'menuitemcheckbox', 'menu', 'separator' ],
  9023. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  9024. superclassRole: [ 'select' ]
  9025. },
  9026. menubar: {
  9027. type: 'composite',
  9028. requiredOwned: [ 'group', 'menuitemradio', 'menuitem', 'menuitemcheckbox', 'menu', 'separator' ],
  9029. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  9030. superclassRole: [ 'menu' ]
  9031. },
  9032. menuitem: {
  9033. type: 'widget',
  9034. requiredContext: [ 'menu', 'menubar', 'group' ],
  9035. allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
  9036. superclassRole: [ 'command' ],
  9037. accessibleNameRequired: true,
  9038. nameFromContent: true
  9039. },
  9040. menuitemcheckbox: {
  9041. type: 'widget',
  9042. requiredContext: [ 'menu', 'menubar', 'group' ],
  9043. requiredAttrs: [ 'aria-checked' ],
  9044. allowedAttrs: [ 'aria-posinset', 'aria-readonly', 'aria-setsize' ],
  9045. superclassRole: [ 'checkbox', 'menuitem' ],
  9046. accessibleNameRequired: true,
  9047. nameFromContent: true,
  9048. childrenPresentational: true
  9049. },
  9050. menuitemradio: {
  9051. type: 'widget',
  9052. requiredContext: [ 'menu', 'menubar', 'group' ],
  9053. requiredAttrs: [ 'aria-checked' ],
  9054. allowedAttrs: [ 'aria-posinset', 'aria-readonly', 'aria-setsize' ],
  9055. superclassRole: [ 'menuitemcheckbox', 'radio' ],
  9056. accessibleNameRequired: true,
  9057. nameFromContent: true,
  9058. childrenPresentational: true
  9059. },
  9060. meter: {
  9061. type: 'structure',
  9062. requiredAttrs: [ 'aria-valuenow' ],
  9063. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-valuetext' ],
  9064. superclassRole: [ 'range' ],
  9065. accessibleNameRequired: true,
  9066. childrenPresentational: true
  9067. },
  9068. mark: {
  9069. type: 'structure',
  9070. superclassRole: [ 'section' ],
  9071. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  9072. },
  9073. navigation: {
  9074. type: 'landmark',
  9075. allowedAttrs: [ 'aria-expanded' ],
  9076. superclassRole: [ 'landmark' ]
  9077. },
  9078. none: {
  9079. type: 'structure',
  9080. superclassRole: [ 'structure' ],
  9081. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  9082. },
  9083. note: {
  9084. type: 'structure',
  9085. allowedAttrs: [ 'aria-expanded' ],
  9086. superclassRole: [ 'section' ]
  9087. },
  9088. option: {
  9089. type: 'widget',
  9090. requiredContext: [ 'group', 'listbox' ],
  9091. allowedAttrs: [ 'aria-selected', 'aria-checked', 'aria-posinset', 'aria-setsize' ],
  9092. superclassRole: [ 'input' ],
  9093. accessibleNameRequired: true,
  9094. nameFromContent: true,
  9095. childrenPresentational: true
  9096. },
  9097. paragraph: {
  9098. type: 'structure',
  9099. superclassRole: [ 'section' ],
  9100. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  9101. },
  9102. presentation: {
  9103. type: 'structure',
  9104. superclassRole: [ 'structure' ],
  9105. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  9106. },
  9107. progressbar: {
  9108. type: 'widget',
  9109. allowedAttrs: [ 'aria-expanded', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext' ],
  9110. superclassRole: [ 'range' ],
  9111. accessibleNameRequired: true,
  9112. childrenPresentational: true
  9113. },
  9114. radio: {
  9115. type: 'widget',
  9116. requiredAttrs: [ 'aria-checked' ],
  9117. allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-required' ],
  9118. superclassRole: [ 'input' ],
  9119. accessibleNameRequired: true,
  9120. nameFromContent: true,
  9121. childrenPresentational: true
  9122. },
  9123. radiogroup: {
  9124. type: 'composite',
  9125. allowedAttrs: [ 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  9126. superclassRole: [ 'select' ],
  9127. accessibleNameRequired: false
  9128. },
  9129. range: {
  9130. type: 'abstract',
  9131. superclassRole: [ 'widget' ]
  9132. },
  9133. region: {
  9134. type: 'landmark',
  9135. allowedAttrs: [ 'aria-expanded' ],
  9136. superclassRole: [ 'landmark' ],
  9137. accessibleNameRequired: false
  9138. },
  9139. roletype: {
  9140. type: 'abstract',
  9141. superclassRole: []
  9142. },
  9143. row: {
  9144. type: 'structure',
  9145. requiredContext: [ 'grid', 'rowgroup', 'table', 'treegrid' ],
  9146. requiredOwned: [ 'cell', 'columnheader', 'gridcell', 'rowheader' ],
  9147. allowedAttrs: [ 'aria-colindex', 'aria-level', 'aria-rowindex', 'aria-selected', 'aria-activedescendant', 'aria-expanded', 'aria-posinset', 'aria-setsize' ],
  9148. superclassRole: [ 'group', 'widget' ],
  9149. nameFromContent: true
  9150. },
  9151. rowgroup: {
  9152. type: 'structure',
  9153. requiredContext: [ 'grid', 'table', 'treegrid' ],
  9154. requiredOwned: [ 'row' ],
  9155. superclassRole: [ 'structure' ],
  9156. nameFromContent: true
  9157. },
  9158. rowheader: {
  9159. type: 'structure',
  9160. requiredContext: [ 'row' ],
  9161. allowedAttrs: [ 'aria-sort', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-readonly', 'aria-required', 'aria-rowindex', 'aria-rowspan', 'aria-selected' ],
  9162. superclassRole: [ 'cell', 'gridcell', 'sectionhead' ],
  9163. accessibleNameRequired: false,
  9164. nameFromContent: true
  9165. },
  9166. scrollbar: {
  9167. type: 'widget',
  9168. requiredAttrs: [ 'aria-valuenow' ],
  9169. allowedAttrs: [ 'aria-controls', 'aria-orientation', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext' ],
  9170. superclassRole: [ 'range' ],
  9171. childrenPresentational: true
  9172. },
  9173. search: {
  9174. type: 'landmark',
  9175. allowedAttrs: [ 'aria-expanded' ],
  9176. superclassRole: [ 'landmark' ]
  9177. },
  9178. searchbox: {
  9179. type: 'widget',
  9180. allowedAttrs: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-placeholder', 'aria-readonly', 'aria-required' ],
  9181. superclassRole: [ 'textbox' ],
  9182. accessibleNameRequired: true
  9183. },
  9184. section: {
  9185. type: 'abstract',
  9186. superclassRole: [ 'structure' ],
  9187. nameFromContent: true
  9188. },
  9189. sectionhead: {
  9190. type: 'abstract',
  9191. superclassRole: [ 'structure' ],
  9192. nameFromContent: true
  9193. },
  9194. select: {
  9195. type: 'abstract',
  9196. superclassRole: [ 'composite', 'group' ]
  9197. },
  9198. separator: {
  9199. type: 'structure',
  9200. requiredAttrs: [ 'aria-valuenow' ],
  9201. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-valuetext' ],
  9202. superclassRole: [ 'structure', 'widget' ],
  9203. childrenPresentational: true
  9204. },
  9205. slider: {
  9206. type: 'widget',
  9207. requiredAttrs: [ 'aria-valuenow' ],
  9208. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-readonly', 'aria-valuetext' ],
  9209. superclassRole: [ 'input', 'range' ],
  9210. accessibleNameRequired: true,
  9211. childrenPresentational: true
  9212. },
  9213. spinbutton: {
  9214. type: 'widget',
  9215. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-valuetext', 'aria-valuenow' ],
  9216. superclassRole: [ 'composite', 'input', 'range' ],
  9217. accessibleNameRequired: true
  9218. },
  9219. status: {
  9220. type: 'widget',
  9221. allowedAttrs: [ 'aria-expanded' ],
  9222. superclassRole: [ 'section' ]
  9223. },
  9224. strong: {
  9225. type: 'structure',
  9226. superclassRole: [ 'section' ],
  9227. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  9228. },
  9229. structure: {
  9230. type: 'abstract',
  9231. superclassRole: [ 'roletype' ]
  9232. },
  9233. subscript: {
  9234. type: 'structure',
  9235. superclassRole: [ 'section' ],
  9236. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  9237. },
  9238. superscript: {
  9239. type: 'structure',
  9240. superclassRole: [ 'section' ],
  9241. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  9242. },
  9243. switch: {
  9244. type: 'widget',
  9245. requiredAttrs: [ 'aria-checked' ],
  9246. allowedAttrs: [ 'aria-readonly' ],
  9247. superclassRole: [ 'checkbox' ],
  9248. accessibleNameRequired: true,
  9249. nameFromContent: true,
  9250. childrenPresentational: true
  9251. },
  9252. suggestion: {
  9253. type: 'structure',
  9254. requiredOwned: [ 'insertion', 'deletion' ],
  9255. superclassRole: [ 'section' ],
  9256. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  9257. },
  9258. tab: {
  9259. type: 'widget',
  9260. requiredContext: [ 'tablist' ],
  9261. allowedAttrs: [ 'aria-posinset', 'aria-selected', 'aria-setsize', 'aria-expanded' ],
  9262. superclassRole: [ 'sectionhead', 'widget' ],
  9263. nameFromContent: true,
  9264. childrenPresentational: true
  9265. },
  9266. table: {
  9267. type: 'structure',
  9268. requiredOwned: [ 'rowgroup', 'row' ],
  9269. allowedAttrs: [ 'aria-colcount', 'aria-rowcount', 'aria-expanded' ],
  9270. superclassRole: [ 'section' ],
  9271. accessibleNameRequired: false,
  9272. nameFromContent: true
  9273. },
  9274. tablist: {
  9275. type: 'composite',
  9276. requiredOwned: [ 'tab' ],
  9277. allowedAttrs: [ 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-activedescendant', 'aria-expanded' ],
  9278. superclassRole: [ 'composite' ]
  9279. },
  9280. tabpanel: {
  9281. type: 'widget',
  9282. allowedAttrs: [ 'aria-expanded' ],
  9283. superclassRole: [ 'section' ],
  9284. accessibleNameRequired: false
  9285. },
  9286. term: {
  9287. type: 'structure',
  9288. allowedAttrs: [ 'aria-expanded' ],
  9289. superclassRole: [ 'section' ],
  9290. nameFromContent: true
  9291. },
  9292. text: {
  9293. type: 'structure',
  9294. superclassRole: [ 'section' ],
  9295. nameFromContent: true
  9296. },
  9297. textbox: {
  9298. type: 'widget',
  9299. allowedAttrs: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-placeholder', 'aria-readonly', 'aria-required' ],
  9300. superclassRole: [ 'input' ],
  9301. accessibleNameRequired: true
  9302. },
  9303. time: {
  9304. type: 'structure',
  9305. superclassRole: [ 'section' ]
  9306. },
  9307. timer: {
  9308. type: 'widget',
  9309. allowedAttrs: [ 'aria-expanded' ],
  9310. superclassRole: [ 'status' ]
  9311. },
  9312. toolbar: {
  9313. type: 'structure',
  9314. allowedAttrs: [ 'aria-orientation', 'aria-activedescendant', 'aria-expanded' ],
  9315. superclassRole: [ 'group' ],
  9316. accessibleNameRequired: true
  9317. },
  9318. tooltip: {
  9319. type: 'structure',
  9320. allowedAttrs: [ 'aria-expanded' ],
  9321. superclassRole: [ 'section' ],
  9322. nameFromContent: true
  9323. },
  9324. tree: {
  9325. type: 'composite',
  9326. requiredOwned: [ 'group', 'treeitem' ],
  9327. allowedAttrs: [ 'aria-multiselectable', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  9328. superclassRole: [ 'select' ],
  9329. accessibleNameRequired: false
  9330. },
  9331. treegrid: {
  9332. type: 'composite',
  9333. requiredOwned: [ 'rowgroup', 'row' ],
  9334. allowedAttrs: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-readonly', 'aria-required', 'aria-rowcount' ],
  9335. superclassRole: [ 'grid', 'tree' ],
  9336. accessibleNameRequired: false
  9337. },
  9338. treeitem: {
  9339. type: 'widget',
  9340. requiredContext: [ 'group', 'tree' ],
  9341. allowedAttrs: [ 'aria-checked', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-selected', 'aria-setsize' ],
  9342. superclassRole: [ 'listitem', 'option' ],
  9343. accessibleNameRequired: true,
  9344. nameFromContent: true
  9345. },
  9346. widget: {
  9347. type: 'abstract',
  9348. superclassRole: [ 'roletype' ]
  9349. },
  9350. window: {
  9351. type: 'abstract',
  9352. superclassRole: [ 'roletype' ]
  9353. }
  9354. };
  9355. var aria_roles_default = ariaRoles;
  9356. var dpubRoles = {
  9357. 'doc-abstract': {
  9358. type: 'section',
  9359. allowedAttrs: [ 'aria-expanded' ],
  9360. superclassRole: [ 'section' ]
  9361. },
  9362. 'doc-acknowledgments': {
  9363. type: 'landmark',
  9364. allowedAttrs: [ 'aria-expanded' ],
  9365. superclassRole: [ 'landmark' ]
  9366. },
  9367. 'doc-afterword': {
  9368. type: 'landmark',
  9369. allowedAttrs: [ 'aria-expanded' ],
  9370. superclassRole: [ 'landmark' ]
  9371. },
  9372. 'doc-appendix': {
  9373. type: 'landmark',
  9374. allowedAttrs: [ 'aria-expanded' ],
  9375. superclassRole: [ 'landmark' ]
  9376. },
  9377. 'doc-backlink': {
  9378. type: 'link',
  9379. allowedAttrs: [ 'aria-expanded' ],
  9380. nameFromContent: true,
  9381. superclassRole: [ 'link' ]
  9382. },
  9383. 'doc-biblioentry': {
  9384. type: 'listitem',
  9385. allowedAttrs: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize' ],
  9386. superclassRole: [ 'listitem' ],
  9387. deprecated: true
  9388. },
  9389. 'doc-bibliography': {
  9390. type: 'landmark',
  9391. allowedAttrs: [ 'aria-expanded' ],
  9392. superclassRole: [ 'landmark' ]
  9393. },
  9394. 'doc-biblioref': {
  9395. type: 'link',
  9396. allowedAttrs: [ 'aria-expanded' ],
  9397. nameFromContent: true,
  9398. superclassRole: [ 'link' ]
  9399. },
  9400. 'doc-chapter': {
  9401. type: 'landmark',
  9402. allowedAttrs: [ 'aria-expanded' ],
  9403. superclassRole: [ 'landmark' ]
  9404. },
  9405. 'doc-colophon': {
  9406. type: 'section',
  9407. allowedAttrs: [ 'aria-expanded' ],
  9408. superclassRole: [ 'section' ]
  9409. },
  9410. 'doc-conclusion': {
  9411. type: 'landmark',
  9412. allowedAttrs: [ 'aria-expanded' ],
  9413. superclassRole: [ 'landmark' ]
  9414. },
  9415. 'doc-cover': {
  9416. type: 'img',
  9417. allowedAttrs: [ 'aria-expanded' ],
  9418. superclassRole: [ 'img' ]
  9419. },
  9420. 'doc-credit': {
  9421. type: 'section',
  9422. allowedAttrs: [ 'aria-expanded' ],
  9423. superclassRole: [ 'section' ]
  9424. },
  9425. 'doc-credits': {
  9426. type: 'landmark',
  9427. allowedAttrs: [ 'aria-expanded' ],
  9428. superclassRole: [ 'landmark' ]
  9429. },
  9430. 'doc-dedication': {
  9431. type: 'section',
  9432. allowedAttrs: [ 'aria-expanded' ],
  9433. superclassRole: [ 'section' ]
  9434. },
  9435. 'doc-endnote': {
  9436. type: 'listitem',
  9437. allowedAttrs: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize' ],
  9438. superclassRole: [ 'listitem' ],
  9439. deprecated: true
  9440. },
  9441. 'doc-endnotes': {
  9442. type: 'landmark',
  9443. allowedAttrs: [ 'aria-expanded' ],
  9444. superclassRole: [ 'landmark' ]
  9445. },
  9446. 'doc-epigraph': {
  9447. type: 'section',
  9448. allowedAttrs: [ 'aria-expanded' ],
  9449. superclassRole: [ 'section' ]
  9450. },
  9451. 'doc-epilogue': {
  9452. type: 'landmark',
  9453. allowedAttrs: [ 'aria-expanded' ],
  9454. superclassRole: [ 'landmark' ]
  9455. },
  9456. 'doc-errata': {
  9457. type: 'landmark',
  9458. allowedAttrs: [ 'aria-expanded' ],
  9459. superclassRole: [ 'landmark' ]
  9460. },
  9461. 'doc-example': {
  9462. type: 'section',
  9463. allowedAttrs: [ 'aria-expanded' ],
  9464. superclassRole: [ 'section' ]
  9465. },
  9466. 'doc-footnote': {
  9467. type: 'section',
  9468. allowedAttrs: [ 'aria-expanded' ],
  9469. superclassRole: [ 'section' ]
  9470. },
  9471. 'doc-foreword': {
  9472. type: 'landmark',
  9473. allowedAttrs: [ 'aria-expanded' ],
  9474. superclassRole: [ 'landmark' ]
  9475. },
  9476. 'doc-glossary': {
  9477. type: 'landmark',
  9478. allowedAttrs: [ 'aria-expanded' ],
  9479. superclassRole: [ 'landmark' ]
  9480. },
  9481. 'doc-glossref': {
  9482. type: 'link',
  9483. allowedAttrs: [ 'aria-expanded' ],
  9484. nameFromContent: true,
  9485. superclassRole: [ 'link' ]
  9486. },
  9487. 'doc-index': {
  9488. type: 'navigation',
  9489. allowedAttrs: [ 'aria-expanded' ],
  9490. superclassRole: [ 'navigation' ]
  9491. },
  9492. 'doc-introduction': {
  9493. type: 'landmark',
  9494. allowedAttrs: [ 'aria-expanded' ],
  9495. superclassRole: [ 'landmark' ]
  9496. },
  9497. 'doc-noteref': {
  9498. type: 'link',
  9499. allowedAttrs: [ 'aria-expanded' ],
  9500. nameFromContent: true,
  9501. superclassRole: [ 'link' ]
  9502. },
  9503. 'doc-notice': {
  9504. type: 'note',
  9505. allowedAttrs: [ 'aria-expanded' ],
  9506. superclassRole: [ 'note' ]
  9507. },
  9508. 'doc-pagebreak': {
  9509. type: 'separator',
  9510. allowedAttrs: [ 'aria-expanded', 'aria-orientation' ],
  9511. superclassRole: [ 'separator' ],
  9512. childrenPresentational: true
  9513. },
  9514. 'doc-pagelist': {
  9515. type: 'navigation',
  9516. allowedAttrs: [ 'aria-expanded' ],
  9517. superclassRole: [ 'navigation' ]
  9518. },
  9519. 'doc-part': {
  9520. type: 'landmark',
  9521. allowedAttrs: [ 'aria-expanded' ],
  9522. superclassRole: [ 'landmark' ]
  9523. },
  9524. 'doc-preface': {
  9525. type: 'landmark',
  9526. allowedAttrs: [ 'aria-expanded' ],
  9527. superclassRole: [ 'landmark' ]
  9528. },
  9529. 'doc-prologue': {
  9530. type: 'landmark',
  9531. allowedAttrs: [ 'aria-expanded' ],
  9532. superclassRole: [ 'landmark' ]
  9533. },
  9534. 'doc-pullquote': {
  9535. type: 'none',
  9536. superclassRole: [ 'none' ]
  9537. },
  9538. 'doc-qna': {
  9539. type: 'section',
  9540. allowedAttrs: [ 'aria-expanded' ],
  9541. superclassRole: [ 'section' ]
  9542. },
  9543. 'doc-subtitle': {
  9544. type: 'sectionhead',
  9545. allowedAttrs: [ 'aria-expanded' ],
  9546. superclassRole: [ 'sectionhead' ]
  9547. },
  9548. 'doc-tip': {
  9549. type: 'note',
  9550. allowedAttrs: [ 'aria-expanded' ],
  9551. superclassRole: [ 'note' ]
  9552. },
  9553. 'doc-toc': {
  9554. type: 'navigation',
  9555. allowedAttrs: [ 'aria-expanded' ],
  9556. superclassRole: [ 'navigation' ]
  9557. }
  9558. };
  9559. var dpub_roles_default = dpubRoles;
  9560. var graphicsRoles = {
  9561. 'graphics-document': {
  9562. type: 'structure',
  9563. superclassRole: [ 'document' ],
  9564. accessibleNameRequired: true
  9565. },
  9566. 'graphics-object': {
  9567. type: 'structure',
  9568. superclassRole: [ 'group' ],
  9569. nameFromContent: true
  9570. },
  9571. 'graphics-symbol': {
  9572. type: 'structure',
  9573. superclassRole: [ 'img' ],
  9574. accessibleNameRequired: true,
  9575. childrenPresentational: true
  9576. }
  9577. };
  9578. var graphics_roles_default = graphicsRoles;
  9579. var htmlElms = {
  9580. a: {
  9581. variant: {
  9582. href: {
  9583. matches: '[href]',
  9584. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  9585. allowedRoles: [ 'button', 'checkbox', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab', 'treeitem', 'doc-backlink', 'doc-biblioref', 'doc-glossref', 'doc-noteref' ],
  9586. namingMethods: [ 'subtreeText' ]
  9587. },
  9588. default: {
  9589. contentTypes: [ 'phrasing', 'flow' ],
  9590. allowedRoles: true
  9591. }
  9592. }
  9593. },
  9594. abbr: {
  9595. contentTypes: [ 'phrasing', 'flow' ],
  9596. allowedRoles: true
  9597. },
  9598. address: {
  9599. contentTypes: [ 'flow' ],
  9600. allowedRoles: true
  9601. },
  9602. area: {
  9603. variant: {
  9604. href: {
  9605. matches: '[href]',
  9606. allowedRoles: false
  9607. },
  9608. default: {
  9609. allowedRoles: [ 'button', 'link' ]
  9610. }
  9611. },
  9612. contentTypes: [ 'phrasing', 'flow' ],
  9613. namingMethods: [ 'altText' ]
  9614. },
  9615. article: {
  9616. contentTypes: [ 'sectioning', 'flow' ],
  9617. allowedRoles: [ 'feed', 'presentation', 'none', 'document', 'application', 'main', 'region' ],
  9618. shadowRoot: true
  9619. },
  9620. aside: {
  9621. contentTypes: [ 'sectioning', 'flow' ],
  9622. allowedRoles: [ 'feed', 'note', 'presentation', 'none', 'region', 'search', 'doc-dedication', 'doc-example', 'doc-footnote', 'doc-pullquote', 'doc-tip' ]
  9623. },
  9624. audio: {
  9625. variant: {
  9626. controls: {
  9627. matches: '[controls]',
  9628. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
  9629. },
  9630. default: {
  9631. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  9632. }
  9633. },
  9634. allowedRoles: [ 'application' ],
  9635. chromiumRole: 'Audio'
  9636. },
  9637. b: {
  9638. contentTypes: [ 'phrasing', 'flow' ],
  9639. allowedRoles: true
  9640. },
  9641. base: {
  9642. allowedRoles: false,
  9643. noAriaAttrs: true
  9644. },
  9645. bdi: {
  9646. contentTypes: [ 'phrasing', 'flow' ],
  9647. allowedRoles: true
  9648. },
  9649. bdo: {
  9650. contentTypes: [ 'phrasing', 'flow' ],
  9651. allowedRoles: true
  9652. },
  9653. blockquote: {
  9654. contentTypes: [ 'flow' ],
  9655. allowedRoles: true,
  9656. shadowRoot: true
  9657. },
  9658. body: {
  9659. allowedRoles: false,
  9660. shadowRoot: true
  9661. },
  9662. br: {
  9663. contentTypes: [ 'phrasing', 'flow' ],
  9664. allowedRoles: [ 'presentation', 'none' ],
  9665. namingMethods: [ 'titleText', 'singleSpace' ]
  9666. },
  9667. button: {
  9668. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  9669. allowedRoles: [ 'checkbox', 'combobox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab' ],
  9670. namingMethods: [ 'subtreeText' ]
  9671. },
  9672. canvas: {
  9673. allowedRoles: true,
  9674. contentTypes: [ 'embedded', 'phrasing', 'flow' ],
  9675. chromiumRole: 'Canvas'
  9676. },
  9677. caption: {
  9678. allowedRoles: false
  9679. },
  9680. cite: {
  9681. contentTypes: [ 'phrasing', 'flow' ],
  9682. allowedRoles: true
  9683. },
  9684. code: {
  9685. contentTypes: [ 'phrasing', 'flow' ],
  9686. allowedRoles: true
  9687. },
  9688. col: {
  9689. allowedRoles: false,
  9690. noAriaAttrs: true
  9691. },
  9692. colgroup: {
  9693. allowedRoles: false,
  9694. noAriaAttrs: true
  9695. },
  9696. data: {
  9697. contentTypes: [ 'phrasing', 'flow' ],
  9698. allowedRoles: true
  9699. },
  9700. datalist: {
  9701. contentTypes: [ 'phrasing', 'flow' ],
  9702. allowedRoles: false,
  9703. noAriaAttrs: true,
  9704. implicitAttrs: {
  9705. 'aria-multiselectable': 'false'
  9706. }
  9707. },
  9708. dd: {
  9709. allowedRoles: false
  9710. },
  9711. del: {
  9712. contentTypes: [ 'phrasing', 'flow' ],
  9713. allowedRoles: true
  9714. },
  9715. dfn: {
  9716. contentTypes: [ 'phrasing', 'flow' ],
  9717. allowedRoles: true
  9718. },
  9719. details: {
  9720. contentTypes: [ 'interactive', 'flow' ],
  9721. allowedRoles: false
  9722. },
  9723. dialog: {
  9724. contentTypes: [ 'flow' ],
  9725. allowedRoles: [ 'alertdialog' ]
  9726. },
  9727. div: {
  9728. contentTypes: [ 'flow' ],
  9729. allowedRoles: true,
  9730. shadowRoot: true
  9731. },
  9732. dl: {
  9733. contentTypes: [ 'flow' ],
  9734. allowedRoles: [ 'group', 'list', 'presentation', 'none' ],
  9735. chromiumRole: 'DescriptionList'
  9736. },
  9737. dt: {
  9738. allowedRoles: [ 'listitem' ]
  9739. },
  9740. em: {
  9741. contentTypes: [ 'phrasing', 'flow' ],
  9742. allowedRoles: true
  9743. },
  9744. embed: {
  9745. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ],
  9746. allowedRoles: [ 'application', 'document', 'img', 'presentation', 'none' ],
  9747. chromiumRole: 'EmbeddedObject'
  9748. },
  9749. fieldset: {
  9750. contentTypes: [ 'flow' ],
  9751. allowedRoles: [ 'none', 'presentation', 'radiogroup' ],
  9752. namingMethods: [ 'fieldsetLegendText' ]
  9753. },
  9754. figcaption: {
  9755. allowedRoles: [ 'group', 'none', 'presentation' ]
  9756. },
  9757. figure: {
  9758. contentTypes: [ 'flow' ],
  9759. allowedRoles: true,
  9760. namingMethods: [ 'figureText', 'titleText' ]
  9761. },
  9762. footer: {
  9763. contentTypes: [ 'flow' ],
  9764. allowedRoles: [ 'group', 'none', 'presentation', 'doc-footnote' ],
  9765. shadowRoot: true
  9766. },
  9767. form: {
  9768. contentTypes: [ 'flow' ],
  9769. allowedRoles: [ 'search', 'none', 'presentation' ]
  9770. },
  9771. h1: {
  9772. contentTypes: [ 'heading', 'flow' ],
  9773. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9774. shadowRoot: true,
  9775. implicitAttrs: {
  9776. 'aria-level': '1'
  9777. }
  9778. },
  9779. h2: {
  9780. contentTypes: [ 'heading', 'flow' ],
  9781. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9782. shadowRoot: true,
  9783. implicitAttrs: {
  9784. 'aria-level': '2'
  9785. }
  9786. },
  9787. h3: {
  9788. contentTypes: [ 'heading', 'flow' ],
  9789. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9790. shadowRoot: true,
  9791. implicitAttrs: {
  9792. 'aria-level': '3'
  9793. }
  9794. },
  9795. h4: {
  9796. contentTypes: [ 'heading', 'flow' ],
  9797. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9798. shadowRoot: true,
  9799. implicitAttrs: {
  9800. 'aria-level': '4'
  9801. }
  9802. },
  9803. h5: {
  9804. contentTypes: [ 'heading', 'flow' ],
  9805. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9806. shadowRoot: true,
  9807. implicitAttrs: {
  9808. 'aria-level': '5'
  9809. }
  9810. },
  9811. h6: {
  9812. contentTypes: [ 'heading', 'flow' ],
  9813. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9814. shadowRoot: true,
  9815. implicitAttrs: {
  9816. 'aria-level': '6'
  9817. }
  9818. },
  9819. head: {
  9820. allowedRoles: false,
  9821. noAriaAttrs: true
  9822. },
  9823. header: {
  9824. contentTypes: [ 'flow' ],
  9825. allowedRoles: [ 'group', 'none', 'presentation', 'doc-footnote' ],
  9826. shadowRoot: true
  9827. },
  9828. hgroup: {
  9829. contentTypes: [ 'heading', 'flow' ],
  9830. allowedRoles: true
  9831. },
  9832. hr: {
  9833. contentTypes: [ 'flow' ],
  9834. allowedRoles: [ 'none', 'presentation', 'doc-pagebreak' ],
  9835. namingMethods: [ 'titleText', 'singleSpace' ]
  9836. },
  9837. html: {
  9838. allowedRoles: false,
  9839. noAriaAttrs: true
  9840. },
  9841. i: {
  9842. contentTypes: [ 'phrasing', 'flow' ],
  9843. allowedRoles: true
  9844. },
  9845. iframe: {
  9846. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ],
  9847. allowedRoles: [ 'application', 'document', 'img', 'none', 'presentation' ],
  9848. chromiumRole: 'Iframe'
  9849. },
  9850. img: {
  9851. variant: {
  9852. nonEmptyAlt: {
  9853. matches: [ {
  9854. attributes: {
  9855. alt: '/.+/'
  9856. }
  9857. }, {
  9858. hasAccessibleName: true
  9859. } ],
  9860. allowedRoles: [ 'button', 'checkbox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'scrollbar', 'separator', 'slider', 'switch', 'tab', 'treeitem', 'doc-cover' ]
  9861. },
  9862. usemap: {
  9863. matches: '[usemap]',
  9864. contentTypes: [ 'interactive', 'embedded', 'flow' ]
  9865. },
  9866. default: {
  9867. allowedRoles: [ 'presentation', 'none' ],
  9868. contentTypes: [ 'embedded', 'flow' ]
  9869. }
  9870. },
  9871. namingMethods: [ 'altText' ]
  9872. },
  9873. input: {
  9874. variant: {
  9875. button: {
  9876. matches: {
  9877. properties: {
  9878. type: 'button'
  9879. }
  9880. },
  9881. allowedRoles: [ 'checkbox', 'combobox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab' ]
  9882. },
  9883. buttonType: {
  9884. matches: {
  9885. properties: {
  9886. type: [ 'button', 'submit', 'reset' ]
  9887. }
  9888. },
  9889. namingMethods: [ 'valueText', 'titleText', 'buttonDefaultText' ]
  9890. },
  9891. checkboxPressed: {
  9892. matches: {
  9893. properties: {
  9894. type: 'checkbox'
  9895. },
  9896. attributes: {
  9897. 'aria-pressed': '/.*/'
  9898. }
  9899. },
  9900. allowedRoles: [ 'button', 'menuitemcheckbox', 'option', 'switch' ],
  9901. implicitAttrs: {
  9902. 'aria-checked': 'false'
  9903. }
  9904. },
  9905. checkbox: {
  9906. matches: {
  9907. properties: {
  9908. type: 'checkbox'
  9909. },
  9910. attributes: {
  9911. 'aria-pressed': null
  9912. }
  9913. },
  9914. allowedRoles: [ 'menuitemcheckbox', 'option', 'switch' ],
  9915. implicitAttrs: {
  9916. 'aria-checked': 'false'
  9917. }
  9918. },
  9919. noRoles: {
  9920. matches: {
  9921. properties: {
  9922. type: [ 'color', 'date', 'datetime-local', 'file', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ]
  9923. }
  9924. },
  9925. allowedRoles: false
  9926. },
  9927. hidden: {
  9928. matches: {
  9929. properties: {
  9930. type: 'hidden'
  9931. }
  9932. },
  9933. contentTypes: [ 'flow' ],
  9934. allowedRoles: false,
  9935. noAriaAttrs: true
  9936. },
  9937. image: {
  9938. matches: {
  9939. properties: {
  9940. type: 'image'
  9941. }
  9942. },
  9943. allowedRoles: [ 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'radio', 'switch' ],
  9944. namingMethods: [ 'altText', 'valueText', 'labelText', 'titleText', 'buttonDefaultText' ]
  9945. },
  9946. radio: {
  9947. matches: {
  9948. properties: {
  9949. type: 'radio'
  9950. }
  9951. },
  9952. allowedRoles: [ 'menuitemradio' ],
  9953. implicitAttrs: {
  9954. 'aria-checked': 'false'
  9955. }
  9956. },
  9957. textWithList: {
  9958. matches: {
  9959. properties: {
  9960. type: 'text'
  9961. },
  9962. attributes: {
  9963. list: '/.*/'
  9964. }
  9965. },
  9966. allowedRoles: false
  9967. },
  9968. default: {
  9969. contentTypes: [ 'interactive', 'flow' ],
  9970. allowedRoles: [ 'combobox', 'searchbox', 'spinbutton' ],
  9971. implicitAttrs: {
  9972. 'aria-valuenow': ''
  9973. },
  9974. namingMethods: [ 'labelText', 'placeholderText' ]
  9975. }
  9976. }
  9977. },
  9978. ins: {
  9979. contentTypes: [ 'phrasing', 'flow' ],
  9980. allowedRoles: true
  9981. },
  9982. kbd: {
  9983. contentTypes: [ 'phrasing', 'flow' ],
  9984. allowedRoles: true
  9985. },
  9986. label: {
  9987. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  9988. allowedRoles: false,
  9989. chromiumRole: 'Label'
  9990. },
  9991. legend: {
  9992. allowedRoles: false
  9993. },
  9994. li: {
  9995. allowedRoles: [ 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'none', 'presentation', 'radio', 'separator', 'tab', 'treeitem', 'doc-biblioentry', 'doc-endnote' ],
  9996. implicitAttrs: {
  9997. 'aria-setsize': '1',
  9998. 'aria-posinset': '1'
  9999. }
  10000. },
  10001. link: {
  10002. contentTypes: [ 'phrasing', 'flow' ],
  10003. allowedRoles: false,
  10004. noAriaAttrs: true
  10005. },
  10006. main: {
  10007. contentTypes: [ 'flow' ],
  10008. allowedRoles: false,
  10009. shadowRoot: true
  10010. },
  10011. map: {
  10012. contentTypes: [ 'phrasing', 'flow' ],
  10013. allowedRoles: false,
  10014. noAriaAttrs: true
  10015. },
  10016. math: {
  10017. contentTypes: [ 'embedded', 'phrasing', 'flow' ],
  10018. allowedRoles: false
  10019. },
  10020. mark: {
  10021. contentTypes: [ 'phrasing', 'flow' ],
  10022. allowedRoles: true
  10023. },
  10024. menu: {
  10025. contentTypes: [ 'flow' ],
  10026. allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
  10027. },
  10028. meta: {
  10029. variant: {
  10030. itemprop: {
  10031. matches: '[itemprop]',
  10032. contentTypes: [ 'phrasing', 'flow' ]
  10033. }
  10034. },
  10035. allowedRoles: false,
  10036. noAriaAttrs: true
  10037. },
  10038. meter: {
  10039. contentTypes: [ 'phrasing', 'flow' ],
  10040. allowedRoles: false,
  10041. chromiumRole: 'progressbar'
  10042. },
  10043. nav: {
  10044. contentTypes: [ 'sectioning', 'flow' ],
  10045. allowedRoles: [ 'doc-index', 'doc-pagelist', 'doc-toc', 'menu', 'menubar', 'none', 'presentation', 'tablist' ],
  10046. shadowRoot: true
  10047. },
  10048. noscript: {
  10049. contentTypes: [ 'phrasing', 'flow' ],
  10050. allowedRoles: false,
  10051. noAriaAttrs: true
  10052. },
  10053. object: {
  10054. variant: {
  10055. usemap: {
  10056. matches: '[usemap]',
  10057. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
  10058. },
  10059. default: {
  10060. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  10061. }
  10062. },
  10063. allowedRoles: [ 'application', 'document', 'img' ],
  10064. chromiumRole: 'PluginObject'
  10065. },
  10066. ol: {
  10067. contentTypes: [ 'flow' ],
  10068. allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
  10069. },
  10070. optgroup: {
  10071. allowedRoles: false
  10072. },
  10073. option: {
  10074. allowedRoles: false,
  10075. implicitAttrs: {
  10076. 'aria-selected': 'false'
  10077. }
  10078. },
  10079. output: {
  10080. contentTypes: [ 'phrasing', 'flow' ],
  10081. allowedRoles: true,
  10082. namingMethods: [ 'subtreeText' ]
  10083. },
  10084. p: {
  10085. contentTypes: [ 'flow' ],
  10086. allowedRoles: true,
  10087. shadowRoot: true
  10088. },
  10089. param: {
  10090. allowedRoles: false,
  10091. noAriaAttrs: true
  10092. },
  10093. picture: {
  10094. contentTypes: [ 'phrasing', 'flow' ],
  10095. allowedRoles: false,
  10096. noAriaAttrs: true
  10097. },
  10098. pre: {
  10099. contentTypes: [ 'flow' ],
  10100. allowedRoles: true
  10101. },
  10102. progress: {
  10103. contentTypes: [ 'phrasing', 'flow' ],
  10104. allowedRoles: false,
  10105. implicitAttrs: {
  10106. 'aria-valuemax': '100',
  10107. 'aria-valuemin': '0',
  10108. 'aria-valuenow': '0'
  10109. }
  10110. },
  10111. q: {
  10112. contentTypes: [ 'phrasing', 'flow' ],
  10113. allowedRoles: true
  10114. },
  10115. rp: {
  10116. allowedRoles: true
  10117. },
  10118. rt: {
  10119. allowedRoles: true
  10120. },
  10121. ruby: {
  10122. contentTypes: [ 'phrasing', 'flow' ],
  10123. allowedRoles: true
  10124. },
  10125. s: {
  10126. contentTypes: [ 'phrasing', 'flow' ],
  10127. allowedRoles: true
  10128. },
  10129. samp: {
  10130. contentTypes: [ 'phrasing', 'flow' ],
  10131. allowedRoles: true
  10132. },
  10133. script: {
  10134. contentTypes: [ 'phrasing', 'flow' ],
  10135. allowedRoles: false,
  10136. noAriaAttrs: true
  10137. },
  10138. section: {
  10139. contentTypes: [ 'sectioning', 'flow' ],
  10140. allowedRoles: [ 'alert', 'alertdialog', 'application', 'banner', 'complementary', 'contentinfo', 'dialog', 'document', 'feed', 'group', 'log', 'main', 'marquee', 'navigation', 'none', 'note', 'presentation', 'search', 'status', 'tabpanel', 'doc-abstract', 'doc-acknowledgments', 'doc-afterword', 'doc-appendix', 'doc-bibliography', 'doc-chapter', 'doc-colophon', 'doc-conclusion', 'doc-credit', 'doc-credits', 'doc-dedication', 'doc-endnotes', 'doc-epigraph', 'doc-epilogue', 'doc-errata', 'doc-example', 'doc-foreword', 'doc-glossary', 'doc-index', 'doc-introduction', 'doc-notice', 'doc-pagelist', 'doc-part', 'doc-preface', 'doc-prologue', 'doc-pullquote', 'doc-qna', 'doc-toc' ],
  10141. shadowRoot: true
  10142. },
  10143. select: {
  10144. variant: {
  10145. combobox: {
  10146. matches: {
  10147. attributes: {
  10148. multiple: null,
  10149. size: [ null, '1' ]
  10150. }
  10151. },
  10152. allowedRoles: [ 'menu' ]
  10153. },
  10154. default: {
  10155. allowedRoles: false
  10156. }
  10157. },
  10158. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  10159. implicitAttrs: {
  10160. 'aria-valuenow': ''
  10161. },
  10162. namingMethods: [ 'labelText' ]
  10163. },
  10164. slot: {
  10165. contentTypes: [ 'phrasing', 'flow' ],
  10166. allowedRoles: false,
  10167. noAriaAttrs: true
  10168. },
  10169. small: {
  10170. contentTypes: [ 'phrasing', 'flow' ],
  10171. allowedRoles: true
  10172. },
  10173. source: {
  10174. allowedRoles: false,
  10175. noAriaAttrs: true
  10176. },
  10177. span: {
  10178. contentTypes: [ 'phrasing', 'flow' ],
  10179. allowedRoles: true,
  10180. shadowRoot: true
  10181. },
  10182. strong: {
  10183. contentTypes: [ 'phrasing', 'flow' ],
  10184. allowedRoles: true
  10185. },
  10186. style: {
  10187. allowedRoles: false,
  10188. noAriaAttrs: true
  10189. },
  10190. svg: {
  10191. contentTypes: [ 'embedded', 'phrasing', 'flow' ],
  10192. allowedRoles: true,
  10193. chromiumRole: 'SVGRoot',
  10194. namingMethods: [ 'svgTitleText' ]
  10195. },
  10196. sub: {
  10197. contentTypes: [ 'phrasing', 'flow' ],
  10198. allowedRoles: true
  10199. },
  10200. summary: {
  10201. allowedRoles: false,
  10202. namingMethods: [ 'subtreeText' ]
  10203. },
  10204. sup: {
  10205. contentTypes: [ 'phrasing', 'flow' ],
  10206. allowedRoles: true
  10207. },
  10208. table: {
  10209. contentTypes: [ 'flow' ],
  10210. allowedRoles: true,
  10211. namingMethods: [ 'tableCaptionText', 'tableSummaryText' ]
  10212. },
  10213. tbody: {
  10214. allowedRoles: true
  10215. },
  10216. template: {
  10217. contentTypes: [ 'phrasing', 'flow' ],
  10218. allowedRoles: false,
  10219. noAriaAttrs: true
  10220. },
  10221. textarea: {
  10222. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  10223. allowedRoles: false,
  10224. implicitAttrs: {
  10225. 'aria-valuenow': '',
  10226. 'aria-multiline': 'true'
  10227. },
  10228. namingMethods: [ 'labelText', 'placeholderText' ]
  10229. },
  10230. tfoot: {
  10231. allowedRoles: true
  10232. },
  10233. thead: {
  10234. allowedRoles: true
  10235. },
  10236. time: {
  10237. contentTypes: [ 'phrasing', 'flow' ],
  10238. allowedRoles: true
  10239. },
  10240. title: {
  10241. allowedRoles: false,
  10242. noAriaAttrs: true
  10243. },
  10244. td: {
  10245. allowedRoles: true
  10246. },
  10247. th: {
  10248. allowedRoles: true
  10249. },
  10250. tr: {
  10251. allowedRoles: true
  10252. },
  10253. track: {
  10254. allowedRoles: false,
  10255. noAriaAttrs: true
  10256. },
  10257. u: {
  10258. contentTypes: [ 'phrasing', 'flow' ],
  10259. allowedRoles: true
  10260. },
  10261. ul: {
  10262. contentTypes: [ 'flow' ],
  10263. allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
  10264. },
  10265. var: {
  10266. contentTypes: [ 'phrasing', 'flow' ],
  10267. allowedRoles: true
  10268. },
  10269. video: {
  10270. variant: {
  10271. controls: {
  10272. matches: '[controls]',
  10273. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
  10274. },
  10275. default: {
  10276. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  10277. }
  10278. },
  10279. allowedRoles: [ 'application' ],
  10280. chromiumRole: 'video'
  10281. },
  10282. wbr: {
  10283. contentTypes: [ 'phrasing', 'flow' ],
  10284. allowedRoles: [ 'presentation', 'none' ]
  10285. }
  10286. };
  10287. var html_elms_default = htmlElms;
  10288. var cssColors = {
  10289. aliceblue: [ 240, 248, 255 ],
  10290. antiquewhite: [ 250, 235, 215 ],
  10291. aqua: [ 0, 255, 255 ],
  10292. aquamarine: [ 127, 255, 212 ],
  10293. azure: [ 240, 255, 255 ],
  10294. beige: [ 245, 245, 220 ],
  10295. bisque: [ 255, 228, 196 ],
  10296. black: [ 0, 0, 0 ],
  10297. blanchedalmond: [ 255, 235, 205 ],
  10298. blue: [ 0, 0, 255 ],
  10299. blueviolet: [ 138, 43, 226 ],
  10300. brown: [ 165, 42, 42 ],
  10301. burlywood: [ 222, 184, 135 ],
  10302. cadetblue: [ 95, 158, 160 ],
  10303. chartreuse: [ 127, 255, 0 ],
  10304. chocolate: [ 210, 105, 30 ],
  10305. coral: [ 255, 127, 80 ],
  10306. cornflowerblue: [ 100, 149, 237 ],
  10307. cornsilk: [ 255, 248, 220 ],
  10308. crimson: [ 220, 20, 60 ],
  10309. cyan: [ 0, 255, 255 ],
  10310. darkblue: [ 0, 0, 139 ],
  10311. darkcyan: [ 0, 139, 139 ],
  10312. darkgoldenrod: [ 184, 134, 11 ],
  10313. darkgray: [ 169, 169, 169 ],
  10314. darkgreen: [ 0, 100, 0 ],
  10315. darkgrey: [ 169, 169, 169 ],
  10316. darkkhaki: [ 189, 183, 107 ],
  10317. darkmagenta: [ 139, 0, 139 ],
  10318. darkolivegreen: [ 85, 107, 47 ],
  10319. darkorange: [ 255, 140, 0 ],
  10320. darkorchid: [ 153, 50, 204 ],
  10321. darkred: [ 139, 0, 0 ],
  10322. darksalmon: [ 233, 150, 122 ],
  10323. darkseagreen: [ 143, 188, 143 ],
  10324. darkslateblue: [ 72, 61, 139 ],
  10325. darkslategray: [ 47, 79, 79 ],
  10326. darkslategrey: [ 47, 79, 79 ],
  10327. darkturquoise: [ 0, 206, 209 ],
  10328. darkviolet: [ 148, 0, 211 ],
  10329. deeppink: [ 255, 20, 147 ],
  10330. deepskyblue: [ 0, 191, 255 ],
  10331. dimgray: [ 105, 105, 105 ],
  10332. dimgrey: [ 105, 105, 105 ],
  10333. dodgerblue: [ 30, 144, 255 ],
  10334. firebrick: [ 178, 34, 34 ],
  10335. floralwhite: [ 255, 250, 240 ],
  10336. forestgreen: [ 34, 139, 34 ],
  10337. fuchsia: [ 255, 0, 255 ],
  10338. gainsboro: [ 220, 220, 220 ],
  10339. ghostwhite: [ 248, 248, 255 ],
  10340. gold: [ 255, 215, 0 ],
  10341. goldenrod: [ 218, 165, 32 ],
  10342. gray: [ 128, 128, 128 ],
  10343. green: [ 0, 128, 0 ],
  10344. greenyellow: [ 173, 255, 47 ],
  10345. grey: [ 128, 128, 128 ],
  10346. honeydew: [ 240, 255, 240 ],
  10347. hotpink: [ 255, 105, 180 ],
  10348. indianred: [ 205, 92, 92 ],
  10349. indigo: [ 75, 0, 130 ],
  10350. ivory: [ 255, 255, 240 ],
  10351. khaki: [ 240, 230, 140 ],
  10352. lavender: [ 230, 230, 250 ],
  10353. lavenderblush: [ 255, 240, 245 ],
  10354. lawngreen: [ 124, 252, 0 ],
  10355. lemonchiffon: [ 255, 250, 205 ],
  10356. lightblue: [ 173, 216, 230 ],
  10357. lightcoral: [ 240, 128, 128 ],
  10358. lightcyan: [ 224, 255, 255 ],
  10359. lightgoldenrodyellow: [ 250, 250, 210 ],
  10360. lightgray: [ 211, 211, 211 ],
  10361. lightgreen: [ 144, 238, 144 ],
  10362. lightgrey: [ 211, 211, 211 ],
  10363. lightpink: [ 255, 182, 193 ],
  10364. lightsalmon: [ 255, 160, 122 ],
  10365. lightseagreen: [ 32, 178, 170 ],
  10366. lightskyblue: [ 135, 206, 250 ],
  10367. lightslategray: [ 119, 136, 153 ],
  10368. lightslategrey: [ 119, 136, 153 ],
  10369. lightsteelblue: [ 176, 196, 222 ],
  10370. lightyellow: [ 255, 255, 224 ],
  10371. lime: [ 0, 255, 0 ],
  10372. limegreen: [ 50, 205, 50 ],
  10373. linen: [ 250, 240, 230 ],
  10374. magenta: [ 255, 0, 255 ],
  10375. maroon: [ 128, 0, 0 ],
  10376. mediumaquamarine: [ 102, 205, 170 ],
  10377. mediumblue: [ 0, 0, 205 ],
  10378. mediumorchid: [ 186, 85, 211 ],
  10379. mediumpurple: [ 147, 112, 219 ],
  10380. mediumseagreen: [ 60, 179, 113 ],
  10381. mediumslateblue: [ 123, 104, 238 ],
  10382. mediumspringgreen: [ 0, 250, 154 ],
  10383. mediumturquoise: [ 72, 209, 204 ],
  10384. mediumvioletred: [ 199, 21, 133 ],
  10385. midnightblue: [ 25, 25, 112 ],
  10386. mintcream: [ 245, 255, 250 ],
  10387. mistyrose: [ 255, 228, 225 ],
  10388. moccasin: [ 255, 228, 181 ],
  10389. navajowhite: [ 255, 222, 173 ],
  10390. navy: [ 0, 0, 128 ],
  10391. oldlace: [ 253, 245, 230 ],
  10392. olive: [ 128, 128, 0 ],
  10393. olivedrab: [ 107, 142, 35 ],
  10394. orange: [ 255, 165, 0 ],
  10395. orangered: [ 255, 69, 0 ],
  10396. orchid: [ 218, 112, 214 ],
  10397. palegoldenrod: [ 238, 232, 170 ],
  10398. palegreen: [ 152, 251, 152 ],
  10399. paleturquoise: [ 175, 238, 238 ],
  10400. palevioletred: [ 219, 112, 147 ],
  10401. papayawhip: [ 255, 239, 213 ],
  10402. peachpuff: [ 255, 218, 185 ],
  10403. peru: [ 205, 133, 63 ],
  10404. pink: [ 255, 192, 203 ],
  10405. plum: [ 221, 160, 221 ],
  10406. powderblue: [ 176, 224, 230 ],
  10407. purple: [ 128, 0, 128 ],
  10408. rebeccapurple: [ 102, 51, 153 ],
  10409. red: [ 255, 0, 0 ],
  10410. rosybrown: [ 188, 143, 143 ],
  10411. royalblue: [ 65, 105, 225 ],
  10412. saddlebrown: [ 139, 69, 19 ],
  10413. salmon: [ 250, 128, 114 ],
  10414. sandybrown: [ 244, 164, 96 ],
  10415. seagreen: [ 46, 139, 87 ],
  10416. seashell: [ 255, 245, 238 ],
  10417. sienna: [ 160, 82, 45 ],
  10418. silver: [ 192, 192, 192 ],
  10419. skyblue: [ 135, 206, 235 ],
  10420. slateblue: [ 106, 90, 205 ],
  10421. slategray: [ 112, 128, 144 ],
  10422. slategrey: [ 112, 128, 144 ],
  10423. snow: [ 255, 250, 250 ],
  10424. springgreen: [ 0, 255, 127 ],
  10425. steelblue: [ 70, 130, 180 ],
  10426. tan: [ 210, 180, 140 ],
  10427. teal: [ 0, 128, 128 ],
  10428. thistle: [ 216, 191, 216 ],
  10429. tomato: [ 255, 99, 71 ],
  10430. turquoise: [ 64, 224, 208 ],
  10431. violet: [ 238, 130, 238 ],
  10432. wheat: [ 245, 222, 179 ],
  10433. white: [ 255, 255, 255 ],
  10434. whitesmoke: [ 245, 245, 245 ],
  10435. yellow: [ 255, 255, 0 ],
  10436. yellowgreen: [ 154, 205, 50 ]
  10437. };
  10438. var css_colors_default = cssColors;
  10439. var originals = {
  10440. ariaAttrs: aria_attrs_default,
  10441. ariaRoles: _extends({}, aria_roles_default, dpub_roles_default, graphics_roles_default),
  10442. htmlElms: html_elms_default,
  10443. cssColors: css_colors_default
  10444. };
  10445. var standards = _extends({}, originals);
  10446. function configureStandards(config) {
  10447. Object.keys(standards).forEach(function(propName) {
  10448. if (config[propName]) {
  10449. standards[propName] = deep_merge_default(standards[propName], config[propName]);
  10450. }
  10451. });
  10452. }
  10453. function resetStandards() {
  10454. Object.keys(standards).forEach(function(propName) {
  10455. standards[propName] = originals[propName];
  10456. });
  10457. }
  10458. var standards_default = standards;
  10459. function isUnsupportedRole(role) {
  10460. var roleDefinition = standards_default.ariaRoles[role];
  10461. return roleDefinition ? !!roleDefinition.unsupported : false;
  10462. }
  10463. var is_unsupported_role_default = isUnsupportedRole;
  10464. function isValidRole(role) {
  10465. var _ref26 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, allowAbstract = _ref26.allowAbstract, _ref26$flagUnsupporte = _ref26.flagUnsupported, flagUnsupported = _ref26$flagUnsupporte === void 0 ? false : _ref26$flagUnsupporte;
  10466. var roleDefinition = standards_default.ariaRoles[role];
  10467. var isRoleUnsupported = is_unsupported_role_default(role);
  10468. if (!roleDefinition || flagUnsupported && isRoleUnsupported) {
  10469. return false;
  10470. }
  10471. return allowAbstract ? true : roleDefinition.type !== 'abstract';
  10472. }
  10473. var is_valid_role_default = isValidRole;
  10474. function getExplicitRole(vNode) {
  10475. var _ref27 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, fallback = _ref27.fallback, abstracts = _ref27.abstracts, dpub = _ref27.dpub;
  10476. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  10477. if (vNode.props.nodeType !== 1) {
  10478. return null;
  10479. }
  10480. var roleAttr = (vNode.attr('role') || '').trim().toLowerCase();
  10481. var roleList = fallback ? token_list_default(roleAttr) : [ roleAttr ];
  10482. var firstValidRole = roleList.find(function(role) {
  10483. if (!dpub && role.substr(0, 4) === 'doc-') {
  10484. return false;
  10485. }
  10486. return is_valid_role_default(role, {
  10487. allowAbstract: abstracts
  10488. });
  10489. });
  10490. return firstValidRole || null;
  10491. }
  10492. var get_explicit_role_default = getExplicitRole;
  10493. function getElementsByContentType(type) {
  10494. return Object.keys(standards_default.htmlElms).filter(function(nodeName2) {
  10495. var elm = standards_default.htmlElms[nodeName2];
  10496. if (elm.contentTypes) {
  10497. return elm.contentTypes.includes(type);
  10498. }
  10499. if (!elm.variant) {
  10500. return false;
  10501. }
  10502. if (elm.variant['default'] && elm.variant['default'].contentTypes) {
  10503. return elm.variant['default'].contentTypes.includes(type);
  10504. }
  10505. return false;
  10506. });
  10507. }
  10508. var get_elements_by_content_type_default = getElementsByContentType;
  10509. function getGlobalAriaAttrs() {
  10510. return cache_default.get('globalAriaAttrs', function() {
  10511. return Object.keys(standards_default.ariaAttrs).filter(function(attrName) {
  10512. return standards_default.ariaAttrs[attrName].global;
  10513. });
  10514. });
  10515. }
  10516. var get_global_aria_attrs_default = getGlobalAriaAttrs;
  10517. function toGrid(node) {
  10518. var table = [];
  10519. var rows = node.rows;
  10520. for (var i = 0, rowLength = rows.length; i < rowLength; i++) {
  10521. var cells = rows[i].cells;
  10522. table[i] = table[i] || [];
  10523. var columnIndex = 0;
  10524. for (var j = 0, cellLength = cells.length; j < cellLength; j++) {
  10525. for (var colSpan = 0; colSpan < cells[j].colSpan; colSpan++) {
  10526. var rowspanAttr = cells[j].getAttribute('rowspan');
  10527. var rowspanValue = parseInt(rowspanAttr) === 0 || cells[j].rowspan === 0 ? rows.length : cells[j].rowSpan;
  10528. for (var rowSpan = 0; rowSpan < rowspanValue; rowSpan++) {
  10529. table[i + rowSpan] = table[i + rowSpan] || [];
  10530. while (table[i + rowSpan][columnIndex]) {
  10531. columnIndex++;
  10532. }
  10533. table[i + rowSpan][columnIndex] = cells[j];
  10534. }
  10535. columnIndex++;
  10536. }
  10537. }
  10538. }
  10539. return table;
  10540. }
  10541. var to_grid_default = memoize_default(toGrid);
  10542. function getCellPosition(cell, tableGrid) {
  10543. var rowIndex, index;
  10544. if (!tableGrid) {
  10545. tableGrid = to_grid_default(find_up_default(cell, 'table'));
  10546. }
  10547. for (rowIndex = 0; rowIndex < tableGrid.length; rowIndex++) {
  10548. if (tableGrid[rowIndex]) {
  10549. index = tableGrid[rowIndex].indexOf(cell);
  10550. if (index !== -1) {
  10551. return {
  10552. x: index,
  10553. y: rowIndex
  10554. };
  10555. }
  10556. }
  10557. }
  10558. }
  10559. var get_cell_position_default = memoize_default(getCellPosition);
  10560. function getScope(cell) {
  10561. var vNode = cell instanceof abstract_virtual_node_default ? cell : get_node_from_tree_default(cell);
  10562. cell = vNode.actualNode;
  10563. var scope = vNode.attr('scope');
  10564. var role = vNode.attr('role');
  10565. if (![ 'td', 'th' ].includes(vNode.props.nodeName)) {
  10566. throw new TypeError('Expected TD or TH element');
  10567. }
  10568. if (role === 'columnheader') {
  10569. return 'col';
  10570. } else if (role === 'rowheader') {
  10571. return 'row';
  10572. } else if (scope === 'col' || scope === 'row') {
  10573. return scope;
  10574. } else if (vNode.props.nodeName !== 'th') {
  10575. return false;
  10576. } else if (!vNode.actualNode) {
  10577. return 'auto';
  10578. }
  10579. var tableGrid = to_grid_default(find_up_default(cell, 'table'));
  10580. var pos = get_cell_position_default(cell, tableGrid);
  10581. var headerRow = tableGrid[pos.y].reduce(function(headerRow2, cell2) {
  10582. return headerRow2 && cell2.nodeName.toUpperCase() === 'TH';
  10583. }, true);
  10584. if (headerRow) {
  10585. return 'col';
  10586. }
  10587. var headerCol = tableGrid.map(function(col) {
  10588. return col[pos.x];
  10589. }).reduce(function(headerCol2, cell2) {
  10590. return headerCol2 && cell2 && cell2.nodeName.toUpperCase() === 'TH';
  10591. }, true);
  10592. if (headerCol) {
  10593. return 'row';
  10594. }
  10595. return 'auto';
  10596. }
  10597. var get_scope_default = getScope;
  10598. function isColumnHeader(element) {
  10599. return [ 'col', 'auto' ].indexOf(get_scope_default(element)) !== -1;
  10600. }
  10601. var is_column_header_default = isColumnHeader;
  10602. function isRowHeader(cell) {
  10603. return [ 'row', 'auto' ].includes(get_scope_default(cell));
  10604. }
  10605. var is_row_header_default = isRowHeader;
  10606. function sanitize(str) {
  10607. if (!str) {
  10608. return '';
  10609. }
  10610. return str.replace(/\r\n/g, '\n').replace(/\u00A0/g, ' ').replace(/[\s]{2,}/g, ' ').trim();
  10611. }
  10612. var sanitize_default = sanitize;
  10613. function isNativelyFocusable(el) {
  10614. var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
  10615. if (!vNode || focus_disabled_default(vNode)) {
  10616. return false;
  10617. }
  10618. switch (vNode.props.nodeName) {
  10619. case 'a':
  10620. case 'area':
  10621. if (vNode.hasAttr('href')) {
  10622. return true;
  10623. }
  10624. break;
  10625. case 'input':
  10626. return vNode.props.type !== 'hidden';
  10627. case 'textarea':
  10628. case 'select':
  10629. case 'summary':
  10630. case 'button':
  10631. return true;
  10632. case 'details':
  10633. return !query_selector_all_default(vNode, 'summary').length;
  10634. }
  10635. return false;
  10636. }
  10637. var is_natively_focusable_default = isNativelyFocusable;
  10638. function _isFocusable(el) {
  10639. var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
  10640. if (vNode.props.nodeType !== 1) {
  10641. return false;
  10642. }
  10643. if (focus_disabled_default(vNode)) {
  10644. return false;
  10645. } else if (is_natively_focusable_default(vNode)) {
  10646. return true;
  10647. }
  10648. var tabindex = vNode.attr('tabindex');
  10649. if (tabindex && !isNaN(parseInt(tabindex, 10))) {
  10650. return true;
  10651. }
  10652. return false;
  10653. }
  10654. var sectioningElementSelector = get_elements_by_content_type_default('sectioning').map(function(nodeName2) {
  10655. return ''.concat(nodeName2, ':not([role])');
  10656. }).join(', ') + ' , main:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]';
  10657. function hasAccessibleName(vNode) {
  10658. var ariaLabelledby = sanitize_default(arialabelledby_text_default(vNode));
  10659. var ariaLabel = sanitize_default(arialabel_text_default(vNode));
  10660. return !!(ariaLabelledby || ariaLabel);
  10661. }
  10662. var implicitHtmlRoles = {
  10663. a: function a(vNode) {
  10664. return vNode.hasAttr('href') ? 'link' : null;
  10665. },
  10666. area: function area(vNode) {
  10667. return vNode.hasAttr('href') ? 'link' : null;
  10668. },
  10669. article: 'article',
  10670. aside: 'complementary',
  10671. body: 'document',
  10672. button: 'button',
  10673. datalist: 'listbox',
  10674. dd: 'definition',
  10675. dfn: 'term',
  10676. details: 'group',
  10677. dialog: 'dialog',
  10678. dt: 'term',
  10679. fieldset: 'group',
  10680. figure: 'figure',
  10681. footer: function footer(vNode) {
  10682. var sectioningElement = closest_default(vNode, sectioningElementSelector);
  10683. return !sectioningElement ? 'contentinfo' : null;
  10684. },
  10685. form: function form(vNode) {
  10686. return hasAccessibleName(vNode) ? 'form' : null;
  10687. },
  10688. h1: 'heading',
  10689. h2: 'heading',
  10690. h3: 'heading',
  10691. h4: 'heading',
  10692. h5: 'heading',
  10693. h6: 'heading',
  10694. header: function header(vNode) {
  10695. var sectioningElement = closest_default(vNode, sectioningElementSelector);
  10696. return !sectioningElement ? 'banner' : null;
  10697. },
  10698. hr: 'separator',
  10699. img: function img(vNode) {
  10700. var emptyAlt = vNode.hasAttr('alt') && !vNode.attr('alt');
  10701. var hasGlobalAria = get_global_aria_attrs_default().find(function(attr) {
  10702. return vNode.hasAttr(attr);
  10703. });
  10704. return emptyAlt && !hasGlobalAria && !_isFocusable(vNode) ? 'presentation' : 'img';
  10705. },
  10706. input: function input(vNode) {
  10707. var suggestionsSourceElement;
  10708. if (vNode.hasAttr('list')) {
  10709. var listElement = idrefs_default(vNode.actualNode, 'list').filter(function(node) {
  10710. return !!node;
  10711. })[0];
  10712. suggestionsSourceElement = listElement && listElement.nodeName.toLowerCase() === 'datalist';
  10713. }
  10714. switch (vNode.props.type) {
  10715. case 'checkbox':
  10716. return 'checkbox';
  10717. case 'number':
  10718. return 'spinbutton';
  10719. case 'radio':
  10720. return 'radio';
  10721. case 'range':
  10722. return 'slider';
  10723. case 'search':
  10724. return !suggestionsSourceElement ? 'searchbox' : 'combobox';
  10725. case 'button':
  10726. case 'image':
  10727. case 'reset':
  10728. case 'submit':
  10729. return 'button';
  10730. case 'text':
  10731. case 'tel':
  10732. case 'url':
  10733. case 'email':
  10734. case '':
  10735. return !suggestionsSourceElement ? 'textbox' : 'combobox';
  10736. default:
  10737. return 'textbox';
  10738. }
  10739. },
  10740. li: 'listitem',
  10741. main: 'main',
  10742. math: 'math',
  10743. menu: 'list',
  10744. nav: 'navigation',
  10745. ol: 'list',
  10746. optgroup: 'group',
  10747. option: 'option',
  10748. output: 'status',
  10749. progress: 'progressbar',
  10750. section: function section(vNode) {
  10751. return hasAccessibleName(vNode) ? 'region' : null;
  10752. },
  10753. select: function select(vNode) {
  10754. return vNode.hasAttr('multiple') || parseInt(vNode.attr('size')) > 1 ? 'listbox' : 'combobox';
  10755. },
  10756. summary: 'button',
  10757. table: 'table',
  10758. tbody: 'rowgroup',
  10759. td: function td(vNode) {
  10760. var table = closest_default(vNode, 'table');
  10761. var role = get_explicit_role_default(table);
  10762. return [ 'grid', 'treegrid' ].includes(role) ? 'gridcell' : 'cell';
  10763. },
  10764. textarea: 'textbox',
  10765. tfoot: 'rowgroup',
  10766. th: function th(vNode) {
  10767. if (is_column_header_default(vNode)) {
  10768. return 'columnheader';
  10769. }
  10770. if (is_row_header_default(vNode)) {
  10771. return 'rowheader';
  10772. }
  10773. },
  10774. thead: 'rowgroup',
  10775. tr: 'row',
  10776. ul: 'list'
  10777. };
  10778. var implicit_html_roles_default = implicitHtmlRoles;
  10779. function fromPrimative(someString, matcher) {
  10780. var matcherType = _typeof(matcher);
  10781. if (Array.isArray(matcher) && typeof someString !== 'undefined') {
  10782. return matcher.includes(someString);
  10783. }
  10784. if (matcherType === 'function') {
  10785. return !!matcher(someString);
  10786. }
  10787. if (someString !== null && someString !== void 0) {
  10788. if (matcher instanceof RegExp) {
  10789. return matcher.test(someString);
  10790. }
  10791. if (/^\/.*\/$/.test(matcher)) {
  10792. var pattern = matcher.substring(1, matcher.length - 1);
  10793. return new RegExp(pattern).test(someString);
  10794. }
  10795. }
  10796. return matcher === someString;
  10797. }
  10798. var from_primative_default = fromPrimative;
  10799. function hasAccessibleName2(vNode, matcher) {
  10800. return from_primative_default(!!accessible_text_virtual_default(vNode), matcher);
  10801. }
  10802. var has_accessible_name_default = hasAccessibleName2;
  10803. function fromFunction(getValue, matcher) {
  10804. var matcherType = _typeof(matcher);
  10805. if (matcherType !== 'object' || Array.isArray(matcher) || matcher instanceof RegExp) {
  10806. throw new Error('Expect matcher to be an object');
  10807. }
  10808. return Object.keys(matcher).every(function(propName) {
  10809. return from_primative_default(getValue(propName), matcher[propName]);
  10810. });
  10811. }
  10812. var from_function_default = fromFunction;
  10813. function attributes(vNode, matcher) {
  10814. if (!(vNode instanceof abstract_virtual_node_default)) {
  10815. vNode = get_node_from_tree_default(vNode);
  10816. }
  10817. return from_function_default(function(attrName) {
  10818. return vNode.attr(attrName);
  10819. }, matcher);
  10820. }
  10821. var attributes_default = attributes;
  10822. function condition(arg, condition2) {
  10823. return !!condition2(arg);
  10824. }
  10825. var condition_default = condition;
  10826. function explicitRole(vNode, matcher) {
  10827. return from_primative_default(get_explicit_role_default(vNode), matcher);
  10828. }
  10829. var explicit_role_default = explicitRole;
  10830. function implicitRole(vNode, matcher) {
  10831. return from_primative_default(implicit_role_default(vNode), matcher);
  10832. }
  10833. var implicit_role_default2 = implicitRole;
  10834. function nodeName(vNode, matcher) {
  10835. if (!(vNode instanceof abstract_virtual_node_default)) {
  10836. vNode = get_node_from_tree_default(vNode);
  10837. }
  10838. return from_primative_default(vNode.props.nodeName, matcher);
  10839. }
  10840. var node_name_default = nodeName;
  10841. function properties(vNode, matcher) {
  10842. if (!(vNode instanceof abstract_virtual_node_default)) {
  10843. vNode = get_node_from_tree_default(vNode);
  10844. }
  10845. return from_function_default(function(propName) {
  10846. return vNode.props[propName];
  10847. }, matcher);
  10848. }
  10849. var properties_default = properties;
  10850. function semanticRole(vNode, matcher) {
  10851. return from_primative_default(get_role_default(vNode), matcher);
  10852. }
  10853. var semantic_role_default = semanticRole;
  10854. var matchers = {
  10855. hasAccessibleName: has_accessible_name_default,
  10856. attributes: attributes_default,
  10857. condition: condition_default,
  10858. explicitRole: explicit_role_default,
  10859. implicitRole: implicit_role_default2,
  10860. nodeName: node_name_default,
  10861. properties: properties_default,
  10862. semanticRole: semantic_role_default
  10863. };
  10864. function fromDefinition(vNode, definition) {
  10865. if (!(vNode instanceof abstract_virtual_node_default)) {
  10866. vNode = get_node_from_tree_default(vNode);
  10867. }
  10868. if (Array.isArray(definition)) {
  10869. return definition.some(function(definitionItem) {
  10870. return fromDefinition(vNode, definitionItem);
  10871. });
  10872. }
  10873. if (typeof definition === 'string') {
  10874. return matches_default(vNode, definition);
  10875. }
  10876. return Object.keys(definition).every(function(matcherName) {
  10877. if (!matchers[matcherName]) {
  10878. throw new Error('Unknown matcher type "'.concat(matcherName, '"'));
  10879. }
  10880. var matchMethod = matchers[matcherName];
  10881. var matcher = definition[matcherName];
  10882. return matchMethod(vNode, matcher);
  10883. });
  10884. }
  10885. var from_definition_default = fromDefinition;
  10886. function matches2(vNode, definition) {
  10887. return from_definition_default(vNode, definition);
  10888. }
  10889. var matches_default2 = matches2;
  10890. matches_default2.hasAccessibleName = has_accessible_name_default;
  10891. matches_default2.attributes = attributes_default;
  10892. matches_default2.condition = condition_default;
  10893. matches_default2.explicitRole = explicit_role_default;
  10894. matches_default2.fromDefinition = from_definition_default;
  10895. matches_default2.fromFunction = from_function_default;
  10896. matches_default2.fromPrimative = from_primative_default;
  10897. matches_default2.implicitRole = implicit_role_default2;
  10898. matches_default2.nodeName = node_name_default;
  10899. matches_default2.properties = properties_default;
  10900. matches_default2.semanticRole = semantic_role_default;
  10901. var matches_default3 = matches_default2;
  10902. function getElementSpec(vNode) {
  10903. var _ref28 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref28$noMatchAccessi = _ref28.noMatchAccessibleName, noMatchAccessibleName = _ref28$noMatchAccessi === void 0 ? false : _ref28$noMatchAccessi;
  10904. var standard = standards_default.htmlElms[vNode.props.nodeName];
  10905. if (!standard) {
  10906. return {};
  10907. }
  10908. if (!standard.variant) {
  10909. return standard;
  10910. }
  10911. var variant = standard.variant, spec = _objectWithoutProperties(standard, _excluded2);
  10912. for (var variantName in variant) {
  10913. if (!variant.hasOwnProperty(variantName) || variantName === 'default') {
  10914. continue;
  10915. }
  10916. var _variant$variantName = variant[variantName], matches4 = _variant$variantName.matches, props = _objectWithoutProperties(_variant$variantName, _excluded3);
  10917. var matchProperties = Array.isArray(matches4) ? matches4 : [ matches4 ];
  10918. for (var _i8 = 0; _i8 < matchProperties.length && noMatchAccessibleName; _i8++) {
  10919. if (matchProperties[_i8].hasOwnProperty('hasAccessibleName')) {
  10920. return standard;
  10921. }
  10922. }
  10923. if (matches_default3(vNode, matches4)) {
  10924. for (var propName in props) {
  10925. if (props.hasOwnProperty(propName)) {
  10926. spec[propName] = props[propName];
  10927. }
  10928. }
  10929. }
  10930. }
  10931. for (var _propName in variant['default']) {
  10932. if (variant['default'].hasOwnProperty(_propName) && typeof spec[_propName] === 'undefined') {
  10933. spec[_propName] = variant['default'][_propName];
  10934. }
  10935. }
  10936. return spec;
  10937. }
  10938. var get_element_spec_default = getElementSpec;
  10939. function implicitRole2(node) {
  10940. var _ref29 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, chromium = _ref29.chromium;
  10941. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  10942. node = vNode.actualNode;
  10943. if (!vNode) {
  10944. throw new ReferenceError('Cannot get implicit role of a node outside the current scope.');
  10945. }
  10946. var nodeName2 = vNode.props.nodeName;
  10947. var role = implicit_html_roles_default[nodeName2];
  10948. if (!role && chromium) {
  10949. var _get_element_spec_def = get_element_spec_default(vNode), chromiumRole = _get_element_spec_def.chromiumRole;
  10950. return chromiumRole || null;
  10951. }
  10952. if (typeof role === 'function') {
  10953. return role(vNode);
  10954. }
  10955. return role || null;
  10956. }
  10957. var implicit_role_default = implicitRole2;
  10958. var inheritsPresentationChain = {
  10959. td: [ 'tr' ],
  10960. th: [ 'tr' ],
  10961. tr: [ 'thead', 'tbody', 'tfoot', 'table' ],
  10962. thead: [ 'table' ],
  10963. tbody: [ 'table' ],
  10964. tfoot: [ 'table' ],
  10965. li: [ 'ol', 'ul' ],
  10966. dt: [ 'dl', 'div' ],
  10967. dd: [ 'dl', 'div' ],
  10968. div: [ 'dl' ]
  10969. };
  10970. function getInheritedRole(vNode, explicitRoleOptions) {
  10971. var parentNodeNames = inheritsPresentationChain[vNode.props.nodeName];
  10972. if (!parentNodeNames) {
  10973. return null;
  10974. }
  10975. if (!vNode.parent) {
  10976. if (!vNode.actualNode) {
  10977. return null;
  10978. }
  10979. throw new ReferenceError('Cannot determine role presentational inheritance of a required parent outside the current scope.');
  10980. }
  10981. if (!parentNodeNames.includes(vNode.parent.props.nodeName)) {
  10982. return null;
  10983. }
  10984. var parentRole = get_explicit_role_default(vNode.parent, explicitRoleOptions);
  10985. if ([ 'none', 'presentation' ].includes(parentRole) && !hasConflictResolution(vNode.parent)) {
  10986. return parentRole;
  10987. }
  10988. if (parentRole) {
  10989. return null;
  10990. }
  10991. return getInheritedRole(vNode.parent, explicitRoleOptions);
  10992. }
  10993. function resolveImplicitRole(vNode, _ref30) {
  10994. var chromium = _ref30.chromium, explicitRoleOptions = _objectWithoutProperties(_ref30, _excluded4);
  10995. var implicitRole3 = implicit_role_default(vNode, {
  10996. chromium: chromium
  10997. });
  10998. if (!implicitRole3) {
  10999. return null;
  11000. }
  11001. var presentationalRole = getInheritedRole(vNode, explicitRoleOptions);
  11002. if (presentationalRole) {
  11003. return presentationalRole;
  11004. }
  11005. return implicitRole3;
  11006. }
  11007. function hasConflictResolution(vNode) {
  11008. var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) {
  11009. return vNode.hasAttr(attr);
  11010. });
  11011. return hasGlobalAria || _isFocusable(vNode);
  11012. }
  11013. function resolveRole(node) {
  11014. var _ref31 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11015. var noImplicit = _ref31.noImplicit, roleOptions = _objectWithoutProperties(_ref31, _excluded5);
  11016. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11017. if (vNode.props.nodeType !== 1) {
  11018. return null;
  11019. }
  11020. var explicitRole2 = get_explicit_role_default(vNode, roleOptions);
  11021. if (!explicitRole2) {
  11022. return noImplicit ? null : resolveImplicitRole(vNode, roleOptions);
  11023. }
  11024. if (![ 'presentation', 'none' ].includes(explicitRole2)) {
  11025. return explicitRole2;
  11026. }
  11027. if (hasConflictResolution(vNode)) {
  11028. return noImplicit ? null : resolveImplicitRole(vNode, roleOptions);
  11029. }
  11030. return explicitRole2;
  11031. }
  11032. function getRole(node) {
  11033. var _ref32 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11034. var noPresentational = _ref32.noPresentational, options = _objectWithoutProperties(_ref32, _excluded6);
  11035. var role = resolveRole(node, options);
  11036. if (noPresentational && [ 'presentation', 'none' ].includes(role)) {
  11037. return null;
  11038. }
  11039. return role;
  11040. }
  11041. var get_role_default = getRole;
  11042. var alwaysTitleElements = [ 'iframe' ];
  11043. function titleText(node) {
  11044. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11045. if (vNode.props.nodeType !== 1 || !node.hasAttr('title')) {
  11046. return '';
  11047. }
  11048. if (!matches_default2(vNode, alwaysTitleElements) && [ 'none', 'presentation' ].includes(get_role_default(vNode))) {
  11049. return '';
  11050. }
  11051. return vNode.attr('title');
  11052. }
  11053. var title_text_default = titleText;
  11054. function namedFromContents(vNode) {
  11055. var _ref33 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, strict = _ref33.strict;
  11056. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  11057. if (vNode.props.nodeType !== 1) {
  11058. return false;
  11059. }
  11060. var role = get_role_default(vNode);
  11061. var roleDef = standards_default.ariaRoles[role];
  11062. if (roleDef && roleDef.nameFromContent) {
  11063. return true;
  11064. }
  11065. if (strict) {
  11066. return false;
  11067. }
  11068. return !roleDef || [ 'presentation', 'none' ].includes(role);
  11069. }
  11070. var named_from_contents_default = namedFromContents;
  11071. function getOwnedVirtual(virtualNode) {
  11072. var actualNode = virtualNode.actualNode, children = virtualNode.children;
  11073. if (!children) {
  11074. throw new Error('getOwnedVirtual requires a virtual node');
  11075. }
  11076. if (virtualNode.hasAttr('aria-owns')) {
  11077. var owns = idrefs_default(actualNode, 'aria-owns').filter(function(element) {
  11078. return !!element;
  11079. }).map(function(element) {
  11080. return axe.utils.getNodeFromTree(element);
  11081. });
  11082. return [].concat(_toConsumableArray(children), _toConsumableArray(owns));
  11083. }
  11084. return _toConsumableArray(children);
  11085. }
  11086. var get_owned_virtual_default = getOwnedVirtual;
  11087. function subtreeText(virtualNode) {
  11088. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11089. var alreadyProcessed2 = accessible_text_virtual_default.alreadyProcessed;
  11090. context.startNode = context.startNode || virtualNode;
  11091. var _context = context, strict = _context.strict, inControlContext = _context.inControlContext, inLabelledByContext = _context.inLabelledByContext;
  11092. var _get_element_spec_def2 = get_element_spec_default(virtualNode, {
  11093. noMatchAccessibleName: true
  11094. }), contentTypes = _get_element_spec_def2.contentTypes;
  11095. if (alreadyProcessed2(virtualNode, context) || virtualNode.props.nodeType !== 1 || contentTypes !== null && contentTypes !== void 0 && contentTypes.includes('embedded')) {
  11096. return '';
  11097. }
  11098. if (!named_from_contents_default(virtualNode, {
  11099. strict: strict
  11100. }) && !context.subtreeDescendant) {
  11101. return '';
  11102. }
  11103. if (!strict) {
  11104. var subtreeDescendant = !inControlContext && !inLabelledByContext;
  11105. context = _extends({
  11106. subtreeDescendant: subtreeDescendant
  11107. }, context);
  11108. }
  11109. return get_owned_virtual_default(virtualNode).reduce(function(contentText, child) {
  11110. return appendAccessibleText(contentText, child, context);
  11111. }, '');
  11112. }
  11113. var phrasingElements = get_elements_by_content_type_default('phrasing').concat([ '#text' ]);
  11114. function appendAccessibleText(contentText, virtualNode, context) {
  11115. var nodeName2 = virtualNode.props.nodeName;
  11116. var contentTextAdd = accessible_text_virtual_default(virtualNode, context);
  11117. if (!contentTextAdd) {
  11118. return contentText;
  11119. }
  11120. if (!phrasingElements.includes(nodeName2)) {
  11121. if (contentTextAdd[0] !== ' ') {
  11122. contentTextAdd += ' ';
  11123. }
  11124. if (contentText && contentText[contentText.length - 1] !== ' ') {
  11125. contentTextAdd = ' ' + contentTextAdd;
  11126. }
  11127. }
  11128. return contentText + contentTextAdd;
  11129. }
  11130. var subtree_text_default = subtreeText;
  11131. function labelText(virtualNode) {
  11132. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11133. var alreadyProcessed2 = accessible_text_virtual_default.alreadyProcessed;
  11134. if (context.inControlContext || context.inLabelledByContext || alreadyProcessed2(virtualNode, context)) {
  11135. return '';
  11136. }
  11137. if (!context.startNode) {
  11138. context.startNode = virtualNode;
  11139. }
  11140. var labelContext = _extends({
  11141. inControlContext: true
  11142. }, context);
  11143. var explicitLabels = getExplicitLabels(virtualNode);
  11144. var implicitLabel = closest_default(virtualNode, 'label');
  11145. var labels;
  11146. if (implicitLabel) {
  11147. labels = [].concat(_toConsumableArray(explicitLabels), [ implicitLabel.actualNode ]);
  11148. labels.sort(node_sorter_default);
  11149. } else {
  11150. labels = explicitLabels;
  11151. }
  11152. return labels.map(function(label3) {
  11153. return accessible_text_default(label3, labelContext);
  11154. }).filter(function(text) {
  11155. return text !== '';
  11156. }).join(' ');
  11157. }
  11158. function getExplicitLabels(virtualNode) {
  11159. if (!virtualNode.attr('id')) {
  11160. return [];
  11161. }
  11162. if (!virtualNode.actualNode) {
  11163. throw new TypeError('Cannot resolve explicit label reference for non-DOM nodes');
  11164. }
  11165. return find_elms_in_context_default({
  11166. elm: 'label',
  11167. attr: 'for',
  11168. value: virtualNode.attr('id'),
  11169. context: virtualNode.actualNode
  11170. });
  11171. }
  11172. var label_text_default = labelText;
  11173. var defaultButtonValues = {
  11174. submit: 'Submit',
  11175. image: 'Submit',
  11176. reset: 'Reset',
  11177. button: ''
  11178. };
  11179. var nativeTextMethods = {
  11180. valueText: function valueText(_ref34) {
  11181. var actualNode = _ref34.actualNode;
  11182. return actualNode.value || '';
  11183. },
  11184. buttonDefaultText: function buttonDefaultText(_ref35) {
  11185. var actualNode = _ref35.actualNode;
  11186. return defaultButtonValues[actualNode.type] || '';
  11187. },
  11188. tableCaptionText: descendantText.bind(null, 'caption'),
  11189. figureText: descendantText.bind(null, 'figcaption'),
  11190. svgTitleText: descendantText.bind(null, 'title'),
  11191. fieldsetLegendText: descendantText.bind(null, 'legend'),
  11192. altText: attrText.bind(null, 'alt'),
  11193. tableSummaryText: attrText.bind(null, 'summary'),
  11194. titleText: title_text_default,
  11195. subtreeText: subtree_text_default,
  11196. labelText: label_text_default,
  11197. singleSpace: function singleSpace() {
  11198. return ' ';
  11199. },
  11200. placeholderText: attrText.bind(null, 'placeholder')
  11201. };
  11202. function attrText(attr, vNode) {
  11203. return vNode.attr(attr) || '';
  11204. }
  11205. function descendantText(nodeName2, _ref36, context) {
  11206. var actualNode = _ref36.actualNode;
  11207. nodeName2 = nodeName2.toLowerCase();
  11208. var nodeNames2 = [ nodeName2, actualNode.nodeName.toLowerCase() ].join(',');
  11209. var candidate = actualNode.querySelector(nodeNames2);
  11210. if (!candidate || candidate.nodeName.toLowerCase() !== nodeName2) {
  11211. return '';
  11212. }
  11213. return accessible_text_default(candidate, context);
  11214. }
  11215. var native_text_methods_default = nativeTextMethods;
  11216. function nativeTextAlternative(virtualNode) {
  11217. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11218. var actualNode = virtualNode.actualNode;
  11219. if (virtualNode.props.nodeType !== 1 || [ 'presentation', 'none' ].includes(get_role_default(virtualNode))) {
  11220. return '';
  11221. }
  11222. var textMethods = findTextMethods(virtualNode);
  11223. var accName = textMethods.reduce(function(accName2, step) {
  11224. return accName2 || step(virtualNode, context);
  11225. }, '');
  11226. if (context.debug) {
  11227. axe.log(accName || '{empty-value}', actualNode, context);
  11228. }
  11229. return accName;
  11230. }
  11231. function findTextMethods(virtualNode) {
  11232. var elmSpec = get_element_spec_default(virtualNode, {
  11233. noMatchAccessibleName: true
  11234. });
  11235. var methods = elmSpec.namingMethods || [];
  11236. return methods.map(function(methodName) {
  11237. return native_text_methods_default[methodName];
  11238. });
  11239. }
  11240. var native_text_alternative_default = nativeTextAlternative;
  11241. var unsupported = {
  11242. accessibleNameFromFieldValue: [ 'combobox', 'listbox', 'progressbar' ]
  11243. };
  11244. var unsupported_default = unsupported;
  11245. function _isVisibleToScreenReaders(vNode) {
  11246. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  11247. return isVisibleToScreenReadersVirtual(vNode);
  11248. }
  11249. var isVisibleToScreenReadersVirtual = memoize_default(function isVisibleToScreenReadersMemoized(vNode, isAncestor) {
  11250. if (ariaHidden(vNode) || _isInert(vNode, {
  11251. skipAncestors: true,
  11252. isAncestor: isAncestor
  11253. })) {
  11254. return false;
  11255. }
  11256. if (vNode.actualNode && vNode.props.nodeName === 'area') {
  11257. return !areaHidden(vNode, isVisibleToScreenReadersVirtual);
  11258. }
  11259. if (_isHiddenForEveryone(vNode, {
  11260. skipAncestors: true,
  11261. isAncestor: isAncestor
  11262. })) {
  11263. return false;
  11264. }
  11265. if (!vNode.parent) {
  11266. return true;
  11267. }
  11268. return isVisibleToScreenReadersVirtual(vNode.parent, true);
  11269. });
  11270. function visibleVirtual(element, screenReader, noRecursing) {
  11271. var vNode = element instanceof abstract_virtual_node_default ? element : get_node_from_tree_default(element);
  11272. var visibleMethod = screenReader ? _isVisibleToScreenReaders : _isVisibleOnScreen;
  11273. var visible2 = !element.actualNode || element.actualNode && visibleMethod(element);
  11274. var result = vNode.children.map(function(child) {
  11275. var _child$props = child.props, nodeType = _child$props.nodeType, nodeValue = _child$props.nodeValue;
  11276. if (nodeType === 3) {
  11277. if (nodeValue && visible2) {
  11278. return nodeValue;
  11279. }
  11280. } else if (!noRecursing) {
  11281. return visibleVirtual(child, screenReader);
  11282. }
  11283. }).join('');
  11284. return sanitize_default(result);
  11285. }
  11286. var visible_virtual_default = visibleVirtual;
  11287. var nonTextInputTypes = [ 'button', 'checkbox', 'color', 'file', 'hidden', 'image', 'password', 'radio', 'reset', 'submit' ];
  11288. function isNativeTextbox(node) {
  11289. node = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11290. var nodeName2 = node.props.nodeName;
  11291. return nodeName2 === 'textarea' || nodeName2 === 'input' && !nonTextInputTypes.includes((node.attr('type') || '').toLowerCase());
  11292. }
  11293. var is_native_textbox_default = isNativeTextbox;
  11294. function isNativeSelect(node) {
  11295. node = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11296. var nodeName2 = node.props.nodeName;
  11297. return nodeName2 === 'select';
  11298. }
  11299. var is_native_select_default = isNativeSelect;
  11300. function isAriaTextbox(node) {
  11301. var role = get_explicit_role_default(node);
  11302. return role === 'textbox';
  11303. }
  11304. var is_aria_textbox_default = isAriaTextbox;
  11305. function isAriaListbox(node) {
  11306. var role = get_explicit_role_default(node);
  11307. return role === 'listbox';
  11308. }
  11309. var is_aria_listbox_default = isAriaListbox;
  11310. function isAriaCombobox(node) {
  11311. var role = get_explicit_role_default(node);
  11312. return role === 'combobox';
  11313. }
  11314. var is_aria_combobox_default = isAriaCombobox;
  11315. var rangeRoles = [ 'progressbar', 'scrollbar', 'slider', 'spinbutton' ];
  11316. function isAriaRange(node) {
  11317. var role = get_explicit_role_default(node);
  11318. return rangeRoles.includes(role);
  11319. }
  11320. var is_aria_range_default = isAriaRange;
  11321. var controlValueRoles = [ 'textbox', 'progressbar', 'scrollbar', 'slider', 'spinbutton', 'combobox', 'listbox' ];
  11322. var _formControlValueMethods = {
  11323. nativeTextboxValue: nativeTextboxValue,
  11324. nativeSelectValue: nativeSelectValue,
  11325. ariaTextboxValue: ariaTextboxValue,
  11326. ariaListboxValue: ariaListboxValue,
  11327. ariaComboboxValue: ariaComboboxValue,
  11328. ariaRangeValue: ariaRangeValue
  11329. };
  11330. function formControlValue(virtualNode) {
  11331. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11332. var actualNode = virtualNode.actualNode;
  11333. var unsupportedRoles = unsupported_default.accessibleNameFromFieldValue || [];
  11334. var role = get_role_default(virtualNode);
  11335. if (context.startNode === virtualNode || !controlValueRoles.includes(role) || unsupportedRoles.includes(role)) {
  11336. return '';
  11337. }
  11338. var valueMethods = Object.keys(_formControlValueMethods).map(function(name) {
  11339. return _formControlValueMethods[name];
  11340. });
  11341. var valueString = valueMethods.reduce(function(accName, step) {
  11342. return accName || step(virtualNode, context);
  11343. }, '');
  11344. if (context.debug) {
  11345. log_default(valueString || '{empty-value}', actualNode, context);
  11346. }
  11347. return valueString;
  11348. }
  11349. function nativeTextboxValue(node) {
  11350. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11351. if (is_native_textbox_default(vNode)) {
  11352. return vNode.props.value || '';
  11353. }
  11354. return '';
  11355. }
  11356. function nativeSelectValue(node) {
  11357. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11358. if (!is_native_select_default(vNode)) {
  11359. return '';
  11360. }
  11361. var options = query_selector_all_default(vNode, 'option');
  11362. var selectedOptions = options.filter(function(option) {
  11363. return option.props.selected;
  11364. });
  11365. if (!selectedOptions.length) {
  11366. selectedOptions.push(options[0]);
  11367. }
  11368. return selectedOptions.map(function(option) {
  11369. return visible_virtual_default(option);
  11370. }).join(' ') || '';
  11371. }
  11372. function ariaTextboxValue(node) {
  11373. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11374. var actualNode = vNode.actualNode;
  11375. if (!is_aria_textbox_default(vNode)) {
  11376. return '';
  11377. }
  11378. if (!actualNode || actualNode && !_isHiddenForEveryone(actualNode)) {
  11379. return visible_virtual_default(vNode, true);
  11380. } else {
  11381. return actualNode.textContent;
  11382. }
  11383. }
  11384. function ariaListboxValue(node, context) {
  11385. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11386. if (!is_aria_listbox_default(vNode)) {
  11387. return '';
  11388. }
  11389. var selected = get_owned_virtual_default(vNode).filter(function(owned) {
  11390. return get_role_default(owned) === 'option' && owned.attr('aria-selected') === 'true';
  11391. });
  11392. if (selected.length === 0) {
  11393. return '';
  11394. }
  11395. return accessible_text_virtual_default(selected[0], context);
  11396. }
  11397. function ariaComboboxValue(node, context) {
  11398. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11399. if (!is_aria_combobox_default(vNode)) {
  11400. return '';
  11401. }
  11402. var listbox = get_owned_virtual_default(vNode).filter(function(elm) {
  11403. return get_role_default(elm) === 'listbox';
  11404. })[0];
  11405. return listbox ? ariaListboxValue(listbox, context) : '';
  11406. }
  11407. function ariaRangeValue(node) {
  11408. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11409. if (!is_aria_range_default(vNode) || !vNode.hasAttr('aria-valuenow')) {
  11410. return '';
  11411. }
  11412. var valueNow = +vNode.attr('aria-valuenow');
  11413. return !isNaN(valueNow) ? String(valueNow) : '0';
  11414. }
  11415. var form_control_value_default = formControlValue;
  11416. function getUnicodeNonBmpRegExp() {
  11417. return /[\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u20A0-\u20CF\u20D0-\u20FF\u2100-\u214F\u2150-\u218F\u2190-\u21FF\u2200-\u22FF\u2300-\u23FF\u2400-\u243F\u2440-\u245F\u2460-\u24FF\u2500-\u257F\u2580-\u259F\u25A0-\u25FF\u2600-\u26FF\u2700-\u27BF\uE000-\uF8FF]/g;
  11418. }
  11419. function getPunctuationRegExp() {
  11420. return /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&\xa3\xa2\xa5\xa7\u20ac()*+,\-.\/:;<=>?@\[\]^_`{|}~\xb1]/g;
  11421. }
  11422. function getSupplementaryPrivateUseRegExp() {
  11423. return /[\uDB80-\uDBBF][\uDC00-\uDFFF]/g;
  11424. }
  11425. var emoji_regex_default = function emoji_regex_default() {
  11426. return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
  11427. };
  11428. function hasUnicode(str, options) {
  11429. var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations;
  11430. if (emoji) {
  11431. return emoji_regex_default().test(str);
  11432. }
  11433. if (nonBmp) {
  11434. return getUnicodeNonBmpRegExp().test(str) || getSupplementaryPrivateUseRegExp().test(str);
  11435. }
  11436. if (punctuations) {
  11437. return getPunctuationRegExp().test(str);
  11438. }
  11439. return false;
  11440. }
  11441. var has_unicode_default = hasUnicode;
  11442. function isIconLigature(textVNode) {
  11443. var differenceThreshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .15;
  11444. var occurrenceThreshold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
  11445. var nodeValue = textVNode.actualNode.nodeValue.trim();
  11446. if (!sanitize_default(nodeValue) || has_unicode_default(nodeValue, {
  11447. emoji: true,
  11448. nonBmp: true
  11449. })) {
  11450. return false;
  11451. }
  11452. var canvasContext = cache_default.get('canvasContext', function() {
  11453. return document.createElement('canvas').getContext('2d', {
  11454. willReadFrequently: true
  11455. });
  11456. });
  11457. var canvas = canvasContext.canvas;
  11458. if (!cache_default.get('fonts')) {
  11459. cache_default.set('fonts', {});
  11460. }
  11461. var fonts = cache_default.get('fonts');
  11462. var style = window.getComputedStyle(textVNode.parent.actualNode);
  11463. var fontFamily = style.getPropertyValue('font-family');
  11464. if (!fonts[fontFamily]) {
  11465. fonts[fontFamily] = {
  11466. occurrences: 0,
  11467. numLigatures: 0
  11468. };
  11469. }
  11470. var font = fonts[fontFamily];
  11471. if (font.occurrences >= occurrenceThreshold) {
  11472. if (font.numLigatures / font.occurrences === 1) {
  11473. return true;
  11474. } else if (font.numLigatures === 0) {
  11475. return false;
  11476. }
  11477. }
  11478. font.occurrences++;
  11479. var fontSize = 30;
  11480. var fontStyle = ''.concat(fontSize, 'px ').concat(fontFamily);
  11481. canvasContext.font = fontStyle;
  11482. var firstChar = nodeValue.charAt(0);
  11483. var width = canvasContext.measureText(firstChar).width;
  11484. if (width < 30) {
  11485. var diff = 30 / width;
  11486. width *= diff;
  11487. fontSize *= diff;
  11488. fontStyle = ''.concat(fontSize, 'px ').concat(fontFamily);
  11489. }
  11490. canvas.width = width;
  11491. canvas.height = fontSize;
  11492. canvasContext.font = fontStyle;
  11493. canvasContext.textAlign = 'left';
  11494. canvasContext.textBaseline = 'top';
  11495. canvasContext.fillText(firstChar, 0, 0);
  11496. var compareData = new Uint32Array(canvasContext.getImageData(0, 0, width, fontSize).data.buffer);
  11497. if (!compareData.some(function(pixel) {
  11498. return pixel;
  11499. })) {
  11500. font.numLigatures++;
  11501. return true;
  11502. }
  11503. canvasContext.clearRect(0, 0, width, fontSize);
  11504. canvasContext.fillText(nodeValue, 0, 0);
  11505. var compareWith = new Uint32Array(canvasContext.getImageData(0, 0, width, fontSize).data.buffer);
  11506. var differences = compareData.reduce(function(diff, pixel, i) {
  11507. if (pixel === 0 && compareWith[i] === 0) {
  11508. return diff;
  11509. }
  11510. if (pixel !== 0 && compareWith[i] !== 0) {
  11511. return diff;
  11512. }
  11513. return ++diff;
  11514. }, 0);
  11515. var expectedWidth = nodeValue.split('').reduce(function(width2, _char2) {
  11516. return width2 + canvasContext.measureText(_char2).width;
  11517. }, 0);
  11518. var actualWidth = canvasContext.measureText(nodeValue).width;
  11519. var pixelDifference = differences / compareData.length;
  11520. var sizeDifference = 1 - actualWidth / expectedWidth;
  11521. if (pixelDifference >= differenceThreshold && sizeDifference >= differenceThreshold) {
  11522. font.numLigatures++;
  11523. return true;
  11524. }
  11525. return false;
  11526. }
  11527. var is_icon_ligature_default = isIconLigature;
  11528. function accessibleTextVirtual(virtualNode) {
  11529. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11530. context = prepareContext(virtualNode, context);
  11531. if (shouldIgnoreHidden(virtualNode, context)) {
  11532. return '';
  11533. }
  11534. if (shouldIgnoreIconLigature(virtualNode, context)) {
  11535. return '';
  11536. }
  11537. var computationSteps = [ arialabelledby_text_default, arialabel_text_default, native_text_alternative_default, form_control_value_default, subtree_text_default, textNodeValue, title_text_default ];
  11538. var accName = computationSteps.reduce(function(accName2, step) {
  11539. if (context.startNode === virtualNode) {
  11540. accName2 = sanitize_default(accName2);
  11541. }
  11542. if (accName2 !== '') {
  11543. return accName2;
  11544. }
  11545. return step(virtualNode, context);
  11546. }, '');
  11547. if (context.debug) {
  11548. axe.log(accName || '{empty-value}', virtualNode.actualNode, context);
  11549. }
  11550. return accName;
  11551. }
  11552. function textNodeValue(virtualNode) {
  11553. if (virtualNode.props.nodeType !== 3) {
  11554. return '';
  11555. }
  11556. return virtualNode.props.nodeValue;
  11557. }
  11558. function shouldIgnoreHidden(virtualNode, context) {
  11559. if (!virtualNode) {
  11560. return false;
  11561. }
  11562. if (virtualNode.props.nodeType !== 1 || context.includeHidden) {
  11563. return false;
  11564. }
  11565. return !_isVisibleToScreenReaders(virtualNode);
  11566. }
  11567. function shouldIgnoreIconLigature(virtualNode, context) {
  11568. var _context$occurrenceTh;
  11569. var ignoreIconLigature = context.ignoreIconLigature, pixelThreshold = context.pixelThreshold;
  11570. var occurrenceThreshold = (_context$occurrenceTh = context.occurrenceThreshold) !== null && _context$occurrenceTh !== void 0 ? _context$occurrenceTh : context.occuranceThreshold;
  11571. if (virtualNode.props.nodeType !== 3 || !ignoreIconLigature) {
  11572. return false;
  11573. }
  11574. return is_icon_ligature_default(virtualNode, pixelThreshold, occurrenceThreshold);
  11575. }
  11576. function prepareContext(virtualNode, context) {
  11577. if (!context.startNode) {
  11578. context = _extends({
  11579. startNode: virtualNode
  11580. }, context);
  11581. }
  11582. if (virtualNode.props.nodeType === 1 && context.inLabelledByContext && context.includeHidden === void 0) {
  11583. context = _extends({
  11584. includeHidden: !_isVisibleToScreenReaders(virtualNode)
  11585. }, context);
  11586. }
  11587. return context;
  11588. }
  11589. accessibleTextVirtual.alreadyProcessed = function alreadyProcessed(virtualnode, context) {
  11590. context.processed = context.processed || [];
  11591. if (context.processed.includes(virtualnode)) {
  11592. return true;
  11593. }
  11594. context.processed.push(virtualnode);
  11595. return false;
  11596. };
  11597. var accessible_text_virtual_default = accessibleTextVirtual;
  11598. function removeUnicode(str, options) {
  11599. var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations;
  11600. if (emoji) {
  11601. str = str.replace(emoji_regex_default(), '');
  11602. }
  11603. if (nonBmp) {
  11604. str = str.replace(getUnicodeNonBmpRegExp(), '');
  11605. str = str.replace(getSupplementaryPrivateUseRegExp(), '');
  11606. }
  11607. if (punctuations) {
  11608. str = str.replace(getPunctuationRegExp(), '');
  11609. }
  11610. return str;
  11611. }
  11612. var remove_unicode_default = removeUnicode;
  11613. function isHumanInterpretable(str) {
  11614. if (!str.length) {
  11615. return 0;
  11616. }
  11617. var alphaNumericIconMap = [ 'x', 'i' ];
  11618. if (alphaNumericIconMap.includes(str)) {
  11619. return 0;
  11620. }
  11621. var noUnicodeStr = remove_unicode_default(str, {
  11622. emoji: true,
  11623. nonBmp: true,
  11624. punctuations: true
  11625. });
  11626. if (!sanitize_default(noUnicodeStr)) {
  11627. return 0;
  11628. }
  11629. return 1;
  11630. }
  11631. var is_human_interpretable_default = isHumanInterpretable;
  11632. var _autocomplete = {
  11633. stateTerms: [ 'on', 'off' ],
  11634. standaloneTerms: [ 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'username', 'new-password', 'current-password', 'organization-title', 'organization', 'street-address', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'url', 'photo', 'one-time-code' ],
  11635. qualifiers: [ 'home', 'work', 'mobile', 'fax', 'pager' ],
  11636. qualifiedTerms: [ 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-local-prefix', 'tel-local-suffix', 'tel-extension', 'email', 'impp' ],
  11637. locations: [ 'billing', 'shipping' ]
  11638. };
  11639. function isValidAutocomplete(autocompleteValue) {
  11640. var _ref37 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref37$looseTyped = _ref37.looseTyped, looseTyped = _ref37$looseTyped === void 0 ? false : _ref37$looseTyped, _ref37$stateTerms = _ref37.stateTerms, stateTerms = _ref37$stateTerms === void 0 ? [] : _ref37$stateTerms, _ref37$locations = _ref37.locations, locations = _ref37$locations === void 0 ? [] : _ref37$locations, _ref37$qualifiers = _ref37.qualifiers, qualifiers = _ref37$qualifiers === void 0 ? [] : _ref37$qualifiers, _ref37$standaloneTerm = _ref37.standaloneTerms, standaloneTerms = _ref37$standaloneTerm === void 0 ? [] : _ref37$standaloneTerm, _ref37$qualifiedTerms = _ref37.qualifiedTerms, qualifiedTerms = _ref37$qualifiedTerms === void 0 ? [] : _ref37$qualifiedTerms;
  11641. autocompleteValue = autocompleteValue.toLowerCase().trim();
  11642. stateTerms = stateTerms.concat(_autocomplete.stateTerms);
  11643. if (stateTerms.includes(autocompleteValue) || autocompleteValue === '') {
  11644. return true;
  11645. }
  11646. qualifiers = qualifiers.concat(_autocomplete.qualifiers);
  11647. locations = locations.concat(_autocomplete.locations);
  11648. standaloneTerms = standaloneTerms.concat(_autocomplete.standaloneTerms);
  11649. qualifiedTerms = qualifiedTerms.concat(_autocomplete.qualifiedTerms);
  11650. var autocompleteTerms = autocompleteValue.split(/\s+/g);
  11651. if (autocompleteTerms[autocompleteTerms.length - 1] === 'webauthn') {
  11652. autocompleteTerms.pop();
  11653. if (autocompleteTerms.length === 0) {
  11654. return false;
  11655. }
  11656. }
  11657. if (!looseTyped) {
  11658. if (autocompleteTerms[0].length > 8 && autocompleteTerms[0].substr(0, 8) === 'section-') {
  11659. autocompleteTerms.shift();
  11660. }
  11661. if (locations.includes(autocompleteTerms[0])) {
  11662. autocompleteTerms.shift();
  11663. }
  11664. if (qualifiers.includes(autocompleteTerms[0])) {
  11665. autocompleteTerms.shift();
  11666. standaloneTerms = [];
  11667. }
  11668. if (autocompleteTerms.length !== 1) {
  11669. return false;
  11670. }
  11671. }
  11672. var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
  11673. return standaloneTerms.includes(purposeTerm) || qualifiedTerms.includes(purposeTerm);
  11674. }
  11675. var is_valid_autocomplete_default = isValidAutocomplete;
  11676. function labelVirtual(virtualNode) {
  11677. var ref, candidate;
  11678. if (virtualNode.attr('aria-labelledby')) {
  11679. ref = idrefs_default(virtualNode.actualNode, 'aria-labelledby');
  11680. candidate = ref.map(function(thing) {
  11681. var vNode = get_node_from_tree_default(thing);
  11682. return vNode ? visible_virtual_default(vNode) : '';
  11683. }).join(' ').trim();
  11684. if (candidate) {
  11685. return candidate;
  11686. }
  11687. }
  11688. candidate = virtualNode.attr('aria-label');
  11689. if (candidate) {
  11690. candidate = sanitize_default(candidate);
  11691. if (candidate) {
  11692. return candidate;
  11693. }
  11694. }
  11695. return null;
  11696. }
  11697. var label_virtual_default = labelVirtual;
  11698. function visible(element, screenReader, noRecursing) {
  11699. element = get_node_from_tree_default(element);
  11700. return visible_virtual_default(element, screenReader, noRecursing);
  11701. }
  11702. var visible_default = visible;
  11703. function labelVirtual2(virtualNode) {
  11704. var ref, candidate, doc;
  11705. candidate = label_virtual_default(virtualNode);
  11706. if (candidate) {
  11707. return candidate;
  11708. }
  11709. if (virtualNode.attr('id')) {
  11710. if (!virtualNode.actualNode) {
  11711. throw new TypeError('Cannot resolve explicit label reference for non-DOM nodes');
  11712. }
  11713. var id = escape_selector_default(virtualNode.attr('id'));
  11714. doc = get_root_node_default2(virtualNode.actualNode);
  11715. ref = doc.querySelector('label[for="' + id + '"]');
  11716. candidate = ref && visible_default(ref, true);
  11717. if (candidate) {
  11718. return candidate;
  11719. }
  11720. }
  11721. ref = closest_default(virtualNode, 'label');
  11722. candidate = ref && visible_virtual_default(ref, true);
  11723. if (candidate) {
  11724. return candidate;
  11725. }
  11726. return null;
  11727. }
  11728. var label_virtual_default2 = labelVirtual2;
  11729. function label(node) {
  11730. node = get_node_from_tree_default(node);
  11731. return label_virtual_default2(node);
  11732. }
  11733. var label_default = label;
  11734. var nativeElementType = [ {
  11735. matches: [ {
  11736. nodeName: 'textarea'
  11737. }, {
  11738. nodeName: 'input',
  11739. properties: {
  11740. type: [ 'text', 'password', 'search', 'tel', 'email', 'url' ]
  11741. }
  11742. } ],
  11743. namingMethods: 'labelText'
  11744. }, {
  11745. matches: {
  11746. nodeName: 'input',
  11747. properties: {
  11748. type: [ 'button', 'submit', 'reset' ]
  11749. }
  11750. },
  11751. namingMethods: [ 'valueText', 'titleText', 'buttonDefaultText' ]
  11752. }, {
  11753. matches: {
  11754. nodeName: 'input',
  11755. properties: {
  11756. type: 'image'
  11757. }
  11758. },
  11759. namingMethods: [ 'altText', 'valueText', 'labelText', 'titleText', 'buttonDefaultText' ]
  11760. }, {
  11761. matches: 'button',
  11762. namingMethods: 'subtreeText'
  11763. }, {
  11764. matches: 'fieldset',
  11765. namingMethods: 'fieldsetLegendText'
  11766. }, {
  11767. matches: 'OUTPUT',
  11768. namingMethods: 'subtreeText'
  11769. }, {
  11770. matches: [ {
  11771. nodeName: 'select'
  11772. }, {
  11773. nodeName: 'input',
  11774. properties: {
  11775. type: /^(?!text|password|search|tel|email|url|button|submit|reset)/
  11776. }
  11777. } ],
  11778. namingMethods: 'labelText'
  11779. }, {
  11780. matches: 'summary',
  11781. namingMethods: 'subtreeText'
  11782. }, {
  11783. matches: 'figure',
  11784. namingMethods: [ 'figureText', 'titleText' ]
  11785. }, {
  11786. matches: 'img',
  11787. namingMethods: 'altText'
  11788. }, {
  11789. matches: 'table',
  11790. namingMethods: [ 'tableCaptionText', 'tableSummaryText' ]
  11791. }, {
  11792. matches: [ 'hr', 'br' ],
  11793. namingMethods: [ 'titleText', 'singleSpace' ]
  11794. } ];
  11795. var native_element_type_default = nativeElementType;
  11796. function visibleTextNodes(vNode) {
  11797. var parentVisible = _isVisibleOnScreen(vNode);
  11798. var nodes = [];
  11799. vNode.children.forEach(function(child) {
  11800. if (child.actualNode.nodeType === 3) {
  11801. if (parentVisible) {
  11802. nodes.push(child);
  11803. }
  11804. } else {
  11805. nodes = nodes.concat(visibleTextNodes(child));
  11806. }
  11807. });
  11808. return nodes;
  11809. }
  11810. var visible_text_nodes_default = visibleTextNodes;
  11811. var getVisibleChildTextRects = memoize_default(function getVisibleChildTextRectsMemoized(node) {
  11812. var vNode = get_node_from_tree_default(node);
  11813. var nodeRect = vNode.boundingClientRect;
  11814. var clientRects = [];
  11815. var overflowHiddenNodes = get_overflow_hidden_ancestors_default(vNode);
  11816. node.childNodes.forEach(function(textNode) {
  11817. if (textNode.nodeType !== 3 || sanitize_default(textNode.nodeValue) === '') {
  11818. return;
  11819. }
  11820. var contentRects = getContentRects(textNode);
  11821. if (isOutsideNodeBounds(contentRects, nodeRect)) {
  11822. return;
  11823. }
  11824. clientRects.push.apply(clientRects, _toConsumableArray(filterHiddenRects(contentRects, overflowHiddenNodes)));
  11825. });
  11826. return clientRects.length ? clientRects : [ nodeRect ];
  11827. });
  11828. var get_visible_child_text_rects_default = getVisibleChildTextRects;
  11829. function getContentRects(node) {
  11830. var range = document.createRange();
  11831. range.selectNodeContents(node);
  11832. return Array.from(range.getClientRects());
  11833. }
  11834. function isOutsideNodeBounds(rects, nodeRect) {
  11835. return rects.some(function(rect) {
  11836. var centerPoint = _getRectCenter(rect);
  11837. return !_isPointInRect(centerPoint, nodeRect);
  11838. });
  11839. }
  11840. function filterHiddenRects(contentRects, overflowHiddenNodes) {
  11841. var visibleRects = [];
  11842. contentRects.forEach(function(contentRect) {
  11843. if (contentRect.width < 1 || contentRect.height < 1) {
  11844. return;
  11845. }
  11846. var visibleRect = overflowHiddenNodes.reduce(function(rect, overflowNode) {
  11847. return rect && _getIntersectionRect(rect, overflowNode.boundingClientRect);
  11848. }, contentRect);
  11849. if (visibleRect) {
  11850. visibleRects.push(visibleRect);
  11851. }
  11852. });
  11853. return visibleRects;
  11854. }
  11855. function getTextElementStack(node) {
  11856. _createGrid();
  11857. var vNode = get_node_from_tree_default(node);
  11858. var grid = vNode._grid;
  11859. if (!grid) {
  11860. return [];
  11861. }
  11862. var clientRects = get_visible_child_text_rects_default(node);
  11863. return clientRects.map(function(rect) {
  11864. return getRectStack(grid, rect);
  11865. });
  11866. }
  11867. var get_text_element_stack_default = getTextElementStack;
  11868. var visualRoles = [ 'checkbox', 'img', 'meter', 'progressbar', 'scrollbar', 'radio', 'slider', 'spinbutton', 'textbox' ];
  11869. function isVisualContent(el) {
  11870. var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
  11871. var role = axe.commons.aria.getExplicitRole(vNode);
  11872. if (role) {
  11873. return visualRoles.indexOf(role) !== -1;
  11874. }
  11875. switch (vNode.props.nodeName) {
  11876. case 'img':
  11877. case 'iframe':
  11878. case 'object':
  11879. case 'video':
  11880. case 'audio':
  11881. case 'canvas':
  11882. case 'svg':
  11883. case 'math':
  11884. case 'button':
  11885. case 'select':
  11886. case 'textarea':
  11887. case 'keygen':
  11888. case 'progress':
  11889. case 'meter':
  11890. return true;
  11891. case 'input':
  11892. return vNode.props.type !== 'hidden';
  11893. default:
  11894. return false;
  11895. }
  11896. }
  11897. var is_visual_content_default = isVisualContent;
  11898. var hiddenTextElms = [ 'head', 'title', 'template', 'script', 'style', 'iframe', 'object', 'video', 'audio', 'noscript' ];
  11899. function hasChildTextNodes(elm) {
  11900. if (hiddenTextElms.includes(elm.props.nodeName)) {
  11901. return false;
  11902. }
  11903. return elm.children.some(function(_ref38) {
  11904. var props = _ref38.props;
  11905. return props.nodeType === 3 && props.nodeValue.trim();
  11906. });
  11907. }
  11908. function hasContentVirtual(elm, noRecursion, ignoreAria) {
  11909. return hasChildTextNodes(elm) || is_visual_content_default(elm.actualNode) || !ignoreAria && !!label_virtual_default(elm) || !noRecursion && elm.children.some(function(child) {
  11910. return child.actualNode.nodeType === 1 && hasContentVirtual(child);
  11911. });
  11912. }
  11913. var has_content_virtual_default = hasContentVirtual;
  11914. function hasContent(elm, noRecursion, ignoreAria) {
  11915. elm = get_node_from_tree_default(elm);
  11916. return has_content_virtual_default(elm, noRecursion, ignoreAria);
  11917. }
  11918. var has_content_default = hasContent;
  11919. function _hasLangText(virtualNode) {
  11920. if (typeof virtualNode.children === 'undefined' || hasChildTextNodes(virtualNode)) {
  11921. return true;
  11922. }
  11923. if (virtualNode.props.nodeType === 1 && is_visual_content_default(virtualNode)) {
  11924. return !!axe.commons.text.accessibleTextVirtual(virtualNode);
  11925. }
  11926. return virtualNode.children.some(function(child) {
  11927. return !child.attr('lang') && _hasLangText(child) && !_isHiddenForEveryone(child);
  11928. });
  11929. }
  11930. function insertedIntoFocusOrder(el) {
  11931. var tabIndex = parseInt(el.getAttribute('tabindex'), 10);
  11932. return tabIndex > -1 && _isFocusable(el) && !is_natively_focusable_default(el);
  11933. }
  11934. var inserted_into_focus_order_default = insertedIntoFocusOrder;
  11935. function isHiddenWithCSS(node, descendentVisibilityValue) {
  11936. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11937. var el = node instanceof window.Node ? node : vNode === null || vNode === void 0 ? void 0 : vNode.actualNode;
  11938. if (!vNode) {
  11939. return _isHiddenWithCSS(el, descendentVisibilityValue);
  11940. }
  11941. if (vNode._isHiddenWithCSS === void 0) {
  11942. vNode._isHiddenWithCSS = _isHiddenWithCSS(el, descendentVisibilityValue);
  11943. }
  11944. return vNode._isHiddenWithCSS;
  11945. }
  11946. function _isHiddenWithCSS(el, descendentVisibilityValue) {
  11947. if (el.nodeType === 9) {
  11948. return false;
  11949. }
  11950. if (el.nodeType === 11) {
  11951. el = el.host;
  11952. }
  11953. if ([ 'STYLE', 'SCRIPT' ].includes(el.nodeName.toUpperCase())) {
  11954. return false;
  11955. }
  11956. var style = window.getComputedStyle(el, null);
  11957. if (!style) {
  11958. throw new Error('Style does not exist for the given element.');
  11959. }
  11960. var displayValue = style.getPropertyValue('display');
  11961. if (displayValue === 'none') {
  11962. return true;
  11963. }
  11964. var HIDDEN_VISIBILITY_VALUES = [ 'hidden', 'collapse' ];
  11965. var visibilityValue = style.getPropertyValue('visibility');
  11966. if (HIDDEN_VISIBILITY_VALUES.includes(visibilityValue) && !descendentVisibilityValue) {
  11967. return true;
  11968. }
  11969. if (HIDDEN_VISIBILITY_VALUES.includes(visibilityValue) && descendentVisibilityValue && HIDDEN_VISIBILITY_VALUES.includes(descendentVisibilityValue)) {
  11970. return true;
  11971. }
  11972. var parent = get_composed_parent_default(el);
  11973. if (parent && !HIDDEN_VISIBILITY_VALUES.includes(visibilityValue)) {
  11974. return isHiddenWithCSS(parent, visibilityValue);
  11975. }
  11976. return false;
  11977. }
  11978. var is_hidden_with_css_default = isHiddenWithCSS;
  11979. function isHTML5(doc) {
  11980. var node = doc.doctype;
  11981. if (node === null) {
  11982. return false;
  11983. }
  11984. return node.name === 'html' && !node.publicId && !node.systemId;
  11985. }
  11986. var is_html5_default = isHTML5;
  11987. function _isInTabOrder(el) {
  11988. var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
  11989. if (vNode.props.nodeType !== 1) {
  11990. return false;
  11991. }
  11992. var tabindex = parseInt(vNode.attr('tabindex', 10));
  11993. if (tabindex <= -1) {
  11994. return false;
  11995. }
  11996. return _isFocusable(vNode);
  11997. }
  11998. function getRoleType(role) {
  11999. var _window3;
  12000. if (role instanceof abstract_virtual_node_default || (_window3 = window) !== null && _window3 !== void 0 && _window3.Node && role instanceof window.Node) {
  12001. role = axe.commons.aria.getRole(role);
  12002. }
  12003. var roleDef = standards_default.ariaRoles[role];
  12004. return (roleDef === null || roleDef === void 0 ? void 0 : roleDef.type) || null;
  12005. }
  12006. var get_role_type_default = getRoleType;
  12007. function walkDomNode(node, functor) {
  12008. if (functor(node.actualNode) !== false) {
  12009. node.children.forEach(function(child) {
  12010. return walkDomNode(child, functor);
  12011. });
  12012. }
  12013. }
  12014. var blockLike = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
  12015. function isBlock(elm) {
  12016. var display = window.getComputedStyle(elm).getPropertyValue('display');
  12017. return blockLike.includes(display) || display.substr(0, 6) === 'table-';
  12018. }
  12019. function getBlockParent(node) {
  12020. var parentBlock = get_composed_parent_default(node);
  12021. while (parentBlock && !isBlock(parentBlock)) {
  12022. parentBlock = get_composed_parent_default(parentBlock);
  12023. }
  12024. return get_node_from_tree_default(parentBlock);
  12025. }
  12026. function isInTextBlock(node, options) {
  12027. if (isBlock(node)) {
  12028. return false;
  12029. }
  12030. var virtualParent = getBlockParent(node);
  12031. var parentText = '';
  12032. var widgetText = '';
  12033. var inBrBlock = 0;
  12034. walkDomNode(virtualParent, function(currNode) {
  12035. if (inBrBlock === 2) {
  12036. return false;
  12037. }
  12038. if (currNode.nodeType === 3) {
  12039. parentText += currNode.nodeValue;
  12040. }
  12041. if (currNode.nodeType !== 1) {
  12042. return;
  12043. }
  12044. var nodeName2 = (currNode.nodeName || '').toUpperCase();
  12045. if (currNode === node) {
  12046. inBrBlock = 1;
  12047. }
  12048. if ([ 'BR', 'HR' ].includes(nodeName2)) {
  12049. if (inBrBlock === 0) {
  12050. parentText = '';
  12051. widgetText = '';
  12052. } else {
  12053. inBrBlock = 2;
  12054. }
  12055. } else if (currNode.style.display === 'none' || currNode.style.overflow === 'hidden' || ![ '', null, 'none' ].includes(currNode.style['float']) || ![ '', null, 'relative' ].includes(currNode.style.position)) {
  12056. return false;
  12057. } else if (get_role_type_default(currNode) === 'widget') {
  12058. widgetText += currNode.textContent;
  12059. return false;
  12060. }
  12061. });
  12062. parentText = sanitize_default(parentText);
  12063. if (options !== null && options !== void 0 && options.noLengthCompare) {
  12064. return parentText.length !== 0;
  12065. }
  12066. widgetText = sanitize_default(widgetText);
  12067. return parentText.length > widgetText.length;
  12068. }
  12069. var is_in_text_block_default = isInTextBlock;
  12070. function isModalOpen(options) {
  12071. options = options || {};
  12072. var modalPercent = options.modalPercent || .75;
  12073. if (cache_default.get('isModalOpen')) {
  12074. return cache_default.get('isModalOpen');
  12075. }
  12076. var definiteModals = query_selector_all_filter_default(axe._tree[0], 'dialog, [role=dialog], [aria-modal=true]', _isVisibleOnScreen);
  12077. if (definiteModals.length) {
  12078. cache_default.set('isModalOpen', true);
  12079. return true;
  12080. }
  12081. var viewport = get_viewport_size_default(window);
  12082. var percentWidth = viewport.width * modalPercent;
  12083. var percentHeight = viewport.height * modalPercent;
  12084. var x = (viewport.width - percentWidth) / 2;
  12085. var y = (viewport.height - percentHeight) / 2;
  12086. var points = [ {
  12087. x: x,
  12088. y: y
  12089. }, {
  12090. x: viewport.width - x,
  12091. y: y
  12092. }, {
  12093. x: viewport.width / 2,
  12094. y: viewport.height / 2
  12095. }, {
  12096. x: x,
  12097. y: viewport.height - y
  12098. }, {
  12099. x: viewport.width - x,
  12100. y: viewport.height - y
  12101. } ];
  12102. var stacks = points.map(function(point) {
  12103. return Array.from(document.elementsFromPoint(point.x, point.y));
  12104. });
  12105. var _loop4 = function _loop4(_i9) {
  12106. var modalElement = stacks[_i9].find(function(elm) {
  12107. var style = window.getComputedStyle(elm);
  12108. return parseInt(style.width, 10) >= percentWidth && parseInt(style.height, 10) >= percentHeight && style.getPropertyValue('pointer-events') !== 'none' && (style.position === 'absolute' || style.position === 'fixed');
  12109. });
  12110. if (modalElement && stacks.every(function(stack) {
  12111. return stack.includes(modalElement);
  12112. })) {
  12113. cache_default.set('isModalOpen', true);
  12114. return {
  12115. v: true
  12116. };
  12117. }
  12118. };
  12119. for (var _i9 = 0; _i9 < stacks.length; _i9++) {
  12120. var _ret = _loop4(_i9);
  12121. if (_typeof(_ret) === 'object') {
  12122. return _ret.v;
  12123. }
  12124. }
  12125. cache_default.set('isModalOpen', void 0);
  12126. return void 0;
  12127. }
  12128. var is_modal_open_default = isModalOpen;
  12129. function _isMultiline(domNode) {
  12130. var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  12131. var range = domNode.ownerDocument.createRange();
  12132. range.setStart(domNode, 0);
  12133. range.setEnd(domNode, domNode.childNodes.length);
  12134. var lastLineEnd = 0;
  12135. var lineCount = 0;
  12136. var _iterator4 = _createForOfIteratorHelper(range.getClientRects()), _step4;
  12137. try {
  12138. for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
  12139. var rect = _step4.value;
  12140. if (rect.height <= margin) {
  12141. continue;
  12142. }
  12143. if (lastLineEnd > rect.top + margin) {
  12144. lastLineEnd = Math.max(lastLineEnd, rect.bottom);
  12145. } else if (lineCount === 0) {
  12146. lastLineEnd = rect.bottom;
  12147. lineCount++;
  12148. } else {
  12149. return true;
  12150. }
  12151. }
  12152. } catch (err) {
  12153. _iterator4.e(err);
  12154. } finally {
  12155. _iterator4.f();
  12156. }
  12157. return false;
  12158. }
  12159. function isNode(element) {
  12160. return element instanceof window.Node;
  12161. }
  12162. var is_node_default = isNode;
  12163. var data = {};
  12164. var incompleteData = {
  12165. set: function set(key, reason) {
  12166. if (typeof key !== 'string') {
  12167. throw new Error('Incomplete data: key must be a string');
  12168. }
  12169. if (reason) {
  12170. data[key] = reason;
  12171. }
  12172. return data[key];
  12173. },
  12174. get: function get(key) {
  12175. return data[key];
  12176. },
  12177. clear: function clear() {
  12178. data = {};
  12179. }
  12180. };
  12181. var incomplete_data_default = incompleteData;
  12182. function elementHasImage(elm, style) {
  12183. var graphicNodes = [ 'IMG', 'CANVAS', 'OBJECT', 'IFRAME', 'VIDEO', 'SVG' ];
  12184. var nodeName2 = elm.nodeName.toUpperCase();
  12185. if (graphicNodes.includes(nodeName2)) {
  12186. incomplete_data_default.set('bgColor', 'imgNode');
  12187. return true;
  12188. }
  12189. style = style || window.getComputedStyle(elm);
  12190. var bgImageStyle = style.getPropertyValue('background-image');
  12191. var hasBgImage = bgImageStyle !== 'none';
  12192. if (hasBgImage) {
  12193. var hasGradient = /gradient/.test(bgImageStyle);
  12194. incomplete_data_default.set('bgColor', hasGradient ? 'bgGradient' : 'bgImage');
  12195. }
  12196. return hasBgImage;
  12197. }
  12198. var element_has_image_default = elementHasImage;
  12199. var hexRegex = /^#[0-9a-f]{3,8}$/i;
  12200. var colorFnRegex = /^((?:rgb|hsl)a?)\s*\(([^\)]*)\)/i;
  12201. var Color = function() {
  12202. function Color(red, green, blue) {
  12203. var alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
  12204. _classCallCheck(this, Color);
  12205. this.red = red;
  12206. this.green = green;
  12207. this.blue = blue;
  12208. this.alpha = alpha;
  12209. }
  12210. _createClass(Color, [ {
  12211. key: 'toHexString',
  12212. value: function toHexString() {
  12213. var redString = Math.round(this.red).toString(16);
  12214. var greenString = Math.round(this.green).toString(16);
  12215. var blueString = Math.round(this.blue).toString(16);
  12216. return '#' + (this.red > 15.5 ? redString : '0' + redString) + (this.green > 15.5 ? greenString : '0' + greenString) + (this.blue > 15.5 ? blueString : '0' + blueString);
  12217. }
  12218. }, {
  12219. key: 'toJSON',
  12220. value: function toJSON() {
  12221. var red = this.red, green = this.green, blue = this.blue, alpha = this.alpha;
  12222. return {
  12223. red: red,
  12224. green: green,
  12225. blue: blue,
  12226. alpha: alpha
  12227. };
  12228. }
  12229. }, {
  12230. key: 'parseString',
  12231. value: function parseString(colorString) {
  12232. if (standards_default.cssColors[colorString] || colorString === 'transparent') {
  12233. var _ref39 = standards_default.cssColors[colorString] || [ 0, 0, 0 ], _ref40 = _slicedToArray(_ref39, 3), red = _ref40[0], green = _ref40[1], blue = _ref40[2];
  12234. this.red = red;
  12235. this.green = green;
  12236. this.blue = blue;
  12237. this.alpha = colorString === 'transparent' ? 0 : 1;
  12238. return this;
  12239. }
  12240. if (colorString.match(colorFnRegex)) {
  12241. this.parseColorFnString(colorString);
  12242. return this;
  12243. }
  12244. if (colorString.match(hexRegex)) {
  12245. this.parseHexString(colorString);
  12246. return this;
  12247. }
  12248. throw new Error('Unable to parse color "'.concat(colorString, '"'));
  12249. }
  12250. }, {
  12251. key: 'parseRgbString',
  12252. value: function parseRgbString(colorString) {
  12253. if (colorString === 'transparent') {
  12254. this.red = 0;
  12255. this.green = 0;
  12256. this.blue = 0;
  12257. this.alpha = 0;
  12258. return;
  12259. }
  12260. this.parseColorFnString(colorString);
  12261. }
  12262. }, {
  12263. key: 'parseHexString',
  12264. value: function parseHexString(colorString) {
  12265. if (!colorString.match(hexRegex) || [ 6, 8 ].includes(colorString.length)) {
  12266. return;
  12267. }
  12268. colorString = colorString.replace('#', '');
  12269. if (colorString.length < 6) {
  12270. var _colorString = colorString, _colorString2 = _slicedToArray(_colorString, 4), r = _colorString2[0], g = _colorString2[1], b = _colorString2[2], a = _colorString2[3];
  12271. colorString = r + r + g + g + b + b;
  12272. if (a) {
  12273. colorString += a + a;
  12274. }
  12275. }
  12276. var aRgbHex = colorString.match(/.{1,2}/g);
  12277. this.red = parseInt(aRgbHex[0], 16);
  12278. this.green = parseInt(aRgbHex[1], 16);
  12279. this.blue = parseInt(aRgbHex[2], 16);
  12280. if (aRgbHex[3]) {
  12281. this.alpha = parseInt(aRgbHex[3], 16) / 255;
  12282. } else {
  12283. this.alpha = 1;
  12284. }
  12285. }
  12286. }, {
  12287. key: 'parseColorFnString',
  12288. value: function parseColorFnString(colorString) {
  12289. var _ref41 = colorString.match(colorFnRegex) || [], _ref42 = _slicedToArray(_ref41, 3), colorFunc = _ref42[1], colorValStr = _ref42[2];
  12290. if (!colorFunc || !colorValStr) {
  12291. return;
  12292. }
  12293. var colorVals = colorValStr.split(/\s*[,\/\s]\s*/).map(function(str) {
  12294. return str.replace(',', '').trim();
  12295. }).filter(function(str) {
  12296. return str !== '';
  12297. });
  12298. var colorNums = colorVals.map(function(val, index) {
  12299. return convertColorVal(colorFunc, val, index);
  12300. });
  12301. if (colorFunc.substr(0, 3) === 'hsl') {
  12302. colorNums = hslToRgb(colorNums);
  12303. }
  12304. this.red = colorNums[0];
  12305. this.green = colorNums[1];
  12306. this.blue = colorNums[2];
  12307. this.alpha = typeof colorNums[3] === 'number' ? colorNums[3] : 1;
  12308. }
  12309. }, {
  12310. key: 'getRelativeLuminance',
  12311. value: function getRelativeLuminance() {
  12312. var rSRGB = this.red / 255;
  12313. var gSRGB = this.green / 255;
  12314. var bSRGB = this.blue / 255;
  12315. var r = rSRGB <= .03928 ? rSRGB / 12.92 : Math.pow((rSRGB + .055) / 1.055, 2.4);
  12316. var g = gSRGB <= .03928 ? gSRGB / 12.92 : Math.pow((gSRGB + .055) / 1.055, 2.4);
  12317. var b = bSRGB <= .03928 ? bSRGB / 12.92 : Math.pow((bSRGB + .055) / 1.055, 2.4);
  12318. return .2126 * r + .7152 * g + .0722 * b;
  12319. }
  12320. } ]);
  12321. return Color;
  12322. }();
  12323. var color_default = Color;
  12324. function convertColorVal(colorFunc, value, index) {
  12325. if (/%$/.test(value)) {
  12326. if (index === 3) {
  12327. return parseFloat(value) / 100;
  12328. }
  12329. return parseFloat(value) * 255 / 100;
  12330. }
  12331. if (colorFunc[index] === 'h') {
  12332. if (/turn$/.test(value)) {
  12333. return parseFloat(value) * 360;
  12334. }
  12335. if (/rad$/.test(value)) {
  12336. return parseFloat(value) * 57.3;
  12337. }
  12338. }
  12339. return parseFloat(value);
  12340. }
  12341. function hslToRgb(_ref43) {
  12342. var _ref44 = _slicedToArray(_ref43, 4), hue = _ref44[0], saturation = _ref44[1], lightness = _ref44[2], alpha = _ref44[3];
  12343. saturation /= 255;
  12344. lightness /= 255;
  12345. var high = (1 - Math.abs(2 * lightness - 1)) * saturation;
  12346. var low = high * (1 - Math.abs(hue / 60 % 2 - 1));
  12347. var base = lightness - high / 2;
  12348. var colors;
  12349. if (hue < 60) {
  12350. colors = [ high, low, 0 ];
  12351. } else if (hue < 120) {
  12352. colors = [ low, high, 0 ];
  12353. } else if (hue < 180) {
  12354. colors = [ 0, high, low ];
  12355. } else if (hue < 240) {
  12356. colors = [ 0, low, high ];
  12357. } else if (hue < 300) {
  12358. colors = [ low, 0, high ];
  12359. } else {
  12360. colors = [ high, 0, low ];
  12361. }
  12362. return colors.map(function(color) {
  12363. return Math.round((color + base) * 255);
  12364. }).concat(alpha);
  12365. }
  12366. function getOwnBackgroundColor(elmStyle) {
  12367. var bgColor = new color_default();
  12368. bgColor.parseString(elmStyle.getPropertyValue('background-color'));
  12369. if (bgColor.alpha !== 0) {
  12370. var opacity = elmStyle.getPropertyValue('opacity');
  12371. bgColor.alpha = bgColor.alpha * opacity;
  12372. }
  12373. return bgColor;
  12374. }
  12375. var get_own_background_color_default = getOwnBackgroundColor;
  12376. function isOpaque(node) {
  12377. var style = window.getComputedStyle(node);
  12378. return element_has_image_default(node, style) || get_own_background_color_default(style).alpha === 1;
  12379. }
  12380. var is_opaque_default = isOpaque;
  12381. function _isSkipLink(element) {
  12382. if (!element.href) {
  12383. return false;
  12384. }
  12385. var firstPageLink = cache_default.get('firstPageLink', generateFirstPageLink);
  12386. if (!firstPageLink) {
  12387. return true;
  12388. }
  12389. return element.compareDocumentPosition(firstPageLink.actualNode) === element.DOCUMENT_POSITION_FOLLOWING;
  12390. }
  12391. function generateFirstPageLink() {
  12392. var firstPageLink;
  12393. if (!window.location.origin) {
  12394. firstPageLink = query_selector_all_default(axe._tree, 'a:not([href^="#"]):not([href^="/#"]):not([href^="javascript:"])')[0];
  12395. } else {
  12396. firstPageLink = query_selector_all_default(axe._tree, 'a[href]:not([href^="javascript:"])').find(function(link) {
  12397. return !_isCurrentPageLink(link.actualNode);
  12398. });
  12399. }
  12400. return firstPageLink || null;
  12401. }
  12402. var clipRegex2 = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/;
  12403. var clipPathRegex2 = /(\w+)\((\d+)/;
  12404. function isClipped(style) {
  12405. var matchesClip = style.getPropertyValue('clip').match(clipRegex2);
  12406. var matchesClipPath = style.getPropertyValue('clip-path').match(clipPathRegex2);
  12407. if (matchesClip && matchesClip.length === 5) {
  12408. var position = style.getPropertyValue('position');
  12409. if ([ 'fixed', 'absolute' ].includes(position)) {
  12410. return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0;
  12411. }
  12412. }
  12413. if (matchesClipPath) {
  12414. var type = matchesClipPath[1];
  12415. var value = parseInt(matchesClipPath[2], 10);
  12416. switch (type) {
  12417. case 'inset':
  12418. return value >= 50;
  12419. case 'circle':
  12420. return value === 0;
  12421. default:
  12422. }
  12423. }
  12424. return false;
  12425. }
  12426. function isAreaVisible(el, screenReader, recursed) {
  12427. var mapEl = find_up_default(el, 'map');
  12428. if (!mapEl) {
  12429. return false;
  12430. }
  12431. var mapElName = mapEl.getAttribute('name');
  12432. if (!mapElName) {
  12433. return false;
  12434. }
  12435. var mapElRootNode = get_root_node_default2(el);
  12436. if (!mapElRootNode || mapElRootNode.nodeType !== 9) {
  12437. return false;
  12438. }
  12439. var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]'));
  12440. if (!refs || !refs.length) {
  12441. return false;
  12442. }
  12443. return refs.some(function(_ref45) {
  12444. var actualNode = _ref45.actualNode;
  12445. return isVisible(actualNode, screenReader, recursed);
  12446. });
  12447. }
  12448. function isVisible(el, screenReader, recursed) {
  12449. var _window$Node2;
  12450. if (!el) {
  12451. throw new TypeError('Cannot determine if element is visible for non-DOM nodes');
  12452. }
  12453. var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
  12454. el = vNode ? vNode.actualNode : el;
  12455. var cacheName = '_isVisible' + (screenReader ? 'ScreenReader' : '');
  12456. var _ref46 = (_window$Node2 = window.Node) !== null && _window$Node2 !== void 0 ? _window$Node2 : {}, DOCUMENT_NODE = _ref46.DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE = _ref46.DOCUMENT_FRAGMENT_NODE;
  12457. var nodeType = vNode ? vNode.props.nodeType : el.nodeType;
  12458. var nodeName2 = vNode ? vNode.props.nodeName : el.nodeName.toLowerCase();
  12459. if (vNode && typeof vNode[cacheName] !== 'undefined') {
  12460. return vNode[cacheName];
  12461. }
  12462. if (nodeType === DOCUMENT_NODE) {
  12463. return true;
  12464. }
  12465. if ([ 'style', 'script', 'noscript', 'template' ].includes(nodeName2)) {
  12466. return false;
  12467. }
  12468. if (el && nodeType === DOCUMENT_FRAGMENT_NODE) {
  12469. el = el.host;
  12470. }
  12471. if (screenReader) {
  12472. var ariaHiddenValue = vNode ? vNode.attr('aria-hidden') : el.getAttribute('aria-hidden');
  12473. if (ariaHiddenValue === 'true') {
  12474. return false;
  12475. }
  12476. }
  12477. if (!el) {
  12478. var parent2 = vNode.parent;
  12479. var visible3 = true;
  12480. if (parent2) {
  12481. visible3 = isVisible(parent2, screenReader, true);
  12482. }
  12483. if (vNode) {
  12484. vNode[cacheName] = visible3;
  12485. }
  12486. return visible3;
  12487. }
  12488. var style = window.getComputedStyle(el, null);
  12489. if (style === null) {
  12490. return false;
  12491. }
  12492. if (nodeName2 === 'area') {
  12493. return isAreaVisible(el, screenReader, recursed);
  12494. }
  12495. if (style.getPropertyValue('display') === 'none') {
  12496. return false;
  12497. }
  12498. var elHeight = parseInt(style.getPropertyValue('height'));
  12499. var elWidth = parseInt(style.getPropertyValue('width'));
  12500. var scroll = _getScroll(el);
  12501. var scrollableWithZeroHeight = scroll && elHeight === 0;
  12502. var scrollableWithZeroWidth = scroll && elWidth === 0;
  12503. var posAbsoluteOverflowHiddenAndSmall = style.getPropertyValue('position') === 'absolute' && (elHeight < 2 || elWidth < 2) && style.getPropertyValue('overflow') === 'hidden';
  12504. if (!screenReader && (isClipped(style) || style.getPropertyValue('opacity') === '0' || scrollableWithZeroHeight || scrollableWithZeroWidth || posAbsoluteOverflowHiddenAndSmall)) {
  12505. return false;
  12506. }
  12507. if (!recursed && (style.getPropertyValue('visibility') === 'hidden' || !screenReader && is_offscreen_default(el))) {
  12508. return false;
  12509. }
  12510. var parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
  12511. var visible2 = false;
  12512. if (parent) {
  12513. visible2 = isVisible(parent, screenReader, true);
  12514. }
  12515. if (vNode) {
  12516. vNode[cacheName] = visible2;
  12517. }
  12518. return visible2;
  12519. }
  12520. var is_visible_default = isVisible;
  12521. function reduceToElementsBelowFloating(elements, targetNode) {
  12522. var floatingPositions = [ 'fixed', 'sticky' ];
  12523. var finalElements = [];
  12524. var targetFound = false;
  12525. for (var index = 0; index < elements.length; ++index) {
  12526. var currentNode = elements[index];
  12527. if (currentNode === targetNode) {
  12528. targetFound = true;
  12529. }
  12530. var style = window.getComputedStyle(currentNode);
  12531. if (!targetFound && floatingPositions.indexOf(style.position) !== -1) {
  12532. finalElements = [];
  12533. continue;
  12534. }
  12535. finalElements.push(currentNode);
  12536. }
  12537. return finalElements;
  12538. }
  12539. var reduce_to_elements_below_floating_default = reduceToElementsBelowFloating;
  12540. function _visuallyContains(node, parent) {
  12541. var parentScrollAncestor = getScrollAncestor(parent);
  12542. do {
  12543. var nextScrollAncestor = getScrollAncestor(node);
  12544. if (nextScrollAncestor === parentScrollAncestor || nextScrollAncestor === parent) {
  12545. return contains2(node, parent);
  12546. }
  12547. node = nextScrollAncestor;
  12548. } while (node);
  12549. return false;
  12550. }
  12551. function getScrollAncestor(node) {
  12552. var vNode = get_node_from_tree_default(node);
  12553. var ancestor = vNode.parent;
  12554. while (ancestor) {
  12555. if (_getScroll(ancestor.actualNode)) {
  12556. return ancestor.actualNode;
  12557. }
  12558. ancestor = ancestor.parent;
  12559. }
  12560. }
  12561. function contains2(node, parent) {
  12562. var style = window.getComputedStyle(parent);
  12563. var overflow = style.getPropertyValue('overflow');
  12564. if (style.getPropertyValue('display') === 'inline') {
  12565. return true;
  12566. }
  12567. var clientRects = Array.from(node.getClientRects());
  12568. var boundingRect = parent.getBoundingClientRect();
  12569. var rect = {
  12570. left: boundingRect.left,
  12571. top: boundingRect.top,
  12572. width: boundingRect.width,
  12573. height: boundingRect.height
  12574. };
  12575. if ([ 'scroll', 'auto' ].includes(overflow) || parent instanceof window.HTMLHtmlElement) {
  12576. rect.width = parent.scrollWidth;
  12577. rect.height = parent.scrollHeight;
  12578. }
  12579. if (clientRects.length === 1 && overflow === 'hidden' && style.getPropertyValue('white-space') === 'nowrap') {
  12580. clientRects[0] = rect;
  12581. }
  12582. return clientRects.some(function(clientRect) {
  12583. return !(Math.ceil(clientRect.left) < Math.floor(rect.left) || Math.ceil(clientRect.top) < Math.floor(rect.top) || Math.floor(clientRect.left + clientRect.width) > Math.ceil(rect.left + rect.width) || Math.floor(clientRect.top + clientRect.height) > Math.ceil(rect.top + rect.height));
  12584. });
  12585. }
  12586. function shadowElementsFromPoint(nodeX, nodeY) {
  12587. var root = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;
  12588. var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  12589. if (i > 999) {
  12590. throw new Error('Infinite loop detected');
  12591. }
  12592. return Array.from(root.elementsFromPoint(nodeX, nodeY) || []).filter(function(nodes) {
  12593. return get_root_node_default2(nodes) === root;
  12594. }).reduce(function(stack, elm) {
  12595. if (is_shadow_root_default(elm)) {
  12596. var shadowStack = shadowElementsFromPoint(nodeX, nodeY, elm.shadowRoot, i + 1);
  12597. stack = stack.concat(shadowStack);
  12598. if (stack.length && _visuallyContains(stack[0], elm)) {
  12599. stack.push(elm);
  12600. }
  12601. } else {
  12602. stack.push(elm);
  12603. }
  12604. return stack;
  12605. }, []);
  12606. }
  12607. var shadow_elements_from_point_default = shadowElementsFromPoint;
  12608. function urlPropsFromAttribute(node, attribute) {
  12609. if (!node.hasAttribute(attribute)) {
  12610. return void 0;
  12611. }
  12612. var nodeName2 = node.nodeName.toUpperCase();
  12613. var parser2 = node;
  12614. if (![ 'A', 'AREA' ].includes(nodeName2) || node.ownerSVGElement) {
  12615. parser2 = document.createElement('a');
  12616. parser2.href = node.getAttribute(attribute);
  12617. }
  12618. var protocol = [ 'https:', 'ftps:' ].includes(parser2.protocol) ? parser2.protocol.replace(/s:$/, ':') : parser2.protocol;
  12619. var parserPathname = /^\//.test(parser2.pathname) ? parser2.pathname : '/'.concat(parser2.pathname);
  12620. var _getPathnameOrFilenam = getPathnameOrFilename(parserPathname), pathname = _getPathnameOrFilenam.pathname, filename = _getPathnameOrFilenam.filename;
  12621. return {
  12622. protocol: protocol,
  12623. hostname: parser2.hostname,
  12624. port: getPort(parser2.port),
  12625. pathname: /\/$/.test(pathname) ? pathname : ''.concat(pathname, '/'),
  12626. search: getSearchPairs(parser2.search),
  12627. hash: getHashRoute(parser2.hash),
  12628. filename: filename
  12629. };
  12630. }
  12631. function getPort(port) {
  12632. var excludePorts = [ '443', '80' ];
  12633. return !excludePorts.includes(port) ? port : '';
  12634. }
  12635. function getPathnameOrFilename(pathname) {
  12636. var filename = pathname.split('/').pop();
  12637. if (!filename || filename.indexOf('.') === -1) {
  12638. return {
  12639. pathname: pathname,
  12640. filename: ''
  12641. };
  12642. }
  12643. return {
  12644. pathname: pathname.replace(filename, ''),
  12645. filename: /index./.test(filename) ? '' : filename
  12646. };
  12647. }
  12648. function getSearchPairs(searchStr) {
  12649. var query = {};
  12650. if (!searchStr || !searchStr.length) {
  12651. return query;
  12652. }
  12653. var pairs = searchStr.substring(1).split('&');
  12654. if (!pairs || !pairs.length) {
  12655. return query;
  12656. }
  12657. for (var index = 0; index < pairs.length; index++) {
  12658. var pair = pairs[index];
  12659. var _pair$split = pair.split('='), _pair$split2 = _slicedToArray(_pair$split, 2), key = _pair$split2[0], _pair$split2$ = _pair$split2[1], value = _pair$split2$ === void 0 ? '' : _pair$split2$;
  12660. query[decodeURIComponent(key)] = decodeURIComponent(value);
  12661. }
  12662. return query;
  12663. }
  12664. function getHashRoute(hash) {
  12665. if (!hash) {
  12666. return '';
  12667. }
  12668. var hashRegex = /#!?\/?/g;
  12669. var hasMatch = hash.match(hashRegex);
  12670. if (!hasMatch) {
  12671. return '';
  12672. }
  12673. var _hasMatch = _slicedToArray(hasMatch, 1), matchedStr = _hasMatch[0];
  12674. if (matchedStr === '#') {
  12675. return '';
  12676. }
  12677. return hash;
  12678. }
  12679. var url_props_from_attribute_default = urlPropsFromAttribute;
  12680. function visuallyOverlaps(rect, parent) {
  12681. var parentRect = parent.getBoundingClientRect();
  12682. var parentTop = parentRect.top;
  12683. var parentLeft = parentRect.left;
  12684. var parentScrollArea = {
  12685. top: parentTop - parent.scrollTop,
  12686. bottom: parentTop - parent.scrollTop + parent.scrollHeight,
  12687. left: parentLeft - parent.scrollLeft,
  12688. right: parentLeft - parent.scrollLeft + parent.scrollWidth
  12689. };
  12690. if (rect.left > parentScrollArea.right && rect.left > parentRect.right || rect.top > parentScrollArea.bottom && rect.top > parentRect.bottom || rect.right < parentScrollArea.left && rect.right < parentRect.left || rect.bottom < parentScrollArea.top && rect.bottom < parentRect.top) {
  12691. return false;
  12692. }
  12693. var style = window.getComputedStyle(parent);
  12694. if (rect.left > parentRect.right || rect.top > parentRect.bottom) {
  12695. return style.overflow === 'scroll' || style.overflow === 'auto' || parent instanceof window.HTMLBodyElement || parent instanceof window.HTMLHtmlElement;
  12696. }
  12697. return true;
  12698. }
  12699. var visually_overlaps_default = visuallyOverlaps;
  12700. var isXHTMLGlobal;
  12701. var nodeIndex2 = 0;
  12702. var VirtualNode = function(_abstract_virtual_nod) {
  12703. _inherits(VirtualNode, _abstract_virtual_nod);
  12704. var _super = _createSuper(VirtualNode);
  12705. function VirtualNode(node, parent, shadowId) {
  12706. var _this;
  12707. _classCallCheck(this, VirtualNode);
  12708. _this = _super.call(this);
  12709. _this.shadowId = shadowId;
  12710. _this.children = [];
  12711. _this.actualNode = node;
  12712. _this.parent = parent;
  12713. if (!parent) {
  12714. nodeIndex2 = 0;
  12715. }
  12716. _this.nodeIndex = nodeIndex2++;
  12717. _this._isHidden = null;
  12718. _this._cache = {};
  12719. if (typeof isXHTMLGlobal === 'undefined') {
  12720. isXHTMLGlobal = is_xhtml_default(node.ownerDocument);
  12721. }
  12722. _this._isXHTML = isXHTMLGlobal;
  12723. if (node.nodeName.toLowerCase() === 'input') {
  12724. var type = node.getAttribute('type');
  12725. type = _this._isXHTML ? type : (type || '').toLowerCase();
  12726. if (!valid_input_type_default().includes(type)) {
  12727. type = 'text';
  12728. }
  12729. _this._type = type;
  12730. }
  12731. if (cache_default.get('nodeMap')) {
  12732. cache_default.get('nodeMap').set(node, _assertThisInitialized(_this));
  12733. }
  12734. return _this;
  12735. }
  12736. _createClass(VirtualNode, [ {
  12737. key: 'props',
  12738. get: function get() {
  12739. if (!this._cache.hasOwnProperty('props')) {
  12740. var _this$actualNode = this.actualNode, nodeType = _this$actualNode.nodeType, nodeName2 = _this$actualNode.nodeName, id = _this$actualNode.id, multiple = _this$actualNode.multiple, nodeValue = _this$actualNode.nodeValue, value = _this$actualNode.value, selected = _this$actualNode.selected;
  12741. this._cache.props = {
  12742. nodeType: nodeType,
  12743. nodeName: this._isXHTML ? nodeName2 : nodeName2.toLowerCase(),
  12744. id: id,
  12745. type: this._type,
  12746. multiple: multiple,
  12747. nodeValue: nodeValue,
  12748. value: value,
  12749. selected: selected
  12750. };
  12751. }
  12752. return this._cache.props;
  12753. }
  12754. }, {
  12755. key: 'attr',
  12756. value: function attr(attrName) {
  12757. if (typeof this.actualNode.getAttribute !== 'function') {
  12758. return null;
  12759. }
  12760. return this.actualNode.getAttribute(attrName);
  12761. }
  12762. }, {
  12763. key: 'hasAttr',
  12764. value: function hasAttr(attrName) {
  12765. if (typeof this.actualNode.hasAttribute !== 'function') {
  12766. return false;
  12767. }
  12768. return this.actualNode.hasAttribute(attrName);
  12769. }
  12770. }, {
  12771. key: 'attrNames',
  12772. get: function get() {
  12773. if (!this._cache.hasOwnProperty('attrNames')) {
  12774. var attrs;
  12775. if (this.actualNode.attributes instanceof window.NamedNodeMap) {
  12776. attrs = this.actualNode.attributes;
  12777. } else {
  12778. attrs = this.actualNode.cloneNode(false).attributes;
  12779. }
  12780. this._cache.attrNames = Array.from(attrs).map(function(attr) {
  12781. return attr.name;
  12782. });
  12783. }
  12784. return this._cache.attrNames;
  12785. }
  12786. }, {
  12787. key: 'getComputedStylePropertyValue',
  12788. value: function getComputedStylePropertyValue(property) {
  12789. var key = 'computedStyle_' + property;
  12790. if (!this._cache.hasOwnProperty(key)) {
  12791. if (!this._cache.hasOwnProperty('computedStyle')) {
  12792. this._cache.computedStyle = window.getComputedStyle(this.actualNode);
  12793. }
  12794. this._cache[key] = this._cache.computedStyle.getPropertyValue(property);
  12795. }
  12796. return this._cache[key];
  12797. }
  12798. }, {
  12799. key: 'isFocusable',
  12800. get: function get() {
  12801. if (!this._cache.hasOwnProperty('isFocusable')) {
  12802. this._cache.isFocusable = _isFocusable(this.actualNode);
  12803. }
  12804. return this._cache.isFocusable;
  12805. }
  12806. }, {
  12807. key: 'tabbableElements',
  12808. get: function get() {
  12809. if (!this._cache.hasOwnProperty('tabbableElements')) {
  12810. this._cache.tabbableElements = get_tabbable_elements_default(this);
  12811. }
  12812. return this._cache.tabbableElements;
  12813. }
  12814. }, {
  12815. key: 'clientRects',
  12816. get: function get() {
  12817. if (!this._cache.hasOwnProperty('clientRects')) {
  12818. this._cache.clientRects = Array.from(this.actualNode.getClientRects()).filter(function(rect) {
  12819. return rect.width > 0;
  12820. });
  12821. }
  12822. return this._cache.clientRects;
  12823. }
  12824. }, {
  12825. key: 'boundingClientRect',
  12826. get: function get() {
  12827. if (!this._cache.hasOwnProperty('boundingClientRect')) {
  12828. this._cache.boundingClientRect = this.actualNode.getBoundingClientRect();
  12829. }
  12830. return this._cache.boundingClientRect;
  12831. }
  12832. } ]);
  12833. return VirtualNode;
  12834. }(abstract_virtual_node_default);
  12835. var virtual_node_default = VirtualNode;
  12836. function tokenList(str) {
  12837. return (str || '').trim().replace(/\s{2,}/g, ' ').split(' ');
  12838. }
  12839. var token_list_default = tokenList;
  12840. var idsKey = ' [idsMap]';
  12841. function getNodesMatchingExpression(domTree, expressions, filter) {
  12842. var selectorMap = domTree[0]._selectorMap;
  12843. if (!selectorMap) {
  12844. return;
  12845. }
  12846. var shadowId = domTree[0].shadowId;
  12847. for (var _i10 = 0; _i10 < expressions.length; _i10++) {
  12848. if (expressions[_i10].length > 1 && expressions[_i10].some(function(expression) {
  12849. return isGlobalSelector(expression);
  12850. })) {
  12851. return;
  12852. }
  12853. }
  12854. var nodeSet = new Set();
  12855. expressions.forEach(function(expression) {
  12856. var _matchingNodes$nodes;
  12857. var matchingNodes = findMatchingNodes(expression, selectorMap, shadowId);
  12858. matchingNodes === null || matchingNodes === void 0 ? void 0 : (_matchingNodes$nodes = matchingNodes.nodes) === null || _matchingNodes$nodes === void 0 ? void 0 : _matchingNodes$nodes.forEach(function(node) {
  12859. if (matchingNodes.isComplexSelector && !_matchesExpression(node, expression)) {
  12860. return;
  12861. }
  12862. nodeSet.add(node);
  12863. });
  12864. });
  12865. var matchedNodes = [];
  12866. nodeSet.forEach(function(node) {
  12867. return matchedNodes.push(node);
  12868. });
  12869. if (filter) {
  12870. matchedNodes = matchedNodes.filter(filter);
  12871. }
  12872. return matchedNodes.sort(function(a, b) {
  12873. return a.nodeIndex - b.nodeIndex;
  12874. });
  12875. }
  12876. function findMatchingNodes(expression, selectorMap, shadowId) {
  12877. var exp = expression[expression.length - 1];
  12878. var nodes = null;
  12879. var isComplexSelector = expression.length > 1 || !!exp.pseudos || !!exp.classes;
  12880. if (isGlobalSelector(exp)) {
  12881. nodes = selectorMap['*'];
  12882. } else {
  12883. if (exp.id) {
  12884. var _selectorMap$idsKey$e;
  12885. if (!selectorMap[idsKey] || !((_selectorMap$idsKey$e = selectorMap[idsKey][exp.id]) !== null && _selectorMap$idsKey$e !== void 0 && _selectorMap$idsKey$e.length)) {
  12886. return;
  12887. }
  12888. nodes = selectorMap[idsKey][exp.id].filter(function(node) {
  12889. return node.shadowId === shadowId;
  12890. });
  12891. }
  12892. if (exp.tag && exp.tag !== '*') {
  12893. var _selectorMap$exp$tag;
  12894. if (!((_selectorMap$exp$tag = selectorMap[exp.tag]) !== null && _selectorMap$exp$tag !== void 0 && _selectorMap$exp$tag.length)) {
  12895. return;
  12896. }
  12897. var cachedNodes = selectorMap[exp.tag];
  12898. nodes = nodes ? getSharedValues(cachedNodes, nodes) : cachedNodes;
  12899. }
  12900. if (exp.classes) {
  12901. var _selectorMap$Class;
  12902. if (!((_selectorMap$Class = selectorMap['[class]']) !== null && _selectorMap$Class !== void 0 && _selectorMap$Class.length)) {
  12903. return;
  12904. }
  12905. var _cachedNodes = selectorMap['[class]'];
  12906. nodes = nodes ? getSharedValues(_cachedNodes, nodes) : _cachedNodes;
  12907. }
  12908. if (exp.attributes) {
  12909. for (var _i11 = 0; _i11 < exp.attributes.length; _i11++) {
  12910. var _selectorMap;
  12911. var attr = exp.attributes[_i11];
  12912. if (attr.type === 'attrValue') {
  12913. isComplexSelector = true;
  12914. }
  12915. if (!((_selectorMap = selectorMap['['.concat(attr.key, ']')]) !== null && _selectorMap !== void 0 && _selectorMap.length)) {
  12916. return;
  12917. }
  12918. var _cachedNodes2 = selectorMap['['.concat(attr.key, ']')];
  12919. nodes = nodes ? getSharedValues(_cachedNodes2, nodes) : _cachedNodes2;
  12920. }
  12921. }
  12922. }
  12923. return {
  12924. nodes: nodes,
  12925. isComplexSelector: isComplexSelector
  12926. };
  12927. }
  12928. function isGlobalSelector(expression) {
  12929. return expression.tag === '*' && !expression.attributes && !expression.id && !expression.classes;
  12930. }
  12931. function getSharedValues(a, b) {
  12932. return a.filter(function(node) {
  12933. return b.includes(node);
  12934. });
  12935. }
  12936. function cacheSelector(key, vNode, map) {
  12937. map[key] = map[key] || [];
  12938. map[key].push(vNode);
  12939. }
  12940. function cacheNodeSelectors(vNode, selectorMap) {
  12941. if (vNode.props.nodeType !== 1) {
  12942. return;
  12943. }
  12944. cacheSelector(vNode.props.nodeName, vNode, selectorMap);
  12945. cacheSelector('*', vNode, selectorMap);
  12946. vNode.attrNames.forEach(function(attrName) {
  12947. if (attrName === 'id') {
  12948. selectorMap[idsKey] = selectorMap[idsKey] || {};
  12949. token_list_default(vNode.attr(attrName)).forEach(function(value) {
  12950. cacheSelector(value, vNode, selectorMap[idsKey]);
  12951. });
  12952. }
  12953. cacheSelector('['.concat(attrName, ']'), vNode, selectorMap);
  12954. });
  12955. }
  12956. var hasShadowRoot;
  12957. function getSlotChildren(node) {
  12958. var retVal = [];
  12959. node = node.firstChild;
  12960. while (node) {
  12961. retVal.push(node);
  12962. node = node.nextSibling;
  12963. }
  12964. return retVal;
  12965. }
  12966. function createNode(node, parent, shadowId) {
  12967. var vNode = new virtual_node_default(node, parent, shadowId);
  12968. cacheNodeSelectors(vNode, cache_default.get('selectorMap'));
  12969. return vNode;
  12970. }
  12971. function flattenTree(node, shadowId, parent) {
  12972. var retVal, realArray, nodeName2;
  12973. function reduceShadowDOM(res, child, parent2) {
  12974. var replacements = flattenTree(child, shadowId, parent2);
  12975. if (replacements) {
  12976. res = res.concat(replacements);
  12977. }
  12978. return res;
  12979. }
  12980. if (node.documentElement) {
  12981. node = node.documentElement;
  12982. }
  12983. nodeName2 = node.nodeName.toLowerCase();
  12984. if (is_shadow_root_default(node)) {
  12985. hasShadowRoot = true;
  12986. retVal = createNode(node, parent, shadowId);
  12987. shadowId = 'a' + Math.random().toString().substring(2);
  12988. realArray = Array.from(node.shadowRoot.childNodes);
  12989. retVal.children = realArray.reduce(function(res, child) {
  12990. return reduceShadowDOM(res, child, retVal);
  12991. }, []);
  12992. return [ retVal ];
  12993. } else {
  12994. if (nodeName2 === 'content' && typeof node.getDistributedNodes === 'function') {
  12995. realArray = Array.from(node.getDistributedNodes());
  12996. return realArray.reduce(function(res, child) {
  12997. return reduceShadowDOM(res, child, parent);
  12998. }, []);
  12999. } else if (nodeName2 === 'slot' && typeof node.assignedNodes === 'function') {
  13000. realArray = Array.from(node.assignedNodes());
  13001. if (!realArray.length) {
  13002. realArray = getSlotChildren(node);
  13003. }
  13004. var styl = window.getComputedStyle(node);
  13005. if (false) {
  13006. retVal = createNode(node, parent, shadowId);
  13007. retVal.children = realArray.reduce(function(res, child) {
  13008. return reduceShadowDOM(res, child, retVal);
  13009. }, []);
  13010. return [ retVal ];
  13011. } else {
  13012. return realArray.reduce(function(res, child) {
  13013. return reduceShadowDOM(res, child, parent);
  13014. }, []);
  13015. }
  13016. } else {
  13017. if (node.nodeType === 1) {
  13018. retVal = createNode(node, parent, shadowId);
  13019. realArray = Array.from(node.childNodes);
  13020. retVal.children = realArray.reduce(function(res, child) {
  13021. return reduceShadowDOM(res, child, retVal);
  13022. }, []);
  13023. return [ retVal ];
  13024. } else if (node.nodeType === 3) {
  13025. return [ createNode(node, parent) ];
  13026. }
  13027. return void 0;
  13028. }
  13029. }
  13030. }
  13031. function getFlattenedTree() {
  13032. var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement;
  13033. var shadowId = arguments.length > 1 ? arguments[1] : undefined;
  13034. hasShadowRoot = false;
  13035. var selectorMap = {};
  13036. cache_default.set('nodeMap', new WeakMap());
  13037. cache_default.set('selectorMap', selectorMap);
  13038. var tree = flattenTree(node, shadowId, null);
  13039. tree[0]._selectorMap = selectorMap;
  13040. tree[0]._hasShadowRoot = hasShadowRoot;
  13041. return tree;
  13042. }
  13043. var get_flattened_tree_default = getFlattenedTree;
  13044. function getBaseLang(lang) {
  13045. if (!lang) {
  13046. return '';
  13047. }
  13048. return lang.trim().split('-')[0].toLowerCase();
  13049. }
  13050. var get_base_lang_default = getBaseLang;
  13051. function failureSummary(nodeData) {
  13052. var failingChecks = {};
  13053. failingChecks.none = nodeData.none.concat(nodeData.all);
  13054. failingChecks.any = nodeData.any;
  13055. return Object.keys(failingChecks).map(function(key) {
  13056. if (!failingChecks[key].length) {
  13057. return;
  13058. }
  13059. var sum = axe._audit.data.failureSummaries[key];
  13060. if (sum && typeof sum.failureMessage === 'function') {
  13061. return sum.failureMessage(failingChecks[key].map(function(check) {
  13062. return check.message || '';
  13063. }));
  13064. }
  13065. }).filter(function(i) {
  13066. return i !== void 0;
  13067. }).join('\n\n');
  13068. }
  13069. var failure_summary_default = failureSummary;
  13070. function incompleteFallbackMessage() {
  13071. var incompleteFallbackMessage2 = axe._audit.data.incompleteFallbackMessage;
  13072. if (typeof incompleteFallbackMessage2 === 'function') {
  13073. incompleteFallbackMessage2 = incompleteFallbackMessage2();
  13074. }
  13075. if (typeof incompleteFallbackMessage2 !== 'string') {
  13076. return '';
  13077. }
  13078. return incompleteFallbackMessage2;
  13079. }
  13080. function normalizeRelatedNodes(node, options) {
  13081. [ 'any', 'all', 'none' ].forEach(function(type) {
  13082. if (!Array.isArray(node[type])) {
  13083. return;
  13084. }
  13085. node[type].filter(function(checkRes) {
  13086. return Array.isArray(checkRes.relatedNodes);
  13087. }).forEach(function(checkRes) {
  13088. checkRes.relatedNodes = checkRes.relatedNodes.map(function(relatedNode) {
  13089. var _relatedNode$source;
  13090. var res = {
  13091. html: (_relatedNode$source = relatedNode === null || relatedNode === void 0 ? void 0 : relatedNode.source) !== null && _relatedNode$source !== void 0 ? _relatedNode$source : 'Undefined'
  13092. };
  13093. if (options.elementRef && !(relatedNode !== null && relatedNode !== void 0 && relatedNode.fromFrame)) {
  13094. var _relatedNode$element;
  13095. res.element = (_relatedNode$element = relatedNode === null || relatedNode === void 0 ? void 0 : relatedNode.element) !== null && _relatedNode$element !== void 0 ? _relatedNode$element : null;
  13096. }
  13097. if (options.selectors !== false || relatedNode !== null && relatedNode !== void 0 && relatedNode.fromFrame) {
  13098. var _relatedNode$selector;
  13099. res.target = (_relatedNode$selector = relatedNode === null || relatedNode === void 0 ? void 0 : relatedNode.selector) !== null && _relatedNode$selector !== void 0 ? _relatedNode$selector : [ ':root' ];
  13100. }
  13101. if (options.ancestry) {
  13102. var _relatedNode$ancestry;
  13103. res.ancestry = (_relatedNode$ancestry = relatedNode === null || relatedNode === void 0 ? void 0 : relatedNode.ancestry) !== null && _relatedNode$ancestry !== void 0 ? _relatedNode$ancestry : [ ':root' ];
  13104. }
  13105. if (options.xpath) {
  13106. var _relatedNode$xpath;
  13107. res.xpath = (_relatedNode$xpath = relatedNode === null || relatedNode === void 0 ? void 0 : relatedNode.xpath) !== null && _relatedNode$xpath !== void 0 ? _relatedNode$xpath : [ '/' ];
  13108. }
  13109. return res;
  13110. });
  13111. });
  13112. });
  13113. }
  13114. var resultKeys = constants_default.resultGroups;
  13115. function processAggregate(results, options) {
  13116. var resultObject = axe.utils.aggregateResult(results);
  13117. resultKeys.forEach(function(key) {
  13118. if (options.resultTypes && !options.resultTypes.includes(key)) {
  13119. (resultObject[key] || []).forEach(function(ruleResult) {
  13120. if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
  13121. ruleResult.nodes = [ ruleResult.nodes[0] ];
  13122. }
  13123. });
  13124. }
  13125. resultObject[key] = (resultObject[key] || []).map(function(ruleResult) {
  13126. ruleResult = Object.assign({}, ruleResult);
  13127. if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
  13128. ruleResult.nodes = ruleResult.nodes.map(function(subResult) {
  13129. if (_typeof(subResult.node) === 'object') {
  13130. subResult.html = subResult.node.source;
  13131. if (options.elementRef && !subResult.node.fromFrame) {
  13132. subResult.element = subResult.node.element;
  13133. }
  13134. if (options.selectors !== false || subResult.node.fromFrame) {
  13135. subResult.target = subResult.node.selector;
  13136. }
  13137. if (options.ancestry) {
  13138. subResult.ancestry = subResult.node.ancestry;
  13139. }
  13140. if (options.xpath) {
  13141. subResult.xpath = subResult.node.xpath;
  13142. }
  13143. }
  13144. delete subResult.result;
  13145. delete subResult.node;
  13146. normalizeRelatedNodes(subResult, options);
  13147. return subResult;
  13148. });
  13149. }
  13150. resultKeys.forEach(function(key2) {
  13151. return delete ruleResult[key2];
  13152. });
  13153. delete ruleResult.pageLevel;
  13154. delete ruleResult.result;
  13155. return ruleResult;
  13156. });
  13157. });
  13158. return resultObject;
  13159. }
  13160. var process_aggregate_default = processAggregate;
  13161. var dataRegex = /\$\{\s?data\s?\}/g;
  13162. function substitute(str, data2) {
  13163. if (typeof data2 === 'string') {
  13164. return str.replace(dataRegex, data2);
  13165. }
  13166. for (var prop in data2) {
  13167. if (data2.hasOwnProperty(prop)) {
  13168. var regex = new RegExp('\\${\\s?data\\.' + prop + '\\s?}', 'g');
  13169. var replace = typeof data2[prop] === 'undefined' ? '' : String(data2[prop]);
  13170. str = str.replace(regex, replace);
  13171. }
  13172. }
  13173. return str;
  13174. }
  13175. function processMessage(message, data2) {
  13176. if (!message) {
  13177. return;
  13178. }
  13179. if (Array.isArray(data2)) {
  13180. data2.values = data2.join(', ');
  13181. if (typeof message.singular === 'string' && typeof message.plural === 'string') {
  13182. var str2 = data2.length === 1 ? message.singular : message.plural;
  13183. return substitute(str2, data2);
  13184. }
  13185. return substitute(message, data2);
  13186. }
  13187. if (typeof message === 'string') {
  13188. return substitute(message, data2);
  13189. }
  13190. if (typeof data2 === 'string') {
  13191. var _str = message[data2];
  13192. return substitute(_str, data2);
  13193. }
  13194. var str = message['default'] || incompleteFallbackMessage();
  13195. if (data2 && data2.messageKey && message[data2.messageKey]) {
  13196. str = message[data2.messageKey];
  13197. }
  13198. return processMessage(str, data2);
  13199. }
  13200. var process_message_default = processMessage;
  13201. function getCheckMessage(checkId, type, data2) {
  13202. var check = axe._audit.data.checks[checkId];
  13203. if (!check) {
  13204. throw new Error('Cannot get message for unknown check: '.concat(checkId, '.'));
  13205. }
  13206. if (!check.messages[type]) {
  13207. throw new Error('Check "'.concat(checkId, '"" does not have a "').concat(type, '" message.'));
  13208. }
  13209. return process_message_default(check.messages[type], data2);
  13210. }
  13211. var get_check_message_default = getCheckMessage;
  13212. function getCheckOption(check, ruleID, options) {
  13213. var ruleCheckOption = ((options.rules && options.rules[ruleID] || {}).checks || {})[check.id];
  13214. var checkOption = (options.checks || {})[check.id];
  13215. var enabled = check.enabled;
  13216. var opts = check.options;
  13217. if (checkOption) {
  13218. if (checkOption.hasOwnProperty('enabled')) {
  13219. enabled = checkOption.enabled;
  13220. }
  13221. if (checkOption.hasOwnProperty('options')) {
  13222. opts = checkOption.options;
  13223. }
  13224. }
  13225. if (ruleCheckOption) {
  13226. if (ruleCheckOption.hasOwnProperty('enabled')) {
  13227. enabled = ruleCheckOption.enabled;
  13228. }
  13229. if (ruleCheckOption.hasOwnProperty('options')) {
  13230. opts = ruleCheckOption.options;
  13231. }
  13232. }
  13233. return {
  13234. enabled: enabled,
  13235. options: opts,
  13236. absolutePaths: options.absolutePaths
  13237. };
  13238. }
  13239. var get_check_option_default = getCheckOption;
  13240. function _getEnvironmentData() {
  13241. var _win$location;
  13242. var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  13243. var win = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
  13244. if (metadata && _typeof(metadata) === 'object') {
  13245. return metadata;
  13246. } else if (_typeof(win) !== 'object') {
  13247. return {};
  13248. }
  13249. return {
  13250. testEngine: {
  13251. name: 'axe-core',
  13252. version: axe.version
  13253. },
  13254. testRunner: {
  13255. name: axe._audit.brand
  13256. },
  13257. testEnvironment: getTestEnvironment(win),
  13258. timestamp: new Date().toISOString(),
  13259. url: (_win$location = win.location) === null || _win$location === void 0 ? void 0 : _win$location.href
  13260. };
  13261. }
  13262. function getTestEnvironment(win) {
  13263. if (!win.navigator || _typeof(win.navigator) !== 'object') {
  13264. return {};
  13265. }
  13266. var navigator = win.navigator, innerHeight = win.innerHeight, innerWidth = win.innerWidth;
  13267. var _ref47 = getOrientation(win) || {}, angle = _ref47.angle, type = _ref47.type;
  13268. return {
  13269. userAgent: navigator.userAgent,
  13270. windowWidth: innerWidth,
  13271. windowHeight: innerHeight,
  13272. orientationAngle: angle,
  13273. orientationType: type
  13274. };
  13275. }
  13276. function getOrientation(_ref48) {
  13277. var screen = _ref48.screen;
  13278. return screen.orientation || screen.msOrientation || screen.mozOrientation;
  13279. }
  13280. function createFrameContext(frame, _ref49) {
  13281. var focusable = _ref49.focusable, page = _ref49.page;
  13282. return {
  13283. node: frame,
  13284. include: [],
  13285. exclude: [],
  13286. initiator: false,
  13287. focusable: focusable && frameFocusable(frame),
  13288. size: getBoundingSize(frame),
  13289. page: page
  13290. };
  13291. }
  13292. function frameFocusable(frame) {
  13293. var tabIndex = frame.getAttribute('tabindex');
  13294. if (!tabIndex) {
  13295. return true;
  13296. }
  13297. var _int = parseInt(tabIndex, 10);
  13298. return isNaN(_int) || _int >= 0;
  13299. }
  13300. function getBoundingSize(domNode) {
  13301. var width = parseInt(domNode.getAttribute('width'), 10);
  13302. var height = parseInt(domNode.getAttribute('height'), 10);
  13303. if (isNaN(width) || isNaN(height)) {
  13304. var rect = domNode.getBoundingClientRect();
  13305. width = isNaN(width) ? rect.width : width;
  13306. height = isNaN(height) ? rect.height : height;
  13307. }
  13308. return {
  13309. width: width,
  13310. height: height
  13311. };
  13312. }
  13313. function normalizeContext(contextSpec) {
  13314. if (isContextObject(contextSpec)) {
  13315. var msg = ' must be used inside include or exclude. It should not be on the same object.';
  13316. assert2(!objectHasOwn(contextSpec, 'fromFrames'), 'fromFrames' + msg);
  13317. assert2(!objectHasOwn(contextSpec, 'fromShadowDom'), 'fromShadowDom' + msg);
  13318. } else if (isContextProp(contextSpec)) {
  13319. contextSpec = {
  13320. include: contextSpec,
  13321. exclude: []
  13322. };
  13323. } else {
  13324. return {
  13325. include: [ document ],
  13326. exclude: []
  13327. };
  13328. }
  13329. var include = normalizeContextList(contextSpec.include);
  13330. if (include.length === 0) {
  13331. include.push(document);
  13332. }
  13333. var exclude = normalizeContextList(contextSpec.exclude);
  13334. return {
  13335. include: include,
  13336. exclude: exclude
  13337. };
  13338. }
  13339. function isContextSpec(contextSpec) {
  13340. return isContextObject(contextSpec) || isContextProp(contextSpec);
  13341. }
  13342. function normalizeContextList() {
  13343. var selectorList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  13344. var normalizedList = [];
  13345. if (!isArrayLike(selectorList)) {
  13346. selectorList = [ selectorList ];
  13347. }
  13348. for (var _i12 = 0; _i12 < selectorList.length; _i12++) {
  13349. var normalizedSelector = normalizeContextSelector(selectorList[_i12]);
  13350. if (normalizedSelector) {
  13351. normalizedList.push(normalizedSelector);
  13352. }
  13353. }
  13354. return normalizedList;
  13355. }
  13356. function normalizeContextSelector(selector) {
  13357. if (selector instanceof window.Node) {
  13358. return selector;
  13359. }
  13360. if (typeof selector === 'string') {
  13361. return [ selector ];
  13362. }
  13363. if (isLabelledFramesSelector(selector)) {
  13364. assertLabelledFrameSelector(selector);
  13365. selector = selector.fromFrames;
  13366. } else if (isLabelledShadowDomSelector(selector)) {
  13367. selector = [ selector ];
  13368. }
  13369. return normalizeFrameSelectors(selector);
  13370. }
  13371. function normalizeFrameSelectors(frameSelectors) {
  13372. if (!Array.isArray(frameSelectors)) {
  13373. return;
  13374. }
  13375. var normalizedSelectors = [];
  13376. var _iterator5 = _createForOfIteratorHelper(frameSelectors), _step5;
  13377. try {
  13378. for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
  13379. var selector = _step5.value;
  13380. if (isLabelledShadowDomSelector(selector)) {
  13381. assertLabelledShadowDomSelector(selector);
  13382. selector = selector.fromShadowDom;
  13383. }
  13384. if (typeof selector !== 'string' && !isShadowSelector(selector)) {
  13385. return;
  13386. }
  13387. normalizedSelectors.push(selector);
  13388. }
  13389. } catch (err) {
  13390. _iterator5.e(err);
  13391. } finally {
  13392. _iterator5.f();
  13393. }
  13394. return normalizedSelectors;
  13395. }
  13396. function isContextObject(contextSpec) {
  13397. return [ 'include', 'exclude' ].some(function(prop) {
  13398. return objectHasOwn(contextSpec, prop) && isContextProp(contextSpec[prop]);
  13399. });
  13400. }
  13401. function isContextProp(contextList) {
  13402. return typeof contextList === 'string' || contextList instanceof window.Node || isLabelledFramesSelector(contextList) || isLabelledShadowDomSelector(contextList) || isArrayLike(contextList);
  13403. }
  13404. function isLabelledFramesSelector(selector) {
  13405. return objectHasOwn(selector, 'fromFrames');
  13406. }
  13407. function isLabelledShadowDomSelector(selector) {
  13408. return objectHasOwn(selector, 'fromShadowDom');
  13409. }
  13410. function assertLabelledFrameSelector(selector) {
  13411. assert2(Array.isArray(selector.fromFrames), 'fromFrames property must be an array');
  13412. assert2(selector.fromFrames.every(function(selector2) {
  13413. return !objectHasOwn(selector2, 'fromFrames');
  13414. }), 'Invalid context; fromFrames selector must be appended, rather than nested');
  13415. assert2(!objectHasOwn(selector, 'fromShadowDom'), 'fromFrames and fromShadowDom cannot be used on the same object');
  13416. }
  13417. function assertLabelledShadowDomSelector(selector) {
  13418. assert2(Array.isArray(selector.fromShadowDom), 'fromShadowDom property must be an array');
  13419. assert2(selector.fromShadowDom.every(function(selector2) {
  13420. return !objectHasOwn(selector2, 'fromFrames');
  13421. }), 'shadow selector must be inside fromFrame instead');
  13422. assert2(selector.fromShadowDom.every(function(selector2) {
  13423. return !objectHasOwn(selector2, 'fromShadowDom');
  13424. }), 'fromShadowDom selector must be appended, rather than nested');
  13425. }
  13426. function isShadowSelector(selector) {
  13427. return Array.isArray(selector) && selector.every(function(str) {
  13428. return typeof str === 'string';
  13429. });
  13430. }
  13431. function isArrayLike(arr) {
  13432. return arr && _typeof(arr) === 'object' && typeof arr.length === 'number' && arr instanceof window.Node === false;
  13433. }
  13434. function assert2(bool, str) {
  13435. assert_default(bool, 'Invalid context; '.concat(str, '\nSee: https://github.com/dequelabs/axe-core/blob/master/doc/context.md'));
  13436. }
  13437. function objectHasOwn(obj, prop) {
  13438. if (!obj || _typeof(obj) !== 'object') {
  13439. return false;
  13440. }
  13441. return Object.prototype.hasOwnProperty.call(obj, prop);
  13442. }
  13443. function parseSelectorArray(context, type) {
  13444. var result = [];
  13445. for (var _i13 = 0, l = context[type].length; _i13 < l; _i13++) {
  13446. var item = context[type][_i13];
  13447. if (item instanceof window.Node) {
  13448. if (item.documentElement instanceof window.Node) {
  13449. result.push(context.flatTree[0]);
  13450. } else {
  13451. result.push(get_node_from_tree_default(item));
  13452. }
  13453. } else if (item && item.length) {
  13454. if (item.length > 1) {
  13455. pushUniqueFrameSelector(context, type, item);
  13456. } else {
  13457. var nodeList = _shadowSelectAll(item[0]);
  13458. result.push.apply(result, _toConsumableArray(nodeList.map(function(node) {
  13459. return get_node_from_tree_default(node);
  13460. })));
  13461. }
  13462. }
  13463. }
  13464. return result.filter(function(r) {
  13465. return r;
  13466. });
  13467. }
  13468. function pushUniqueFrameSelector(context, type, selectorArray) {
  13469. context.frames = context.frames || [];
  13470. var frameSelector = selectorArray.shift();
  13471. var frames = _shadowSelectAll(frameSelector);
  13472. frames.forEach(function(frame) {
  13473. var frameContext = context.frames.find(function(result) {
  13474. return result.node === frame;
  13475. });
  13476. if (!frameContext) {
  13477. frameContext = createFrameContext(frame, context);
  13478. context.frames.push(frameContext);
  13479. }
  13480. frameContext[type].push(selectorArray);
  13481. });
  13482. }
  13483. function Context(spec, flatTree) {
  13484. var _spec, _spec2, _spec3, _spec4, _this2 = this;
  13485. spec = clone_default(spec);
  13486. this.frames = [];
  13487. this.page = typeof ((_spec = spec) === null || _spec === void 0 ? void 0 : _spec.page) === 'boolean' ? spec.page : void 0;
  13488. this.initiator = typeof ((_spec2 = spec) === null || _spec2 === void 0 ? void 0 : _spec2.initiator) === 'boolean' ? spec.initiator : true;
  13489. this.focusable = typeof ((_spec3 = spec) === null || _spec3 === void 0 ? void 0 : _spec3.focusable) === 'boolean' ? spec.focusable : true;
  13490. this.size = _typeof((_spec4 = spec) === null || _spec4 === void 0 ? void 0 : _spec4.size) === 'object' ? spec.size : {};
  13491. spec = normalizeContext(spec);
  13492. this.flatTree = flatTree !== null && flatTree !== void 0 ? flatTree : get_flattened_tree_default(getRootNode2(spec));
  13493. this.exclude = spec.exclude;
  13494. this.include = spec.include;
  13495. this.include = parseSelectorArray(this, 'include');
  13496. this.exclude = parseSelectorArray(this, 'exclude');
  13497. _select('frame, iframe', this).forEach(function(frame) {
  13498. if (_isNodeInContext(frame, _this2)) {
  13499. pushUniqueFrame(_this2, frame.actualNode);
  13500. }
  13501. });
  13502. if (typeof this.page === 'undefined') {
  13503. this.page = isPageContext(this);
  13504. this.frames.forEach(function(frame) {
  13505. frame.page = _this2.page;
  13506. });
  13507. }
  13508. validateContext(this);
  13509. if (!Array.isArray(this.include)) {
  13510. this.include = Array.from(this.include);
  13511. }
  13512. this.include.sort(node_sorter_default);
  13513. }
  13514. function pushUniqueFrame(context, frame) {
  13515. if (!_isVisibleToScreenReaders(frame) || find_by_default(context.frames, 'node', frame)) {
  13516. return;
  13517. }
  13518. context.frames.push(createFrameContext(frame, context));
  13519. }
  13520. function isPageContext(_ref50) {
  13521. var include = _ref50.include;
  13522. return include.length === 1 && include[0].actualNode === document.documentElement;
  13523. }
  13524. function validateContext(context) {
  13525. if (context.include.length === 0 && context.frames.length === 0) {
  13526. var env = _respondable.isInFrame() ? 'frame' : 'page';
  13527. throw new Error('No elements found for include in ' + env + ' Context');
  13528. }
  13529. }
  13530. function getRootNode2(_ref51) {
  13531. var include = _ref51.include, exclude = _ref51.exclude;
  13532. var selectors = Array.from(include).concat(Array.from(exclude));
  13533. for (var _i14 = 0; _i14 < selectors.length; _i14++) {
  13534. var item = selectors[_i14];
  13535. if (item instanceof window.Element) {
  13536. return item.ownerDocument.documentElement;
  13537. }
  13538. if (item instanceof window.Document) {
  13539. return item.documentElement;
  13540. }
  13541. }
  13542. return document.documentElement;
  13543. }
  13544. function _getFrameContexts(context) {
  13545. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13546. if (options.iframes === false) {
  13547. return [];
  13548. }
  13549. var _Context = new Context(context), frames = _Context.frames;
  13550. return frames.map(function(_ref52) {
  13551. var node = _ref52.node, frameContext = _objectWithoutProperties(_ref52, _excluded7);
  13552. frameContext.initiator = false;
  13553. var frameSelector = _getAncestry(node);
  13554. return {
  13555. frameSelector: frameSelector,
  13556. frameContext: frameContext
  13557. };
  13558. });
  13559. }
  13560. function getRule(ruleId) {
  13561. var rule = axe._audit.rules.find(function(rule2) {
  13562. return rule2.id === ruleId;
  13563. });
  13564. if (!rule) {
  13565. throw new Error('Cannot find rule by id: '.concat(ruleId));
  13566. }
  13567. return rule;
  13568. }
  13569. var get_rule_default = getRule;
  13570. function _getScroll(elm) {
  13571. var buffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  13572. var overflowX = elm.scrollWidth > elm.clientWidth + buffer;
  13573. var overflowY = elm.scrollHeight > elm.clientHeight + buffer;
  13574. if (!(overflowX || overflowY)) {
  13575. return;
  13576. }
  13577. var style = window.getComputedStyle(elm);
  13578. var scrollableX = isScrollable(style, 'overflow-x');
  13579. var scrollableY = isScrollable(style, 'overflow-y');
  13580. if (overflowX && scrollableX || overflowY && scrollableY) {
  13581. return {
  13582. elm: elm,
  13583. top: elm.scrollTop,
  13584. left: elm.scrollLeft
  13585. };
  13586. }
  13587. }
  13588. function isScrollable(style, prop) {
  13589. var overflowProp = style.getPropertyValue(prop);
  13590. return [ 'scroll', 'auto' ].includes(overflowProp);
  13591. }
  13592. function getElmScrollRecursive(root) {
  13593. return Array.from(root.children || root.childNodes || []).reduce(function(scrolls, elm) {
  13594. var scroll = _getScroll(elm);
  13595. if (scroll) {
  13596. scrolls.push(scroll);
  13597. }
  13598. return scrolls.concat(getElmScrollRecursive(elm));
  13599. }, []);
  13600. }
  13601. function getScrollState() {
  13602. var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  13603. var root = win.document.documentElement;
  13604. var windowScroll = [ win.pageXOffset !== void 0 ? {
  13605. elm: win,
  13606. top: win.pageYOffset,
  13607. left: win.pageXOffset
  13608. } : {
  13609. elm: root,
  13610. top: root.scrollTop,
  13611. left: root.scrollLeft
  13612. } ];
  13613. return windowScroll.concat(getElmScrollRecursive(document.body));
  13614. }
  13615. var get_scroll_state_default = getScrollState;
  13616. function _getStandards() {
  13617. return clone_default(standards_default);
  13618. }
  13619. function getStyleSheetFactory(dynamicDoc) {
  13620. if (!dynamicDoc) {
  13621. throw new Error('axe.utils.getStyleSheetFactory should be invoked with an argument');
  13622. }
  13623. return function(options) {
  13624. var data2 = options.data, _options$isCrossOrigi = options.isCrossOrigin, isCrossOrigin = _options$isCrossOrigi === void 0 ? false : _options$isCrossOrigi, shadowId = options.shadowId, root = options.root, priority = options.priority, _options$isLink = options.isLink, isLink = _options$isLink === void 0 ? false : _options$isLink;
  13625. var style = dynamicDoc.createElement('style');
  13626. if (isLink) {
  13627. var text = dynamicDoc.createTextNode('@import "'.concat(data2.href, '"'));
  13628. style.appendChild(text);
  13629. } else {
  13630. style.appendChild(dynamicDoc.createTextNode(data2));
  13631. }
  13632. dynamicDoc.head.appendChild(style);
  13633. return {
  13634. sheet: style.sheet,
  13635. isCrossOrigin: isCrossOrigin,
  13636. shadowId: shadowId,
  13637. root: root,
  13638. priority: priority
  13639. };
  13640. };
  13641. }
  13642. var get_stylesheet_factory_default = getStyleSheetFactory;
  13643. var styleSheet;
  13644. function injectStyle(style) {
  13645. if (styleSheet && styleSheet.parentNode) {
  13646. if (styleSheet.styleSheet === void 0) {
  13647. styleSheet.appendChild(document.createTextNode(style));
  13648. } else {
  13649. styleSheet.styleSheet.cssText += style;
  13650. }
  13651. return styleSheet;
  13652. }
  13653. if (!style) {
  13654. return;
  13655. }
  13656. var head = document.head || document.getElementsByTagName('head')[0];
  13657. styleSheet = document.createElement('style');
  13658. styleSheet.type = 'text/css';
  13659. if (styleSheet.styleSheet === void 0) {
  13660. styleSheet.appendChild(document.createTextNode(style));
  13661. } else {
  13662. styleSheet.styleSheet.cssText = style;
  13663. }
  13664. head.appendChild(styleSheet);
  13665. return styleSheet;
  13666. }
  13667. var inject_style_default = injectStyle;
  13668. function isHidden(el, recursed) {
  13669. var node = get_node_from_tree_default(el);
  13670. if (el.nodeType === 9) {
  13671. return false;
  13672. }
  13673. if (el.nodeType === 11) {
  13674. el = el.host;
  13675. }
  13676. if (node && node._isHidden !== null) {
  13677. return node._isHidden;
  13678. }
  13679. var style = window.getComputedStyle(el, null);
  13680. if (!style || !el.parentNode || style.getPropertyValue('display') === 'none' || !recursed && style.getPropertyValue('visibility') === 'hidden' || el.getAttribute('aria-hidden') === 'true') {
  13681. return true;
  13682. }
  13683. var parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
  13684. var hidden = isHidden(parent, true);
  13685. if (node) {
  13686. node._isHidden = hidden;
  13687. }
  13688. return hidden;
  13689. }
  13690. var is_hidden_default = isHidden;
  13691. function isHtmlElement(node) {
  13692. var _node$props$nodeName, _node$props;
  13693. var nodeName2 = (_node$props$nodeName = (_node$props = node.props) === null || _node$props === void 0 ? void 0 : _node$props.nodeName) !== null && _node$props$nodeName !== void 0 ? _node$props$nodeName : node.nodeName.toLowerCase();
  13694. if (node.namespaceURI === 'http://www.w3.org/2000/svg') {
  13695. return false;
  13696. }
  13697. return !!standards_default.htmlElms[nodeName2];
  13698. }
  13699. var is_html_element_default = isHtmlElement;
  13700. function _isNodeInContext(node, _ref53) {
  13701. var _ref53$include = _ref53.include, include = _ref53$include === void 0 ? [] : _ref53$include, _ref53$exclude = _ref53.exclude, exclude = _ref53$exclude === void 0 ? [] : _ref53$exclude;
  13702. var filterInclude = include.filter(function(candidate) {
  13703. return _contains(candidate, node);
  13704. });
  13705. if (filterInclude.length === 0) {
  13706. return false;
  13707. }
  13708. var filterExcluded = exclude.filter(function(candidate) {
  13709. return _contains(candidate, node);
  13710. });
  13711. if (filterExcluded.length === 0) {
  13712. return true;
  13713. }
  13714. var deepestInclude = getDeepest(filterInclude);
  13715. var deepestExclude = getDeepest(filterExcluded);
  13716. return _contains(deepestExclude, deepestInclude);
  13717. }
  13718. function getDeepest(collection) {
  13719. var deepest;
  13720. var _iterator6 = _createForOfIteratorHelper(collection), _step6;
  13721. try {
  13722. for (_iterator6.s(); !(_step6 = _iterator6.n()).done; ) {
  13723. var node = _step6.value;
  13724. if (!deepest || !_contains(node, deepest)) {
  13725. deepest = node;
  13726. }
  13727. }
  13728. } catch (err) {
  13729. _iterator6.e(err);
  13730. } finally {
  13731. _iterator6.f();
  13732. }
  13733. return deepest;
  13734. }
  13735. function matchAncestry(ancestryA, ancestryB) {
  13736. if (ancestryA.length !== ancestryB.length) {
  13737. return false;
  13738. }
  13739. return ancestryA.every(function(selectorA, index) {
  13740. var selectorB = ancestryB[index];
  13741. if (!Array.isArray(selectorA)) {
  13742. return selectorA === selectorB;
  13743. }
  13744. if (selectorA.length !== selectorB.length) {
  13745. return false;
  13746. }
  13747. return selectorA.every(function(str, index2) {
  13748. return selectorB[index2] === str;
  13749. });
  13750. });
  13751. }
  13752. var match_ancestry_default = matchAncestry;
  13753. function nodeSorter(nodeA, nodeB) {
  13754. nodeA = nodeA.actualNode || nodeA;
  13755. nodeB = nodeB.actualNode || nodeB;
  13756. if (nodeA === nodeB) {
  13757. return 0;
  13758. }
  13759. if (nodeA.compareDocumentPosition(nodeB) & 4) {
  13760. return -1;
  13761. } else {
  13762. return 1;
  13763. }
  13764. }
  13765. var node_sorter_default = nodeSorter;
  13766. function parseSameOriginStylesheet(sheet, options, priority, importedUrls) {
  13767. var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  13768. var rules = Array.from(sheet.cssRules);
  13769. if (!rules) {
  13770. return Promise.resolve();
  13771. }
  13772. var cssImportRules = rules.filter(function(r) {
  13773. return r.type === 3;
  13774. });
  13775. if (!cssImportRules.length) {
  13776. return Promise.resolve({
  13777. isCrossOrigin: isCrossOrigin,
  13778. priority: priority,
  13779. root: options.rootNode,
  13780. shadowId: options.shadowId,
  13781. sheet: sheet
  13782. });
  13783. }
  13784. var cssImportUrlsNotAlreadyImported = cssImportRules.filter(function(rule) {
  13785. return rule.href;
  13786. }).map(function(rule) {
  13787. return rule.href;
  13788. }).filter(function(url) {
  13789. return !importedUrls.includes(url);
  13790. });
  13791. var promises = cssImportUrlsNotAlreadyImported.map(function(importUrl, cssRuleIndex) {
  13792. var newPriority = [].concat(_toConsumableArray(priority), [ cssRuleIndex ]);
  13793. var isCrossOriginRequest = /^https?:\/\/|^\/\//i.test(importUrl);
  13794. return parse_crossorigin_stylesheet_default(importUrl, options, newPriority, importedUrls, isCrossOriginRequest);
  13795. });
  13796. var nonImportCSSRules = rules.filter(function(r) {
  13797. return r.type !== 3;
  13798. });
  13799. if (!nonImportCSSRules.length) {
  13800. return Promise.all(promises);
  13801. }
  13802. promises.push(Promise.resolve(options.convertDataToStylesheet({
  13803. data: nonImportCSSRules.map(function(rule) {
  13804. return rule.cssText;
  13805. }).join(),
  13806. isCrossOrigin: isCrossOrigin,
  13807. priority: priority,
  13808. root: options.rootNode,
  13809. shadowId: options.shadowId
  13810. })));
  13811. return Promise.all(promises);
  13812. }
  13813. var parse_sameorigin_stylesheet_default = parseSameOriginStylesheet;
  13814. function parseStylesheet(sheet, options, priority, importedUrls) {
  13815. var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  13816. var isSameOrigin = isSameOriginStylesheet(sheet);
  13817. if (isSameOrigin) {
  13818. return parse_sameorigin_stylesheet_default(sheet, options, priority, importedUrls, isCrossOrigin);
  13819. }
  13820. return parse_crossorigin_stylesheet_default(sheet.href, options, priority, importedUrls, true);
  13821. }
  13822. function isSameOriginStylesheet(sheet) {
  13823. try {
  13824. var rules = sheet.cssRules;
  13825. if (!rules && sheet.href) {
  13826. return false;
  13827. }
  13828. return true;
  13829. } catch (e) {
  13830. return false;
  13831. }
  13832. }
  13833. var parse_stylesheet_default = parseStylesheet;
  13834. function parseCrossOriginStylesheet(url, options, priority, importedUrls, isCrossOrigin) {
  13835. importedUrls.push(url);
  13836. return new Promise(function(resolve, reject) {
  13837. var request = new window.XMLHttpRequest();
  13838. request.open('GET', url);
  13839. request.timeout = constants_default.preload.timeout;
  13840. request.addEventListener('error', reject);
  13841. request.addEventListener('timeout', reject);
  13842. request.addEventListener('loadend', function(event) {
  13843. if (event.loaded && request.responseText) {
  13844. return resolve(request.responseText);
  13845. }
  13846. reject(request.responseText);
  13847. });
  13848. request.send();
  13849. }).then(function(data2) {
  13850. var result = options.convertDataToStylesheet({
  13851. data: data2,
  13852. isCrossOrigin: isCrossOrigin,
  13853. priority: priority,
  13854. root: options.rootNode,
  13855. shadowId: options.shadowId
  13856. });
  13857. return parse_stylesheet_default(result.sheet, options, priority, importedUrls, result.isCrossOrigin);
  13858. });
  13859. }
  13860. var parse_crossorigin_stylesheet_default = parseCrossOriginStylesheet;
  13861. var performanceTimer = function() {
  13862. function now() {
  13863. if (window.performance && window.performance) {
  13864. return window.performance.now();
  13865. }
  13866. }
  13867. var originalTime = null;
  13868. var lastRecordedTime = now();
  13869. return {
  13870. start: function start() {
  13871. this.mark('mark_axe_start');
  13872. },
  13873. end: function end() {
  13874. this.mark('mark_axe_end');
  13875. this.measure('axe', 'mark_axe_start', 'mark_axe_end');
  13876. this.logMeasures('axe');
  13877. },
  13878. auditStart: function auditStart() {
  13879. this.mark('mark_audit_start');
  13880. },
  13881. auditEnd: function auditEnd() {
  13882. this.mark('mark_audit_end');
  13883. this.measure('audit_start_to_end', 'mark_audit_start', 'mark_audit_end');
  13884. this.logMeasures();
  13885. },
  13886. mark: function mark(markName) {
  13887. if (window.performance && window.performance.mark !== void 0) {
  13888. window.performance.mark(markName);
  13889. }
  13890. },
  13891. measure: function measure(measureName, startMark, endMark) {
  13892. if (window.performance && window.performance.measure !== void 0) {
  13893. window.performance.measure(measureName, startMark, endMark);
  13894. }
  13895. },
  13896. logMeasures: function logMeasures(measureName) {
  13897. function logMeasure(req2) {
  13898. log_default('Measure ' + req2.name + ' took ' + req2.duration + 'ms');
  13899. }
  13900. if (window.performance && window.performance.getEntriesByType !== void 0) {
  13901. var axeStart = window.performance.getEntriesByName('mark_axe_start')[0];
  13902. var measures = window.performance.getEntriesByType('measure').filter(function(measure) {
  13903. return measure.startTime >= axeStart.startTime;
  13904. });
  13905. for (var i = 0; i < measures.length; ++i) {
  13906. var req = measures[i];
  13907. if (req.name === measureName) {
  13908. logMeasure(req);
  13909. return;
  13910. }
  13911. logMeasure(req);
  13912. }
  13913. }
  13914. },
  13915. timeElapsed: function timeElapsed() {
  13916. return now() - lastRecordedTime;
  13917. },
  13918. reset: function reset() {
  13919. if (!originalTime) {
  13920. originalTime = now();
  13921. }
  13922. lastRecordedTime = now();
  13923. }
  13924. };
  13925. }();
  13926. var performance_timer_default = performanceTimer;
  13927. if (typeof Object.assign !== 'function') {
  13928. (function() {
  13929. Object.assign = function(target) {
  13930. if (target === void 0 || target === null) {
  13931. throw new TypeError('Cannot convert undefined or null to object');
  13932. }
  13933. var output = Object(target);
  13934. for (var index = 1; index < arguments.length; index++) {
  13935. var source = arguments[index];
  13936. if (source !== void 0 && source !== null) {
  13937. for (var nextKey in source) {
  13938. if (source.hasOwnProperty(nextKey)) {
  13939. output[nextKey] = source[nextKey];
  13940. }
  13941. }
  13942. }
  13943. }
  13944. return output;
  13945. };
  13946. })();
  13947. }
  13948. if (!Array.prototype.find) {
  13949. Object.defineProperty(Array.prototype, 'find', {
  13950. value: function value(predicate) {
  13951. if (this === null) {
  13952. throw new TypeError('Array.prototype.find called on null or undefined');
  13953. }
  13954. if (typeof predicate !== 'function') {
  13955. throw new TypeError('predicate must be a function');
  13956. }
  13957. var list = Object(this);
  13958. var length = list.length >>> 0;
  13959. var thisArg = arguments[1];
  13960. var value;
  13961. for (var i = 0; i < length; i++) {
  13962. value = list[i];
  13963. if (predicate.call(thisArg, value, i, list)) {
  13964. return value;
  13965. }
  13966. }
  13967. return void 0;
  13968. }
  13969. });
  13970. }
  13971. if (!Array.prototype.findIndex) {
  13972. Object.defineProperty(Array.prototype, 'findIndex', {
  13973. value: function value(predicate, thisArg) {
  13974. if (this === null) {
  13975. throw new TypeError('Array.prototype.find called on null or undefined');
  13976. }
  13977. if (typeof predicate !== 'function') {
  13978. throw new TypeError('predicate must be a function');
  13979. }
  13980. var list = Object(this);
  13981. var length = list.length >>> 0;
  13982. var value;
  13983. for (var i = 0; i < length; i++) {
  13984. value = list[i];
  13985. if (predicate.call(thisArg, value, i, list)) {
  13986. return i;
  13987. }
  13988. }
  13989. return -1;
  13990. }
  13991. });
  13992. }
  13993. function _pollyfillElementsFromPoint() {
  13994. if (document.elementsFromPoint) {
  13995. return document.elementsFromPoint;
  13996. }
  13997. if (document.msElementsFromPoint) {
  13998. return document.msElementsFromPoint;
  13999. }
  14000. var usePointer = function() {
  14001. var element = document.createElement('x');
  14002. element.style.cssText = 'pointer-events:auto';
  14003. return element.style.pointerEvents === 'auto';
  14004. }();
  14005. var cssProp = usePointer ? 'pointer-events' : 'visibility';
  14006. var cssDisableVal = usePointer ? 'none' : 'hidden';
  14007. var style = document.createElement('style');
  14008. style.innerHTML = usePointer ? '* { pointer-events: all }' : '* { visibility: visible }';
  14009. return function(x, y) {
  14010. var current, i, d;
  14011. var elements = [];
  14012. var previousPointerEvents = [];
  14013. document.head.appendChild(style);
  14014. while ((current = document.elementFromPoint(x, y)) && elements.indexOf(current) === -1) {
  14015. elements.push(current);
  14016. previousPointerEvents.push({
  14017. value: current.style.getPropertyValue(cssProp),
  14018. priority: current.style.getPropertyPriority(cssProp)
  14019. });
  14020. current.style.setProperty(cssProp, cssDisableVal, 'important');
  14021. }
  14022. if (elements.indexOf(document.documentElement) < elements.length - 1) {
  14023. elements.splice(elements.indexOf(document.documentElement), 1);
  14024. elements.push(document.documentElement);
  14025. }
  14026. for (i = previousPointerEvents.length; !!(d = previousPointerEvents[--i]); ) {
  14027. elements[i].style.setProperty(cssProp, d.value ? d.value : '', d.priority);
  14028. }
  14029. document.head.removeChild(style);
  14030. return elements;
  14031. };
  14032. }
  14033. if (typeof window.addEventListener === 'function') {
  14034. document.elementsFromPoint = _pollyfillElementsFromPoint();
  14035. }
  14036. if (!Array.prototype.includes) {
  14037. Object.defineProperty(Array.prototype, 'includes', {
  14038. value: function value(searchElement) {
  14039. var O = Object(this);
  14040. var len = parseInt(O.length, 10) || 0;
  14041. if (len === 0) {
  14042. return false;
  14043. }
  14044. var n = parseInt(arguments[1], 10) || 0;
  14045. var k;
  14046. if (n >= 0) {
  14047. k = n;
  14048. } else {
  14049. k = len + n;
  14050. if (k < 0) {
  14051. k = 0;
  14052. }
  14053. }
  14054. var currentElement;
  14055. while (k < len) {
  14056. currentElement = O[k];
  14057. if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) {
  14058. return true;
  14059. }
  14060. k++;
  14061. }
  14062. return false;
  14063. }
  14064. });
  14065. }
  14066. if (!Array.prototype.some) {
  14067. Object.defineProperty(Array.prototype, 'some', {
  14068. value: function value(fun) {
  14069. if (this == null) {
  14070. throw new TypeError('Array.prototype.some called on null or undefined');
  14071. }
  14072. if (typeof fun !== 'function') {
  14073. throw new TypeError();
  14074. }
  14075. var t = Object(this);
  14076. var len = t.length >>> 0;
  14077. var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
  14078. for (var i = 0; i < len; i++) {
  14079. if (i in t && fun.call(thisArg, t[i], i, t)) {
  14080. return true;
  14081. }
  14082. }
  14083. return false;
  14084. }
  14085. });
  14086. }
  14087. if (!Array.from) {
  14088. Object.defineProperty(Array, 'from', {
  14089. value: function() {
  14090. var toStr = Object.prototype.toString;
  14091. var isCallable = function isCallable(fn) {
  14092. return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
  14093. };
  14094. var toInteger = function toInteger(value) {
  14095. var number = Number(value);
  14096. if (isNaN(number)) {
  14097. return 0;
  14098. }
  14099. if (number === 0 || !isFinite(number)) {
  14100. return number;
  14101. }
  14102. return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
  14103. };
  14104. var maxSafeInteger = Math.pow(2, 53) - 1;
  14105. var toLength = function toLength(value) {
  14106. var len = toInteger(value);
  14107. return Math.min(Math.max(len, 0), maxSafeInteger);
  14108. };
  14109. return function from(arrayLike) {
  14110. var C = this;
  14111. var items = Object(arrayLike);
  14112. if (arrayLike == null) {
  14113. throw new TypeError('Array.from requires an array-like object - not null or undefined');
  14114. }
  14115. var mapFn = arguments.length > 1 ? arguments[1] : void 0;
  14116. var T;
  14117. if (typeof mapFn !== 'undefined') {
  14118. if (!isCallable(mapFn)) {
  14119. throw new TypeError('Array.from: when provided, the second argument must be a function');
  14120. }
  14121. if (arguments.length > 2) {
  14122. T = arguments[2];
  14123. }
  14124. }
  14125. var len = toLength(items.length);
  14126. var A = isCallable(C) ? Object(new C(len)) : new Array(len);
  14127. var k = 0;
  14128. var kValue;
  14129. while (k < len) {
  14130. kValue = items[k];
  14131. if (mapFn) {
  14132. A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
  14133. } else {
  14134. A[k] = kValue;
  14135. }
  14136. k += 1;
  14137. }
  14138. A.length = len;
  14139. return A;
  14140. };
  14141. }()
  14142. });
  14143. }
  14144. if (!String.prototype.includes) {
  14145. String.prototype.includes = function(search, start) {
  14146. if (typeof start !== 'number') {
  14147. start = 0;
  14148. }
  14149. if (start + search.length > this.length) {
  14150. return false;
  14151. } else {
  14152. return this.indexOf(search, start) !== -1;
  14153. }
  14154. };
  14155. }
  14156. if (!Array.prototype.flat) {
  14157. Object.defineProperty(Array.prototype, 'flat', {
  14158. configurable: true,
  14159. value: function flat() {
  14160. var depth = isNaN(arguments[0]) ? 1 : Number(arguments[0]);
  14161. return depth ? Array.prototype.reduce.call(this, function(acc, cur) {
  14162. if (Array.isArray(cur)) {
  14163. acc.push.apply(acc, flat.call(cur, depth - 1));
  14164. } else {
  14165. acc.push(cur);
  14166. }
  14167. return acc;
  14168. }, []) : Array.prototype.slice.call(this);
  14169. },
  14170. writable: true
  14171. });
  14172. }
  14173. if (window.Node && !('isConnected' in window.Node.prototype)) {
  14174. Object.defineProperty(window.Node.prototype, 'isConnected', {
  14175. get: function get() {
  14176. return !this.ownerDocument || !(this.ownerDocument.compareDocumentPosition(this) & this.DOCUMENT_POSITION_DISCONNECTED);
  14177. }
  14178. });
  14179. }
  14180. function uniqueArray(arr1, arr2) {
  14181. return arr1.concat(arr2).filter(function(elem, pos, arr) {
  14182. return arr.indexOf(elem) === pos;
  14183. });
  14184. }
  14185. var unique_array_default = uniqueArray;
  14186. function createLocalVariables(vNodes, anyLevel, thisLevel, parentShadowId, recycledLocalVariable) {
  14187. var retVal = recycledLocalVariable || {};
  14188. retVal.vNodes = vNodes;
  14189. retVal.vNodesIndex = 0;
  14190. retVal.anyLevel = anyLevel;
  14191. retVal.thisLevel = thisLevel;
  14192. retVal.parentShadowId = parentShadowId;
  14193. return retVal;
  14194. }
  14195. var recycledLocalVariables = [];
  14196. function matchExpressions(domTree, expressions, filter) {
  14197. var stack = [];
  14198. var vNodes = Array.isArray(domTree) ? domTree : [ domTree ];
  14199. var currentLevel = createLocalVariables(vNodes, expressions, null, domTree[0].shadowId, recycledLocalVariables.pop());
  14200. var result = [];
  14201. while (currentLevel.vNodesIndex < currentLevel.vNodes.length) {
  14202. var _currentLevel$anyLeve, _currentLevel$thisLev;
  14203. var vNode = currentLevel.vNodes[currentLevel.vNodesIndex++];
  14204. var childOnly = null;
  14205. var childAny = null;
  14206. var combinedLength = (((_currentLevel$anyLeve = currentLevel.anyLevel) === null || _currentLevel$anyLeve === void 0 ? void 0 : _currentLevel$anyLeve.length) || 0) + (((_currentLevel$thisLev = currentLevel.thisLevel) === null || _currentLevel$thisLev === void 0 ? void 0 : _currentLevel$thisLev.length) || 0);
  14207. var added = false;
  14208. for (var _i15 = 0; _i15 < combinedLength; _i15++) {
  14209. var _currentLevel$anyLeve2, _currentLevel$anyLeve3, _currentLevel$anyLeve4;
  14210. var exp = _i15 < (((_currentLevel$anyLeve2 = currentLevel.anyLevel) === null || _currentLevel$anyLeve2 === void 0 ? void 0 : _currentLevel$anyLeve2.length) || 0) ? currentLevel.anyLevel[_i15] : currentLevel.thisLevel[_i15 - (((_currentLevel$anyLeve3 = currentLevel.anyLevel) === null || _currentLevel$anyLeve3 === void 0 ? void 0 : _currentLevel$anyLeve3.length) || 0)];
  14211. if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && _matchesExpression(vNode, exp[0])) {
  14212. if (exp.length === 1) {
  14213. if (!added && (!filter || filter(vNode))) {
  14214. result.push(vNode);
  14215. added = true;
  14216. }
  14217. } else {
  14218. var rest = exp.slice(1);
  14219. if ([ ' ', '>' ].includes(rest[0].combinator) === false) {
  14220. throw new Error('axe.utils.querySelectorAll does not support the combinator: ' + exp[1].combinator);
  14221. }
  14222. if (rest[0].combinator === '>') {
  14223. (childOnly = childOnly || []).push(rest);
  14224. } else {
  14225. (childAny = childAny || []).push(rest);
  14226. }
  14227. }
  14228. }
  14229. if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && (_currentLevel$anyLeve4 = currentLevel.anyLevel) !== null && _currentLevel$anyLeve4 !== void 0 && _currentLevel$anyLeve4.includes(exp)) {
  14230. (childAny = childAny || []).push(exp);
  14231. }
  14232. }
  14233. if (vNode.children && vNode.children.length) {
  14234. stack.push(currentLevel);
  14235. currentLevel = createLocalVariables(vNode.children, childAny, childOnly, vNode.shadowId, recycledLocalVariables.pop());
  14236. }
  14237. while (currentLevel.vNodesIndex === currentLevel.vNodes.length && stack.length) {
  14238. recycledLocalVariables.push(currentLevel);
  14239. currentLevel = stack.pop();
  14240. }
  14241. }
  14242. return result;
  14243. }
  14244. function querySelectorAllFilter(domTree, selector, filter) {
  14245. domTree = Array.isArray(domTree) ? domTree : [ domTree ];
  14246. var expressions = _convertSelector(selector);
  14247. var nodes = getNodesMatchingExpression(domTree, expressions, filter);
  14248. if (nodes) {
  14249. return nodes;
  14250. }
  14251. return matchExpressions(domTree, expressions, filter);
  14252. }
  14253. var query_selector_all_filter_default = querySelectorAllFilter;
  14254. function preloadCssom(_ref54) {
  14255. var _ref54$treeRoot = _ref54.treeRoot, treeRoot = _ref54$treeRoot === void 0 ? axe._tree[0] : _ref54$treeRoot;
  14256. var rootNodes = getAllRootNodesInTree(treeRoot);
  14257. if (!rootNodes.length) {
  14258. return Promise.resolve();
  14259. }
  14260. var dynamicDoc = document.implementation.createHTMLDocument('Dynamic document for loading cssom');
  14261. var convertDataToStylesheet = get_stylesheet_factory_default(dynamicDoc);
  14262. return getCssomForAllRootNodes(rootNodes, convertDataToStylesheet).then(function(assets) {
  14263. return flattenAssets(assets);
  14264. });
  14265. }
  14266. var preload_cssom_default = preloadCssom;
  14267. function getAllRootNodesInTree(tree) {
  14268. var ids = [];
  14269. var rootNodes = query_selector_all_filter_default(tree, '*', function(node) {
  14270. if (ids.includes(node.shadowId)) {
  14271. return false;
  14272. }
  14273. ids.push(node.shadowId);
  14274. return true;
  14275. }).map(function(node) {
  14276. return {
  14277. shadowId: node.shadowId,
  14278. rootNode: get_root_node_default(node.actualNode)
  14279. };
  14280. });
  14281. return unique_array_default(rootNodes, []);
  14282. }
  14283. function getCssomForAllRootNodes(rootNodes, convertDataToStylesheet) {
  14284. var promises = [];
  14285. rootNodes.forEach(function(_ref55, index) {
  14286. var rootNode = _ref55.rootNode, shadowId = _ref55.shadowId;
  14287. var sheets = getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet);
  14288. if (!sheets) {
  14289. return Promise.all(promises);
  14290. }
  14291. var rootIndex = index + 1;
  14292. var parseOptions = {
  14293. rootNode: rootNode,
  14294. shadowId: shadowId,
  14295. convertDataToStylesheet: convertDataToStylesheet,
  14296. rootIndex: rootIndex
  14297. };
  14298. var importedUrls = [];
  14299. var p = Promise.all(sheets.map(function(sheet, sheetIndex) {
  14300. var priority = [ rootIndex, sheetIndex ];
  14301. return parse_stylesheet_default(sheet, parseOptions, priority, importedUrls);
  14302. }));
  14303. promises.push(p);
  14304. });
  14305. return Promise.all(promises);
  14306. }
  14307. function flattenAssets(assets) {
  14308. return assets.reduce(function(acc, val) {
  14309. return Array.isArray(val) ? acc.concat(flattenAssets(val)) : acc.concat(val);
  14310. }, []);
  14311. }
  14312. function getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet) {
  14313. var sheets;
  14314. if (rootNode.nodeType === 11 && shadowId) {
  14315. sheets = getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet);
  14316. } else {
  14317. sheets = getStylesheetsFromDocument(rootNode);
  14318. }
  14319. return filterStylesheetsWithSameHref(sheets);
  14320. }
  14321. function getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet) {
  14322. return Array.from(rootNode.children).filter(filerStyleAndLinkAttributesInDocumentFragment).reduce(function(out, node) {
  14323. var nodeName2 = node.nodeName.toUpperCase();
  14324. var data2 = nodeName2 === 'STYLE' ? node.textContent : node;
  14325. var isLink = nodeName2 === 'LINK';
  14326. var stylesheet = convertDataToStylesheet({
  14327. data: data2,
  14328. isLink: isLink,
  14329. root: rootNode
  14330. });
  14331. out.push(stylesheet.sheet);
  14332. return out;
  14333. }, []);
  14334. }
  14335. function getStylesheetsFromDocument(rootNode) {
  14336. return Array.from(rootNode.styleSheets).filter(function(sheet) {
  14337. if (!sheet.media) {
  14338. return false;
  14339. }
  14340. return filterMediaIsPrint(sheet.media.mediaText);
  14341. });
  14342. }
  14343. function filerStyleAndLinkAttributesInDocumentFragment(node) {
  14344. var nodeName2 = node.nodeName.toUpperCase();
  14345. var linkHref = node.getAttribute('href');
  14346. var linkRel = node.getAttribute('rel');
  14347. var isLink = nodeName2 === 'LINK' && linkHref && linkRel && node.rel.toUpperCase().includes('STYLESHEET');
  14348. var isStyle = nodeName2 === 'STYLE';
  14349. return isStyle || isLink && filterMediaIsPrint(node.media);
  14350. }
  14351. function filterMediaIsPrint(media) {
  14352. if (!media) {
  14353. return true;
  14354. }
  14355. return !media.toUpperCase().includes('PRINT');
  14356. }
  14357. function filterStylesheetsWithSameHref(sheets) {
  14358. var hrefs = [];
  14359. return sheets.filter(function(sheet) {
  14360. if (!sheet.href) {
  14361. return true;
  14362. }
  14363. if (hrefs.includes(sheet.href)) {
  14364. return false;
  14365. }
  14366. hrefs.push(sheet.href);
  14367. return true;
  14368. });
  14369. }
  14370. function preloadMedia(_ref56) {
  14371. var _ref56$treeRoot = _ref56.treeRoot, treeRoot = _ref56$treeRoot === void 0 ? axe._tree[0] : _ref56$treeRoot;
  14372. var mediaVirtualNodes = query_selector_all_filter_default(treeRoot, 'video, audio', function(_ref57) {
  14373. var actualNode = _ref57.actualNode;
  14374. if (actualNode.hasAttribute('src')) {
  14375. return !!actualNode.getAttribute('src');
  14376. }
  14377. var sourceWithSrc = Array.from(actualNode.getElementsByTagName('source')).filter(function(source) {
  14378. return !!source.getAttribute('src');
  14379. });
  14380. if (sourceWithSrc.length <= 0) {
  14381. return false;
  14382. }
  14383. return true;
  14384. });
  14385. return Promise.all(mediaVirtualNodes.map(function(_ref58) {
  14386. var actualNode = _ref58.actualNode;
  14387. return isMediaElementReady(actualNode);
  14388. }));
  14389. }
  14390. var preload_media_default = preloadMedia;
  14391. function isMediaElementReady(elm) {
  14392. return new Promise(function(resolve) {
  14393. if (elm.readyState > 0) {
  14394. resolve(elm);
  14395. }
  14396. function onMediaReady() {
  14397. elm.removeEventListener('loadedmetadata', onMediaReady);
  14398. resolve(elm);
  14399. }
  14400. elm.addEventListener('loadedmetadata', onMediaReady);
  14401. });
  14402. }
  14403. function isValidPreloadObject(preload2) {
  14404. return _typeof(preload2) === 'object' && Array.isArray(preload2.assets);
  14405. }
  14406. function _shouldPreload(options) {
  14407. if (!options || options.preload === void 0 || options.preload === null) {
  14408. return true;
  14409. }
  14410. if (typeof options.preload === 'boolean') {
  14411. return options.preload;
  14412. }
  14413. return isValidPreloadObject(options.preload);
  14414. }
  14415. function _getPreloadConfig(options) {
  14416. var _constants_default$pr = constants_default.preload, assets = _constants_default$pr.assets, timeout = _constants_default$pr.timeout;
  14417. var config = {
  14418. assets: assets,
  14419. timeout: timeout
  14420. };
  14421. if (!options.preload) {
  14422. return config;
  14423. }
  14424. if (typeof options.preload === 'boolean') {
  14425. return config;
  14426. }
  14427. var areRequestedAssetsValid = options.preload.assets.every(function(a) {
  14428. return assets.includes(a.toLowerCase());
  14429. });
  14430. if (!areRequestedAssetsValid) {
  14431. throw new Error('Requested assets, not supported. Supported assets are: '.concat(assets.join(', '), '.'));
  14432. }
  14433. config.assets = unique_array_default(options.preload.assets.map(function(a) {
  14434. return a.toLowerCase();
  14435. }), []);
  14436. if (options.preload.timeout && typeof options.preload.timeout === 'number' && !isNaN(options.preload.timeout)) {
  14437. config.timeout = options.preload.timeout;
  14438. }
  14439. return config;
  14440. }
  14441. function preload(options) {
  14442. var preloadFunctionsMap = {
  14443. cssom: preload_cssom_default,
  14444. media: preload_media_default
  14445. };
  14446. if (!_shouldPreload(options)) {
  14447. return Promise.resolve();
  14448. }
  14449. return new Promise(function(resolve, reject) {
  14450. var _getPreloadConfig2 = _getPreloadConfig(options), assets = _getPreloadConfig2.assets, timeout = _getPreloadConfig2.timeout;
  14451. var preloadTimeout = setTimeout(function() {
  14452. return reject(new Error('Preload assets timed out.'));
  14453. }, timeout);
  14454. Promise.all(assets.map(function(asset) {
  14455. return preloadFunctionsMap[asset](options).then(function(results) {
  14456. return _defineProperty({}, asset, results);
  14457. });
  14458. })).then(function(results) {
  14459. var preloadAssets = results.reduce(function(out, result) {
  14460. return _extends({}, out, result);
  14461. }, {});
  14462. clearTimeout(preloadTimeout);
  14463. resolve(preloadAssets);
  14464. })['catch'](function(err2) {
  14465. clearTimeout(preloadTimeout);
  14466. reject(err2);
  14467. });
  14468. });
  14469. }
  14470. var preload_default = preload;
  14471. function getIncompleteReason(checkData, messages) {
  14472. function getDefaultMsg(messages2) {
  14473. if (messages2.incomplete && messages2.incomplete['default']) {
  14474. return messages2.incomplete['default'];
  14475. } else {
  14476. return incompleteFallbackMessage();
  14477. }
  14478. }
  14479. if (checkData && checkData.missingData) {
  14480. try {
  14481. var msg = messages.incomplete[checkData.missingData[0].reason];
  14482. if (!msg) {
  14483. throw new Error();
  14484. }
  14485. return msg;
  14486. } catch (e) {
  14487. if (typeof checkData.missingData === 'string') {
  14488. return messages.incomplete[checkData.missingData];
  14489. } else {
  14490. return getDefaultMsg(messages);
  14491. }
  14492. }
  14493. } else if (checkData && checkData.messageKey) {
  14494. return messages.incomplete[checkData.messageKey];
  14495. } else {
  14496. return getDefaultMsg(messages);
  14497. }
  14498. }
  14499. function extender(checksData, shouldBeTrue, rule) {
  14500. return function(check) {
  14501. var sourceData = checksData[check.id] || {};
  14502. var messages = sourceData.messages || {};
  14503. var data2 = Object.assign({}, sourceData);
  14504. delete data2.messages;
  14505. if (!rule.reviewOnFail && check.result === void 0) {
  14506. if (_typeof(messages.incomplete) === 'object' && !Array.isArray(check.data)) {
  14507. data2.message = getIncompleteReason(check.data, messages);
  14508. }
  14509. if (!data2.message) {
  14510. data2.message = messages.incomplete;
  14511. }
  14512. } else {
  14513. data2.message = check.result === shouldBeTrue ? messages.pass : messages.fail;
  14514. }
  14515. if (typeof data2.message !== 'function') {
  14516. data2.message = process_message_default(data2.message, check.data);
  14517. }
  14518. extend_meta_data_default(check, data2);
  14519. };
  14520. }
  14521. function publishMetaData(ruleResult) {
  14522. var checksData = axe._audit.data.checks || {};
  14523. var rulesData = axe._audit.data.rules || {};
  14524. var rule = find_by_default(axe._audit.rules, 'id', ruleResult.id) || {};
  14525. ruleResult.tags = clone_default(rule.tags || []);
  14526. var shouldBeTrue = extender(checksData, true, rule);
  14527. var shouldBeFalse = extender(checksData, false, rule);
  14528. ruleResult.nodes.forEach(function(detail) {
  14529. detail.any.forEach(shouldBeTrue);
  14530. detail.all.forEach(shouldBeTrue);
  14531. detail.none.forEach(shouldBeFalse);
  14532. });
  14533. extend_meta_data_default(ruleResult, clone_default(rulesData[ruleResult.id] || {}));
  14534. }
  14535. var publish_metadata_default = publishMetaData;
  14536. function querySelectorAll(domTree, selector) {
  14537. return query_selector_all_filter_default(domTree, selector);
  14538. }
  14539. var query_selector_all_default = querySelectorAll;
  14540. function matchTags(rule, runOnly) {
  14541. var include, exclude, matching;
  14542. var defaultExclude = axe._audit && axe._audit.tagExclude ? axe._audit.tagExclude : [];
  14543. if (runOnly.hasOwnProperty('include') || runOnly.hasOwnProperty('exclude')) {
  14544. include = runOnly.include || [];
  14545. include = Array.isArray(include) ? include : [ include ];
  14546. exclude = runOnly.exclude || [];
  14547. exclude = Array.isArray(exclude) ? exclude : [ exclude ];
  14548. exclude = exclude.concat(defaultExclude.filter(function(tag) {
  14549. return include.indexOf(tag) === -1;
  14550. }));
  14551. } else {
  14552. include = Array.isArray(runOnly) ? runOnly : [ runOnly ];
  14553. exclude = defaultExclude.filter(function(tag) {
  14554. return include.indexOf(tag) === -1;
  14555. });
  14556. }
  14557. matching = include.some(function(tag) {
  14558. return rule.tags.indexOf(tag) !== -1;
  14559. });
  14560. if (matching || include.length === 0 && rule.enabled !== false) {
  14561. return exclude.every(function(tag) {
  14562. return rule.tags.indexOf(tag) === -1;
  14563. });
  14564. } else {
  14565. return false;
  14566. }
  14567. }
  14568. function ruleShouldRun(rule, context, options) {
  14569. var runOnly = options.runOnly || {};
  14570. var ruleOptions = (options.rules || {})[rule.id];
  14571. if (rule.pageLevel && !context.page) {
  14572. return false;
  14573. } else if (runOnly.type === 'rule') {
  14574. return runOnly.values.indexOf(rule.id) !== -1;
  14575. } else if (ruleOptions && typeof ruleOptions.enabled === 'boolean') {
  14576. return ruleOptions.enabled;
  14577. } else if (runOnly.type === 'tag' && runOnly.values) {
  14578. return matchTags(rule, runOnly.values);
  14579. } else {
  14580. return matchTags(rule, []);
  14581. }
  14582. }
  14583. var rule_should_run_default = ruleShouldRun;
  14584. function _filterHtmlAttrs(element, filterAttrs) {
  14585. if (!filterAttrs) {
  14586. return element;
  14587. }
  14588. var node = element.cloneNode(false);
  14589. var attributes2 = get_node_attributes_default(node);
  14590. if (node.nodeType === 1) {
  14591. var outerHTML = node.outerHTML;
  14592. node = cache_default.get(outerHTML, function() {
  14593. return setNodeAttributes(node, attributes2, element, filterAttrs);
  14594. });
  14595. } else {
  14596. node = setNodeAttributes(node, attributes2, element, filterAttrs);
  14597. }
  14598. Array.from(element.childNodes).forEach(function(child) {
  14599. node.appendChild(_filterHtmlAttrs(child, filterAttrs));
  14600. });
  14601. return node;
  14602. }
  14603. function setNodeAttributes(node, attributes2, element, filterAttrs) {
  14604. if (!attributes2) {
  14605. return node;
  14606. }
  14607. node = document.createElement(node.nodeName);
  14608. Array.from(attributes2).forEach(function(attr) {
  14609. if (!attributeMatches(element, attr.name, filterAttrs)) {
  14610. node.setAttribute(attr.name, attr.value);
  14611. }
  14612. });
  14613. return node;
  14614. }
  14615. function attributeMatches(node, attrName, filterAttrs) {
  14616. if (typeof filterAttrs[attrName] === 'undefined') {
  14617. return false;
  14618. }
  14619. if (filterAttrs[attrName] === true) {
  14620. return true;
  14621. }
  14622. return element_matches_default(node, filterAttrs[attrName]);
  14623. }
  14624. function _select(selector, context) {
  14625. var result = [];
  14626. var candidate;
  14627. if (axe._selectCache) {
  14628. for (var j = 0, l = axe._selectCache.length; j < l; j++) {
  14629. var item = axe._selectCache[j];
  14630. if (item.selector === selector) {
  14631. return item.result;
  14632. }
  14633. }
  14634. }
  14635. var outerIncludes = getOuterIncludes(context.include);
  14636. var isInContext = getContextFilter(context);
  14637. for (var _i16 = 0; _i16 < outerIncludes.length; _i16++) {
  14638. candidate = outerIncludes[_i16];
  14639. var nodes = query_selector_all_filter_default(candidate, selector, isInContext);
  14640. result = mergeArrayUniques(result, nodes);
  14641. }
  14642. if (axe._selectCache) {
  14643. axe._selectCache.push({
  14644. selector: selector,
  14645. result: result
  14646. });
  14647. }
  14648. return result;
  14649. }
  14650. function getOuterIncludes(includes) {
  14651. return includes.reduce(function(res, el) {
  14652. if (!res.length || !_contains(res[res.length - 1], el)) {
  14653. res.push(el);
  14654. }
  14655. return res;
  14656. }, []);
  14657. }
  14658. function getContextFilter(context) {
  14659. if (!context.exclude || context.exclude.length === 0) {
  14660. return null;
  14661. }
  14662. return function(node) {
  14663. return _isNodeInContext(node, context);
  14664. };
  14665. }
  14666. function mergeArrayUniques(arr1, arr2) {
  14667. if (arr1.length === 0) {
  14668. return arr2;
  14669. }
  14670. if (arr1.length < arr2.length) {
  14671. var temp = arr1;
  14672. arr1 = arr2;
  14673. arr2 = temp;
  14674. }
  14675. for (var _i17 = 0, l = arr2.length; _i17 < l; _i17++) {
  14676. if (!arr1.includes(arr2[_i17])) {
  14677. arr1.push(arr2[_i17]);
  14678. }
  14679. }
  14680. return arr1;
  14681. }
  14682. function setScroll(elm, top, left) {
  14683. if (elm === window) {
  14684. return elm.scroll(left, top);
  14685. } else {
  14686. elm.scrollTop = top;
  14687. elm.scrollLeft = left;
  14688. }
  14689. }
  14690. function setScrollState(scrollState) {
  14691. scrollState.forEach(function(_ref60) {
  14692. var elm = _ref60.elm, top = _ref60.top, left = _ref60.left;
  14693. return setScroll(elm, top, left);
  14694. });
  14695. }
  14696. var set_scroll_state_default = setScrollState;
  14697. function _shadowSelect(selectors) {
  14698. var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ];
  14699. return selectRecursive(selectorArr, document);
  14700. }
  14701. function selectRecursive(selectors, doc) {
  14702. var selectorStr = selectors.shift();
  14703. var elm = selectorStr ? doc.querySelector(selectorStr) : null;
  14704. if (selectors.length === 0) {
  14705. return elm;
  14706. }
  14707. if (!(elm !== null && elm !== void 0 && elm.shadowRoot)) {
  14708. return null;
  14709. }
  14710. return selectRecursive(selectors, elm.shadowRoot);
  14711. }
  14712. function _shadowSelectAll(selectors) {
  14713. var doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
  14714. var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ];
  14715. if (selectors.length === 0) {
  14716. return [];
  14717. }
  14718. return selectAllRecursive(selectorArr, doc);
  14719. }
  14720. function selectAllRecursive(_ref61, doc) {
  14721. var _ref62 = _toArray(_ref61), selectorStr = _ref62[0], restSelector = _ref62.slice(1);
  14722. var elms = doc.querySelectorAll(selectorStr);
  14723. if (restSelector.length === 0) {
  14724. return Array.from(elms);
  14725. }
  14726. var selected = [];
  14727. var _iterator7 = _createForOfIteratorHelper(elms), _step7;
  14728. try {
  14729. for (_iterator7.s(); !(_step7 = _iterator7.n()).done; ) {
  14730. var elm = _step7.value;
  14731. if (elm !== null && elm !== void 0 && elm.shadowRoot) {
  14732. selected.push.apply(selected, _toConsumableArray(selectAllRecursive(restSelector, elm.shadowRoot)));
  14733. }
  14734. }
  14735. } catch (err) {
  14736. _iterator7.e(err);
  14737. } finally {
  14738. _iterator7.f();
  14739. }
  14740. return selected;
  14741. }
  14742. function validInputTypes() {
  14743. return [ 'hidden', 'text', 'search', 'tel', 'url', 'email', 'password', 'date', 'month', 'week', 'time', 'datetime-local', 'number', 'range', 'color', 'checkbox', 'radio', 'file', 'submit', 'image', 'reset', 'button' ];
  14744. }
  14745. var valid_input_type_default = validInputTypes;
  14746. var langs = [ , [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , , , , , 1, 1, 1, 1, , , 1, 1, 1, , 1, , 1, , 1, 1 ], [ 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, 1, 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , , , , 1, , 1, , , , 1, 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, , , 1, , , , , 1, 1, 1, , 1, , 1, , 1, , , , , , 1 ], [ 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, , 1, , 1, , , , , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , 1, , 1, , , , 1, 1, 1, , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, 1, 1, , , , , 1, , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, , 1, 1, 1, , 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, , , 1, 1, , , , , , 1, 1 ], [ 1, 1, 1, , , , , 1, , , , 1, 1, , 1, , , , , , 1, , , , , 1 ], [ , 1, , , 1, , , 1, , , , , , 1 ], [ , 1, , 1, , , , 1, , , , 1 ], [ 1, , 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, , , 1, , 1, 1, , 1, , 1, , , , , 1, , 1 ], [ , 1, , , , 1, , , 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, , , 1, , , 1 ], [ , 1, 1, , , , , , 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, , 1, , , , , 1, 1, , 1, , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, , , , 1, 1, 1, , 1, 1, , , 1, 1, , 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, , 1, 1, 1, , 1, , , , , 1, 1, 1, , , 1, , 1, , , 1, 1 ], [ , , , , 1, , , , , , , , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, , 1, 1, 1, , 1, 1, , , , 1, 1, 1, 1, 1, , , 1, 1, 1, , , , , 1 ], [ 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , , , , , 1, , , , , , , 1 ], [ , 1, 1, , 1, 1, , 1, , , , , , , , , , , , , 1 ], , [ 1, 1, 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , 1, , , 1, , , 1, 1, , , , , 1 ] ], [ , [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , , , 1, , , , , , , , , , , , , , , 1 ], [ , 1, , , 1, 1, , 1, , 1, 1, , , , 1, 1, , , 1, 1, , , , 1 ], [ 1, , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , 1, , , , 1 ], , [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, , , 1, 1, 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, , , 1, , 1, , , 1, 1, 1, 1, , , 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, , , 1, , , 1, , 1 ], [ , 1, , , , , , , , , , 1, 1, , , , , , 1, 1, , , , , 1 ], [ , , , , , , , 1, , , , 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, , , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , 1, 1, 1, , , 1, 1, , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, , 1, 1, , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , , , , , , 1 ], , [ , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, , 1 ], [ , , 1, , , 1, , , 1, 1, , , 1, , 1, 1, , 1 ], [ , 1, 1, , 1, , , , 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1 ], [ , 1, , , , , , , , , , 1, 1, , , , , , 1, 1, , 1, , 1, , 1, 1 ], , [ , 1, 1, , 1, , , 1, , 1, , , , 1, 1, 1, , , , , , 1, , , , 1 ], [ 1, 1, , , 1, 1, , 1, , , , , 1, , 1 ] ], [ , [ , 1 ], [ , , , 1, , , , 1, , , , 1, , , , 1, , , 1, , , 1 ], [ , , , , , , , , , , , , , , , , , , 1, 1, , , , , , 1 ], , [ 1, , , , , 1 ], [ , 1, , , , 1, , , , 1 ], [ , 1, , , , , , , , , , , 1, , , 1, , , , , , , , , 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , 1, , , , 1, , 1 ], [ , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, , 1, 1, , 1, , , , , , , 1 ], [ 1, , , , , 1, , , 1, 1, , 1, , 1, , 1, 1, , , , , 1, , , 1 ], [ , 1, 1, , , 1, , 1, , 1, , 1, , 1, 1, 1, 1, , , 1, , 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, , 1, , , , 1, 1, 1, 1, , 1, 1, , , 1, 1, 1, 1 ], [ 1, , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , 1 ], , [ , 1, , , , , , 1, 1, 1, , 1, , , , 1, , , 1, 1, 1, , , 1 ], [ 1, , , , , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, , 1, , 1, , 1, , , 1, 1 ], [ 1, , 1, 1, , , , , 1, , , , , , 1, 1, , , 1, 1, 1, 1, , , 1, , 1 ], [ 1, , , , , , , , , , , , , , , , , 1 ], [ , , , , , 1, , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , , 1 ], [ , 1, , , , 1 ] ], [ , [ 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, , , 1, 1, 1 ], [ , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], , [ , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , , , , , , , 1, , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], , [ 1, 1, , , , 1, 1, , , , , , 1, , , , 1, , 1, , 1, 1, , 1 ], [ 1 ], [ , , , , , , , , , , , 1, , , , , , , , , , , 1 ], [ , 1, , , , , , , 1, 1, , , 1, , 1, , , , 1, , , , , , , 1 ], [ , , , , , , , , , , , , , , , , 1, , , , , 1 ], [ , , 1, , , , , 1, , 1 ], [ 1, , , , 1, , , , , 1, , , , 1, 1, , , , 1, 1, , , , , 1 ], [ , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , 1, 1, , , , , , , 1, , 1, , 1, 1, 1, 1, 1, 1 ], [ , , , , , 1, , , , , , , 1, , , , , , , 1 ], , [ , , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, , , 1, 1, , 1, 1, 1, , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , 1 ], , [ 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, , , , , , 1, , 1, , , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1, , , 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , 1, , , , , , , , , 1, , , , 1 ], [ , 1, 1, , 1, 1, , 1, , , , 1, 1, , 1, 1, , , 1, , 1, 1, , 1 ], [ , 1, , 1, , 1, , , 1, , , 1, 1, , 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , , , , , , , , , 1, , 1, , 1, 1, , , , 1, , , 1 ], [ , 1, , , 1, 1, , , , , , , , , 1, 1, 1, , , , , 1 ], [ 1, , , 1, 1, , , , 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, , , , 1, 1, 1, , , 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1 ], [ , 1, , , , , , , , 1, , , , , 1, , , , 1, , , 1 ], [ , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , 1, , 1, , , , , 1, 1, 1, 1, 1, , , 1, , , , 1 ], [ , 1, , , , , , , , 1, , , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, , 1, , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , 1, 1, , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1, 1, , , , 1, , 1, 1, , 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , 1, 1, 1, 1, , 1, , , 1, 1, 1, 1, , , 1, , , , , , , 1 ], [ , 1, , , , , , , , 1, , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , , , , , , , , 1, 1, , , , , , 1 ], [ , 1, , , , , , , 1 ], [ , , , , , , , , , , , , , , 1, , , , , 1, , , , , , 1 ], [ 1, 1, , , 1, , , 1, 1, 1, , , , 1 ], , [ , , , , , , , , , , , , , 1, , , , , , , , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , 1, , , , , , , 1 ], [ 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, , , 1, , 1, , , 1, 1 ], [ , , , , , , , , , 1 ], [ , 1, , , , 1, , , , , , 1, , , 1, , , , , 1 ], [ , 1, 1, , 1, 1, , , , , , , , , , , , , , , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, 1, 1, 1, , , , 1, 1, , , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1 ], [ , , , , , , , , , , , , , , , 1, , , , 1 ], , [ 1, 1, , 1, , 1, , , , , , 1, , 1, , 1, 1, , 1, , 1, 1, , 1, 1, , 1 ], [ , , 1, , , , , , 1, , , , 1, , 1, , , , , 1 ], [ 1, , , , , , , , , 1, , , , , , 1, , , , 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, , 1, , , , , , 1, , , 1, , , , , , , , 1 ], [ , 1, , 1, , , , , , , , , , , , 1 ], , [ 1, 1, , , , , , , , , , , , , , , , , , , , , , 1, 1 ], [ 1 ] ], [ , [ 1, , , , , , , , , 1, , , , , 1, , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, 1, , , 1, 1, 1, , , , 1, , , 1, , , , 1 ], [ , 1, , , , , , , 1, , , , 1, , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , , , 1, , , , , , , , , 1, 1, 1, 1 ], [ 1 ], [ , 1, 1, , , 1, 1, , , , , 1, , 1, , , , , , , , 1, , , , 1 ], [ 1, , 1, , , 1, , 1, , , , , 1, 1, 1, 1, , , , 1, , , , 1 ], [ , , 1, , , , , , , 1, , , , , , , 1, , , , , , , 1 ], [ 1, , , , , , , , , , , , , , 1, , , , 1 ], [ , , , 1, , 1, , , , , 1, , , , 1, 1, , , , 1 ], [ 1, , , , , 1, , , , 1, , 1, 1, , , 1, 1, , 1, 1, 1, , 1, 1, 1, , 1 ], [ , 1, 1, , , , , 1, , 1, , 1, 1, 1, , 1, 1, , , 1, , 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , , 1, , 1, 1, , , 1, 1, , , , , , 1 ], [ 1, , 1, 1, , 1, , 1, 1, , 1, , 1, 1, 1, 1, 1, , , 1, 1, , , , , , 1 ], [ 1, , , , , , , , , , , , , , , , , , 1, , , 1, , 1 ], [ , , , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , , 1, , 1 ], [ , 1, , , , 1, , , 1, 1, , 1, , , 1, 1, , , 1, , , 1, , , 1, 1 ], [ 1, 1, , 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, , 1, 1 ], [ 1, , 1, 1, 1, 1, , , , 1, , 1, 1, 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, , , , , , , , , , , , , 1 ], [ , , 1, , , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , , , , , , , , , 1, , 1, , 1, , , , 1 ], [ , , , 1, , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , , 1, , , , , , , , , 1 ], [ , , , , , , , , 1, 1, , , , , , , , , 1, , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , , , , , 1, , , , 1, 1, 1, , , 1, 1, , , 1, , 1, 1, , 1 ], [ , , , , , , , , , , , , , , , , , , , 1, 1 ], [ , 1, , , , , , 1, , , , , , , , , , , , , 1 ], [ , , 1, , , 1, , 1, 1, 1, , 1, 1, , 1, , , , 1, , 1, 1 ], , [ , , 1, , , 1, , , , , , 1, , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, , 1, , 1, , , 1, 1, 1, , , 1 ], [ , , , , , 1, , , , , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , 1, , 1, 1, , 1, , , 1 ], [ , , , , , 1, , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, 1, , , , , 1, , , 1, , 1, , , , 1, 1, , , , 1, 1 ], [ , 1, , , 1, , , 1, , 1, 1, , 1, , , , , , , 1 ], [ , , 1, , 1, , , 1, , , , , , , , , , , 1, 1, , , , 1 ], [ , 1, , , , , , , , , , , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , , , , , , , , , , , , , , , 1, , 1, 1 ], [ , , , , , , , , , , , , 1 ], , [ , 1, 1, 1, 1, , , , 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, , 1 ], [ 1, , , , 1, , , , , , , , , , 1 ], [ 1, , , , , , , , , 1 ], , [ , 1, , , , 1, , , , , , , , , , , , , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, , 1, , , , 1, 1, , , 1, 1, , 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ 1, 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, , 1, 1, , , , , 1 ], [ , 1, , , , , , , 1, 1, , , 1, 1, 1, , 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , , 1, , , , 1, , , , , , , 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, , , 1, 1, 1, 1, , 1, 1, 1, 1, , , , 1, , 1, , 1, , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1, 1, , , , , , , , , 1 ], , [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , , 1, , 1, , 1, , , , 1 ], [ , 1, , , 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , , 1 ], [ 1, , , 1, , , , 1, 1, 1, , , , , 1, 1, , , , 1, , 1 ], [ 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, , , , , , , , 1, , 1, , , , , , , , 1, , 1 ], [ , 1, , , , 1, , 1, 1, , , , 1, 1, , 1, , , , 1, 1, 1, , 1 ], , [ , 1, , , , , , 1, , , , , , , 1 ], [ , , , , , , , , 1, , , , 1, , 1, , , , , , , , , , , , 1 ] ], [ , [ , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, , , , , , , , 1, , , , , , 1, , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , , 1, , 1, 1, , , , 1, , 1, , , 1, 1 ], [ , , , , , , , 1, , , , 1, 1, 1, 1, 1, , 1, , , , , , , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, , 1, , 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , 1, 1, , 1, , 1, 1, 1, , 1, , 1, 1, , 1, 1, , 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , , , , , , 1, , , , , 1, , 1 ], [ , 1, 1, 1, , 1, , 1, , 1, , , , 1, , 1, , , 1, , , , , , 1, 1 ], [ , 1, , , 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, , , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , , , 1, , 1, , 1, , , , , , 1, , 1, , , , 1, 1 ] ], [ , [ , 1, , 1, , , , , , , , , , , , , , , 1, , , , 1 ], [ , , , , , , , , , 1, , 1, 1, 1, , 1, , , 1, , 1, 1 ], [ 1, 1, , , , , , , 1, , , , , , , 1, , , , , , 1 ], [ , 1, , , , , , , , , , 1, , , , , , , , , 1, 1 ], , [ , , , , , , , , , , , , , , , 1, , , , 1, , 1 ], [ , , 1, 1, , 1, , 1, , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , 1, 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ 1, , 1, 1, , , , 1, , , , , , , , , 1, , , 1, , , 1, 1 ], [ , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, 1, , , , , , 1, , 1, , 1, , , 1, , 1, 1 ], [ 1, 1, 1, 1, , 1, , 1, , 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, , , 1, , 1, , 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, , 1, 1 ], [ , , , , 1, , , 1, , , , , , , 1, , , , 1, 1 ], [ , 1, , , , , , , , , , 1, , 1, , 1, , , , , 1, , , , , 1 ], , [ 1, 1, , 1, , 1, , 1, 1, , , , , , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, , , , , , 1, , , , , , 1, 1, , , , 1, 1, , , 1 ], [ , 1, 1, , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, , , 1, , , , 1, , , , 1, 1 ], [ , , , , 1 ], [ , , , , , , , , , 1, , , 1 ], , [ , , 1, , 1, , , , , , , , , 1, , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, , 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , , , , 1 ], [ , 1, , 1, , , , , , 1, , , , , 1, 1, , , , , 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , , 1, , 1, 1, 1 ], [ , 1, , , , 1, , , , , , , 1 ], [ , 1, , , 1, , , 1, , 1, , 1, 1, , 1, , , , , 1, , 1, , , , 1, 1 ], [ , 1, , , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, , , , 1, 1, , , , , , 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , 1, , , , , , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1 ], [ 1, 1, , , , , , , 1, 1, , , , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], , [ , 1, 1, , , , , 1, , 1, , , , 1, 1, 1, , , 1, , , , , 1 ], [ , , , , , , , , , , , , , 1 ], [ , , , , , 1, , , , , , , , 1, 1, , , , , 1, , 1, , , 1, 1 ], [ , , , , , , , , , , , , , , 1 ] ], [ , [ , 1 ], , , , , , , , , , , , , , , , , , , , [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, , , , 1, , 1, 1 ], [ , 1, , 1, , 1, , , 1, , , , , 1, , , , , , 1, 1 ], [ , 1, , 1, , , , , 1, , , , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, , , , , , , , , , , , , , , 1 ] ], [ , [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , , , , , , , 1, 1, , , , 1 ], [ , , , , , , 1 ], [ , , 1 ], [ , 1, 1, , , 1, , 1, , 1, 1, , 1, 1, 1, , , , 1, 1, 1, , , , , 1 ], , [ , 1, , , , 1, , , , , , 1, , , 1, , , , 1, 1, , 1 ], [ , , , , , , , 1, , , , , , , , , 1 ], [ , 1, , , , 1, 1, , , , , , 1, 1, 1, , , , 1, , 1, 1 ], [ , , , , , , , 1, , 1, , , , , , , , , , 1 ], [ , 1, 1, , , , , , 1, 1, , , , 1, , , , , , , 1, , , 1 ], , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , , 1, , , 1, , , , , 1, , 1, , 1, , 1, , , , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , , , 1, 1, , 1, 1, , 1, , , 1, , 1 ], [ , , , , , , , , , , , , , , 1, , , , , , 1 ], , [ , , , , , , , , , 1, , , , , , 1, , , , , 1 ], [ , , 1, , , , , , , 1, , , 1, 1 ], [ , , , 1, , , , , 1, , , , , 1, , , , , , 1, , , , 1 ], [ 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, , , , 1, 1, 1, , , 1, 1, , , , 1, 1 ], , [ 1, 1, , , , , , , , , , 1, , 1, , 1, , , 1 ], [ , , , , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , 1, , , , , 1, , 1 ], [ , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , , 1, , , 1, , , , , , , , 1, , , , , , 1, , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, , 1, , , , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, , , , , , , 1, , 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, , , , , , 1, , 1, , , , , 1, 1, , , , , 1 ], [ 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, , 1, , 1, , , , 1, 1, 1, 1, 1, , , 1, 1, , 1, , 1 ], [ , 1, 1, 1, 1, , , , , 1, , 1, 1, 1, 1, 1, , , 1, 1, , , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , , , , 1, , 1, , 1, , , 1, , , 1, 1, , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , 1, , , , , 1, 1, , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , 1, , 1, 1, , 1, 1, 1, 1, 1, , , 1, , 1, , 1 ], [ 1, 1, 1, , 1, 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , , , , , , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , , , , , 1, 1, 1, 1, 1, , , , 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, , 1, , 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1 ], [ 1, 1, , , , 1, , , 1, 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, , 1 ], [ , 1, , , , , , , 1, , 1, , 1, 1, 1, 1, , , , , , , , , 1 ] ], [ , [ , , , , , , , , , , , , , 1, 1, , , , 1 ], [ , 1, , , , , , , , 1, , , 1, , , , , , 1, , , 1, , , , 1 ], , [ , 1, , , , 1, , 1, , 1, 1, , 1, 1, , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , 1 ], [ 1, 1, 1, , , 1, , , , , , , , , 1, 1, , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1, , , 1 ], [ , , , , , , , , , 1 ], [ 1, 1, , , , , , 1, 1, 1, , 1, 1, , , , 1, 1, , 1, , 1, 1, 1, , 1 ], [ , 1, 1, 1, , 1, 1, , , 1, , 1, 1, 1, 1, , , , , , , 1, , 1 ], [ , 1, 1, 1, 1, , , 1, , 1, , , , 1, 1, 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , 1, 1, , 1, , 1, , , 1, , , 1, , 1 ], [ , , , , , , , , , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , , , , , 1 ], , [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , 1, 1, , 1, , , , , 1, , , 1, , 1 ], [ , 1, , , , 1, , , 1, , , , , , , , 1, , 1, , , 1 ], [ , , , , , , , , , , , , , 1, 1, , , , 1, , , 1 ], [ , , , , , 1, , , 1, , , , 1 ], [ , 1 ], , [ , 1 ], [ 1, , , , , , , , , , , , , , 1, , , , , 1 ] ], [ , [ , 1, , , , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, , , 1 ], [ , , 1, , , , , , , , , 1 ], , , [ 1, , , 1, 1, , , , , , , , 1, 1, , 1, 1, , 1 ], , [ , , , , , , , , , , , , , , , , , , 1, , 1 ], , [ 1, , , 1, 1, , 1, 1, , , , , 1, , 1, , , , , 1, 1, , 1 ], , [ , 1, , , , , , , , 1, 1, 1, 1, 1, , 1, 1, , , , 1, 1 ], [ , , , , , , , , , , , , , , , , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , 1, , 1, , , 1 ], [ 1, , , , , , , , , , , , , , , , , , 1, , 1 ], , , [ , 1, , , , , , , , , , , , , , 1, , , , 1, 1 ], [ , , , , , , , , , 1, , , 1, , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , 1, 1, , , , , , 1 ], , [ , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , 1, 1, , 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, , , , , , , , 1 ], [ , , , , 1, , , 1, , , 1, 1, , , , , , , , , , 1, , , , 1 ], [ , 1, , 1, 1, , , 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , , , , , , , 1 ], [ , 1, 1, , , , , 1, , 1, , , , , , 1, , , , , , 1, , 1, , 1 ], [ , 1, , , , , , 1, , , , 1, , , , , , , , , , 1 ], [ , , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, , , , , , , , 1 ], [ , 1, 1, , 1, , , , , , , , 1, , , , , , 1, , , 1, , 1, , 1 ], [ , 1, , 1, , 1, , 1, 1, 1, , 1, 1, 1, , 1, , , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, , , , 1, 1, 1, , , , 1, 1, , , 1, 1 ], [ , , 1, 1, 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, , , , , 1, , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, , , 1, 1, , , , 1, , 1 ], [ , , , 1 ], , [ , 1, 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , 1, , , , , , , 1, 1, , 1, 1 ], [ , , , , , , 1, , 1, 1, , 1, , 1, , , , , , , , , , 1 ], [ , 1, 1, , 1, , , , 1, , , , 1, 1, 1, , , , 1, , 1, 1, 1, , 1, 1 ], , [ , 1, 1, , , , , , , , , , , , , 1, , , 1, , , , , 1 ], [ , 1, , , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , , , , , , 1, , , , 1, , , , , 1, , , , , , , 1 ] ], [ , [ , 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, , 1, , 1, 1, , , 1, 1, 1, 1, , 1, , , , , 1, 1, 1 ], [ , , 1, 1, , 1, , 1, 1, , , , 1, 1, 1, 1, , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, , 1, , , , , , , , 1, , 1, , 1, , , , , , , , , , 1 ], [ , , 1, , 1, , , 1, , , , , 1, 1, , , 1, , 1, 1, 1, 1 ], [ , 1 ], [ , 1, 1, , 1, , 1, 1, , 1, , , 1, 1, 1, , , , 1, , , 1, , 1 ], [ 1, 1, , 1, 1, 1, , , , , , , , , , , , , 1, , 1, 1, 1 ], [ , 1, 1, , , , , , , 1, , , 1, , 1, , 1, , 1, 1, , , 1, , , 1 ], [ , , 1, , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , 1, , , , , 1, 1, 1, , , 1, , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , 1, 1, 1, , 1, , 1, 1, 1, , , 1, 1, 1, 1, , , , 1, 1 ], [ , , , 1, 1, , , 1, , 1, , 1, , 1, 1, 1, 1, , 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , 1, 1, , 1, , 1, , , , 1, 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, , 1, , , 1, , , 1, , 1, 1, 1, 1, 1, , 1, , 1, 1 ], [ , , , , , 1, , , , 1, , , , , 1, 1, , , , 1 ], [ , 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, , , 1, , 1, , , 1 ], [ , , 1, , , , , , , , , 1, , 1, , , , , 1, , 1 ], [ , 1, 1, , , , , , , , 1, 1, 1, , , , , , , , 1, , , , , 1 ], [ , , , , , , , , 1, , , , , 1, , , 1 ] ], [ , [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, , , , , , , , , 1, 1 ], [ , , , , , , , , 1, , , , 1, , 1, , 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , , , , , , , 1 ], [ , 1, , 1, , 1, , , , 1, 1, , 1, , 1, , , , 1, 1, 1, 1, 1, , , 1 ], , [ , 1, , , , , , , , 1, , , 1, 1, , , 1, , 1, 1, , 1, , 1 ], [ , 1, , , 1, , , , , , , , 1, , , , , , , 1 ], [ 1, 1, , , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], , [ , 1, , , , , , 1, , 1, , 1, 1, 1, 1, 1, , , 1, , 1, 1, , , , 1 ], [ , 1, 1, , , 1, , 1, , 1, , , 1, 1, 1, 1, , , 1, , , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1 ], [ , 1, , , 1, 1, , 1, 1, , , 1, 1, , 1, 1, , 1, , 1, , 1 ], [ 1, , 1, , , , , 1, , 1, , 1, 1, 1, 1, , , , , 1, 1, , , , 1, 1 ], [ , 1, 1, , , , , 1, 1, , , 1, , 1, 1, 1, 1, , , , , , , , , , 1 ], , [ , 1, 1, , , 1, , , , 1, , 1, 1, 1, 1, 1, , , , 1, , , , 1, , 1 ], [ , , , 1, 1, , , 1, , , , , 1, , 1, 1, 1, , 1, 1, , , , , , 1 ], [ , 1, , , , , , , , , , , 1, , , , 1, , , , , , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , , , 1, , , , , 1, , 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, , , , , , 1, , , , , 1, 1, , , , , , , , 1, , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1, , , 1, , , , , 1 ], [ , , , , , , , 1, , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, , , , , , , 1, , , , , , , , 1, , , 1 ], [ , 1, , , , , , , 1 ], [ , , , , , , , , , , 1 ], [ , 1, , , , , , 1, 1, , , , , , 1 ], , [ , 1, 1, , , , , , 1, , , , , 1, 1, , , , 1 ], [ 1, , 1, , 1, , , , , 1, , , , , 1, , , , , , , , , 1, 1 ], [ , 1, 1, , , , , , , , , 1, 1, 1, 1, , , , 1, , , , , 1, , , 1 ], , [ , 1, 1, , 1, , , 1, 1, , , 1, , , 1, 1, 1, , 1, , 1, 1, 1, , , , 1 ], [ , , , , , 1, , , , , 1, , , 1, 1, , , 1, , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , , , , , , , 1 ], [ , , , 1, , , , , 1, , , , , 1, , 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , 1 ], [ , 1, , , , , , 1, , , , , , , 1, 1, 1, , , 1 ], [ , 1, , , , , , , , , , 1, 1, 1, , , , , 1, , , 1 ], [ , , , , , 1, , 1, , , , , 1, 1, 1, , 1, 1, , 1, 1, 1, , , 1, 1 ], [ 1, 1, , , , , , , 1, , , , , 1, 1, , , , , , , , , , , 1 ], , [ , 1 ], [ , , , , , , , , , , , , , , , , , , , , , , , , 1 ], [ , , 1, , , , , 1, , , 1, , , , 1, , 1 ], [ , 1, , , , , , , , , 1 ] ] ];
  14747. function isValidLang(lang) {
  14748. var array = langs;
  14749. while (lang.length < 3) {
  14750. lang += '`';
  14751. }
  14752. for (var _i18 = 0; _i18 <= lang.length - 1; _i18++) {
  14753. var index = lang.charCodeAt(_i18) - 96;
  14754. array = array[index];
  14755. if (!array) {
  14756. return false;
  14757. }
  14758. }
  14759. return true;
  14760. }
  14761. function _validLangs(langArray) {
  14762. langArray = Array.isArray(langArray) ? langArray : langs;
  14763. var codes = [];
  14764. langArray.forEach(function(lang, index) {
  14765. var _char3 = String.fromCharCode(index + 96).replace('`', '');
  14766. if (Array.isArray(lang)) {
  14767. codes = codes.concat(_validLangs(lang).map(function(newLang) {
  14768. return _char3 + newLang;
  14769. }));
  14770. } else {
  14771. codes.push(_char3);
  14772. }
  14773. });
  14774. return codes;
  14775. }
  14776. var valid_langs_default = isValidLang;
  14777. var SerialVirtualNode = function(_abstract_virtual_nod2) {
  14778. _inherits(SerialVirtualNode, _abstract_virtual_nod2);
  14779. var _super2 = _createSuper(SerialVirtualNode);
  14780. function SerialVirtualNode(serialNode) {
  14781. var _this3;
  14782. _classCallCheck(this, SerialVirtualNode);
  14783. _this3 = _super2.call(this);
  14784. _this3._props = normaliseProps(serialNode);
  14785. _this3._attrs = normaliseAttrs(serialNode);
  14786. return _this3;
  14787. }
  14788. _createClass(SerialVirtualNode, [ {
  14789. key: 'props',
  14790. get: function get() {
  14791. return this._props;
  14792. }
  14793. }, {
  14794. key: 'attr',
  14795. value: function attr(attrName) {
  14796. var _this$_attrs$attrName;
  14797. return (_this$_attrs$attrName = this._attrs[attrName]) !== null && _this$_attrs$attrName !== void 0 ? _this$_attrs$attrName : null;
  14798. }
  14799. }, {
  14800. key: 'hasAttr',
  14801. value: function hasAttr(attrName) {
  14802. return this._attrs[attrName] !== void 0;
  14803. }
  14804. }, {
  14805. key: 'attrNames',
  14806. get: function get() {
  14807. return Object.keys(this._attrs);
  14808. }
  14809. } ]);
  14810. return SerialVirtualNode;
  14811. }(abstract_virtual_node_default);
  14812. var nodeNamesToTypes = {
  14813. '#cdata-section': 2,
  14814. '#text': 3,
  14815. '#comment': 8,
  14816. '#document': 9,
  14817. '#document-fragment': 11
  14818. };
  14819. var nodeTypeToName = {};
  14820. var nodeNames = Object.keys(nodeNamesToTypes);
  14821. nodeNames.forEach(function(nodeName2) {
  14822. nodeTypeToName[nodeNamesToTypes[nodeName2]] = nodeName2;
  14823. });
  14824. function normaliseProps(serialNode) {
  14825. var _serialNode$nodeName, _ref63, _serialNode$nodeType;
  14826. var nodeName2 = (_serialNode$nodeName = serialNode.nodeName) !== null && _serialNode$nodeName !== void 0 ? _serialNode$nodeName : nodeTypeToName[serialNode.nodeType];
  14827. var nodeType = (_ref63 = (_serialNode$nodeType = serialNode.nodeType) !== null && _serialNode$nodeType !== void 0 ? _serialNode$nodeType : nodeNamesToTypes[serialNode.nodeName]) !== null && _ref63 !== void 0 ? _ref63 : 1;
  14828. assert_default(typeof nodeType === 'number', 'nodeType has to be a number, got \''.concat(nodeType, '\''));
  14829. assert_default(typeof nodeName2 === 'string', 'nodeName has to be a string, got \''.concat(nodeName2, '\''));
  14830. nodeName2 = nodeName2.toLowerCase();
  14831. var type = null;
  14832. if (nodeName2 === 'input') {
  14833. type = (serialNode.type || serialNode.attributes && serialNode.attributes.type || '').toLowerCase();
  14834. if (!valid_input_type_default().includes(type)) {
  14835. type = 'text';
  14836. }
  14837. }
  14838. var props = _extends({}, serialNode, {
  14839. nodeType: nodeType,
  14840. nodeName: nodeName2
  14841. });
  14842. if (type) {
  14843. props.type = type;
  14844. }
  14845. delete props.attributes;
  14846. return Object.freeze(props);
  14847. }
  14848. function normaliseAttrs(_ref64) {
  14849. var _ref64$attributes = _ref64.attributes, attributes2 = _ref64$attributes === void 0 ? {} : _ref64$attributes;
  14850. var attrMap = {
  14851. htmlFor: 'for',
  14852. className: 'class'
  14853. };
  14854. return Object.keys(attributes2).reduce(function(attrs, attrName) {
  14855. var value = attributes2[attrName];
  14856. assert_default(_typeof(value) !== 'object' || value === null, 'expects attributes not to be an object, \''.concat(attrName, '\' was'));
  14857. if (value !== void 0) {
  14858. var mappedName = attrMap[attrName] || attrName;
  14859. attrs[mappedName] = value !== null ? String(value) : null;
  14860. }
  14861. return attrs;
  14862. }, {});
  14863. }
  14864. var serial_virtual_node_default = SerialVirtualNode;
  14865. var imports_exports = {};
  14866. __export(imports_exports, {
  14867. CssSelectorParser: function CssSelectorParser() {
  14868. return import_css_selector_parser2.CssSelectorParser;
  14869. },
  14870. doT: function doT() {
  14871. return import_dot['default'];
  14872. },
  14873. emojiRegexText: function emojiRegexText() {
  14874. return emoji_regex_default;
  14875. },
  14876. memoize: function memoize() {
  14877. return import_memoizee2['default'];
  14878. }
  14879. });
  14880. var import_css_selector_parser2 = __toModule(require_lib());
  14881. var import_dot = __toModule(require_doT());
  14882. var import_memoizee2 = __toModule(require_memoizee());
  14883. var import_es6_promise = __toModule(require_es6_promise());
  14884. var import_typedarray = __toModule(require_typedarray());
  14885. var import_weakmap_polyfill = __toModule(require_weakmap_polyfill());
  14886. import_dot['default'].templateSettings.strip = false;
  14887. if (!('Promise' in window)) {
  14888. import_es6_promise['default'].polyfill();
  14889. }
  14890. if (!('Uint32Array' in window)) {
  14891. window.Uint32Array = import_typedarray.Uint32Array;
  14892. }
  14893. if (window.Uint32Array) {
  14894. if (!('some' in window.Uint32Array.prototype)) {
  14895. Object.defineProperty(window.Uint32Array.prototype, 'some', {
  14896. value: Array.prototype.some
  14897. });
  14898. }
  14899. if (!('reduce' in window.Uint32Array.prototype)) {
  14900. Object.defineProperty(window.Uint32Array.prototype, 'reduce', {
  14901. value: Array.prototype.reduce
  14902. });
  14903. }
  14904. }
  14905. function cleanup(resolve, reject) {
  14906. resolve = resolve || function res() {};
  14907. reject = reject || axe.log;
  14908. if (!axe._audit) {
  14909. throw new Error('No audit configured');
  14910. }
  14911. var q = axe.utils.queue();
  14912. var cleanupErrors = [];
  14913. Object.keys(axe.plugins).forEach(function(key) {
  14914. q.defer(function(res) {
  14915. var rej = function rej2(err2) {
  14916. cleanupErrors.push(err2);
  14917. res();
  14918. };
  14919. try {
  14920. axe.plugins[key].cleanup(res, rej);
  14921. } catch (err2) {
  14922. rej(err2);
  14923. }
  14924. });
  14925. });
  14926. var flattenedTree = axe.utils.getFlattenedTree(document.body);
  14927. axe.utils.querySelectorAll(flattenedTree, 'iframe, frame').forEach(function(node) {
  14928. q.defer(function(res, rej) {
  14929. return axe.utils.sendCommandToFrame(node.actualNode, {
  14930. command: 'cleanup-plugin'
  14931. }, res, rej);
  14932. });
  14933. });
  14934. q.then(function(results) {
  14935. if (cleanupErrors.length === 0) {
  14936. resolve(results);
  14937. } else {
  14938. reject(cleanupErrors);
  14939. }
  14940. })['catch'](reject);
  14941. }
  14942. var cleanup_default = cleanup;
  14943. var reporters = {};
  14944. var defaultReporter;
  14945. function hasReporter(reporterName) {
  14946. return reporters.hasOwnProperty(reporterName);
  14947. }
  14948. function getReporter(reporter) {
  14949. if (typeof reporter === 'string' && reporters[reporter]) {
  14950. return reporters[reporter];
  14951. }
  14952. if (typeof reporter === 'function') {
  14953. return reporter;
  14954. }
  14955. return defaultReporter;
  14956. }
  14957. function addReporter(name, cb, isDefault) {
  14958. reporters[name] = cb;
  14959. if (isDefault) {
  14960. defaultReporter = cb;
  14961. }
  14962. }
  14963. function configure(spec) {
  14964. var audit;
  14965. audit = axe._audit;
  14966. if (!audit) {
  14967. throw new Error('No audit configured');
  14968. }
  14969. if (spec.axeVersion || spec.ver) {
  14970. var specVersion = spec.axeVersion || spec.ver;
  14971. if (!/^\d+\.\d+\.\d+(-canary)?/.test(specVersion)) {
  14972. throw new Error('Invalid configured version '.concat(specVersion));
  14973. }
  14974. var _specVersion$split = specVersion.split('-'), _specVersion$split2 = _slicedToArray(_specVersion$split, 2), version = _specVersion$split2[0], canary = _specVersion$split2[1];
  14975. var _version$split$map = version.split('.').map(Number), _version$split$map2 = _slicedToArray(_version$split$map, 3), major = _version$split$map2[0], minor = _version$split$map2[1], patch = _version$split$map2[2];
  14976. var _axe$version$split = axe.version.split('-'), _axe$version$split2 = _slicedToArray(_axe$version$split, 2), axeVersion = _axe$version$split2[0], axeCanary = _axe$version$split2[1];
  14977. var _axeVersion$split$map = axeVersion.split('.').map(Number), _axeVersion$split$map2 = _slicedToArray(_axeVersion$split$map, 3), axeMajor = _axeVersion$split$map2[0], axeMinor = _axeVersion$split$map2[1], axePatch = _axeVersion$split$map2[2];
  14978. if (major !== axeMajor || axeMinor < minor || axeMinor === minor && axePatch < patch || major === axeMajor && minor === axeMinor && patch === axePatch && canary && canary !== axeCanary) {
  14979. throw new Error('Configured version '.concat(specVersion, ' is not compatible with current axe version ').concat(axe.version));
  14980. }
  14981. }
  14982. if (spec.reporter && (typeof spec.reporter === 'function' || hasReporter(spec.reporter))) {
  14983. audit.reporter = spec.reporter;
  14984. }
  14985. if (spec.checks) {
  14986. if (!Array.isArray(spec.checks)) {
  14987. throw new TypeError('Checks property must be an array');
  14988. }
  14989. spec.checks.forEach(function(check) {
  14990. if (!check.id) {
  14991. throw new TypeError('Configured check '.concat(JSON.stringify(check), ' is invalid. Checks must be an object with at least an id property'));
  14992. }
  14993. audit.addCheck(check);
  14994. });
  14995. }
  14996. var modifiedRules = [];
  14997. if (spec.rules) {
  14998. if (!Array.isArray(spec.rules)) {
  14999. throw new TypeError('Rules property must be an array');
  15000. }
  15001. spec.rules.forEach(function(rule) {
  15002. if (!rule.id) {
  15003. throw new TypeError('Configured rule '.concat(JSON.stringify(rule), ' is invalid. Rules must be an object with at least an id property'));
  15004. }
  15005. modifiedRules.push(rule.id);
  15006. audit.addRule(rule);
  15007. });
  15008. }
  15009. if (spec.disableOtherRules) {
  15010. audit.rules.forEach(function(rule) {
  15011. if (modifiedRules.includes(rule.id) === false) {
  15012. rule.enabled = false;
  15013. }
  15014. });
  15015. }
  15016. if (typeof spec.branding !== 'undefined') {
  15017. audit.setBranding(spec.branding);
  15018. } else {
  15019. audit._constructHelpUrls();
  15020. }
  15021. if (spec.tagExclude) {
  15022. audit.tagExclude = spec.tagExclude;
  15023. }
  15024. if (spec.locale) {
  15025. audit.applyLocale(spec.locale);
  15026. }
  15027. if (spec.standards) {
  15028. configureStandards(spec.standards);
  15029. }
  15030. if (spec.noHtml) {
  15031. audit.noHtml = true;
  15032. }
  15033. if (spec.allowedOrigins) {
  15034. if (!Array.isArray(spec.allowedOrigins)) {
  15035. throw new TypeError('Allowed origins property must be an array');
  15036. }
  15037. if (spec.allowedOrigins.includes('*')) {
  15038. throw new Error('"*" is not allowed. Use "'.concat(constants_default.allOrigins, '" instead'));
  15039. }
  15040. audit.setAllowedOrigins(spec.allowedOrigins);
  15041. }
  15042. }
  15043. var configure_default = configure;
  15044. function frameMessenger2(frameHandler) {
  15045. _respondable.updateMessenger(frameHandler);
  15046. }
  15047. function getRules(tags) {
  15048. tags = tags || [];
  15049. var matchingRules = !tags.length ? axe._audit.rules : axe._audit.rules.filter(function(item) {
  15050. return !!tags.filter(function(tag) {
  15051. return item.tags.indexOf(tag) !== -1;
  15052. }).length;
  15053. });
  15054. var ruleData = axe._audit.data.rules || {};
  15055. return matchingRules.map(function(matchingRule) {
  15056. var rd = ruleData[matchingRule.id] || {};
  15057. return {
  15058. ruleId: matchingRule.id,
  15059. description: rd.description,
  15060. help: rd.help,
  15061. helpUrl: rd.helpUrl,
  15062. tags: matchingRule.tags,
  15063. actIds: matchingRule.actIds
  15064. };
  15065. });
  15066. }
  15067. var get_rules_default = getRules;
  15068. var aria_exports = {};
  15069. __export(aria_exports, {
  15070. allowedAttr: function allowedAttr() {
  15071. return allowed_attr_default;
  15072. },
  15073. arialabelText: function arialabelText() {
  15074. return arialabel_text_default;
  15075. },
  15076. arialabelledbyText: function arialabelledbyText() {
  15077. return arialabelledby_text_default;
  15078. },
  15079. getAccessibleRefs: function getAccessibleRefs() {
  15080. return get_accessible_refs_default;
  15081. },
  15082. getElementUnallowedRoles: function getElementUnallowedRoles() {
  15083. return get_element_unallowed_roles_default;
  15084. },
  15085. getExplicitRole: function getExplicitRole() {
  15086. return get_explicit_role_default;
  15087. },
  15088. getImplicitRole: function getImplicitRole() {
  15089. return implicit_role_default;
  15090. },
  15091. getOwnedVirtual: function getOwnedVirtual() {
  15092. return get_owned_virtual_default;
  15093. },
  15094. getRole: function getRole() {
  15095. return get_role_default;
  15096. },
  15097. getRoleType: function getRoleType() {
  15098. return get_role_type_default;
  15099. },
  15100. getRolesByType: function getRolesByType() {
  15101. return get_roles_by_type_default;
  15102. },
  15103. getRolesWithNameFromContents: function getRolesWithNameFromContents() {
  15104. return get_roles_with_name_from_contents_default;
  15105. },
  15106. implicitNodes: function implicitNodes() {
  15107. return implicit_nodes_default;
  15108. },
  15109. implicitRole: function implicitRole() {
  15110. return implicit_role_default;
  15111. },
  15112. isAccessibleRef: function isAccessibleRef() {
  15113. return is_accessible_ref_default;
  15114. },
  15115. isAriaRoleAllowedOnElement: function isAriaRoleAllowedOnElement() {
  15116. return is_aria_role_allowed_on_element_default;
  15117. },
  15118. isComboboxPopup: function isComboboxPopup() {
  15119. return _isComboboxPopup;
  15120. },
  15121. isUnsupportedRole: function isUnsupportedRole() {
  15122. return is_unsupported_role_default;
  15123. },
  15124. isValidRole: function isValidRole() {
  15125. return is_valid_role_default;
  15126. },
  15127. label: function label() {
  15128. return label_default2;
  15129. },
  15130. labelVirtual: function labelVirtual() {
  15131. return label_virtual_default;
  15132. },
  15133. lookupTable: function lookupTable() {
  15134. return lookup_table_default;
  15135. },
  15136. namedFromContents: function namedFromContents() {
  15137. return named_from_contents_default;
  15138. },
  15139. requiredAttr: function requiredAttr() {
  15140. return required_attr_default;
  15141. },
  15142. requiredContext: function requiredContext() {
  15143. return required_context_default;
  15144. },
  15145. requiredOwned: function requiredOwned() {
  15146. return required_owned_default;
  15147. },
  15148. validateAttr: function validateAttr() {
  15149. return validate_attr_default;
  15150. },
  15151. validateAttrValue: function validateAttrValue() {
  15152. return validate_attr_value_default;
  15153. }
  15154. });
  15155. function allowedAttr(role) {
  15156. var roleDef = standards_default.ariaRoles[role];
  15157. var attrs = _toConsumableArray(get_global_aria_attrs_default());
  15158. if (!roleDef) {
  15159. return attrs;
  15160. }
  15161. if (roleDef.allowedAttrs) {
  15162. attrs.push.apply(attrs, _toConsumableArray(roleDef.allowedAttrs));
  15163. }
  15164. if (roleDef.requiredAttrs) {
  15165. attrs.push.apply(attrs, _toConsumableArray(roleDef.requiredAttrs));
  15166. }
  15167. return attrs;
  15168. }
  15169. var allowed_attr_default = allowedAttr;
  15170. var idRefsRegex = /^idrefs?$/;
  15171. function cacheIdRefs(node, idRefs, refAttrs) {
  15172. if (node.hasAttribute) {
  15173. if (node.nodeName.toUpperCase() === 'LABEL' && node.hasAttribute('for')) {
  15174. var id = node.getAttribute('for');
  15175. idRefs[id] = idRefs[id] || [];
  15176. idRefs[id].push(node);
  15177. }
  15178. for (var _i19 = 0; _i19 < refAttrs.length; ++_i19) {
  15179. var attr = refAttrs[_i19];
  15180. var attrValue = sanitize_default(node.getAttribute(attr) || '');
  15181. if (!attrValue) {
  15182. continue;
  15183. }
  15184. var tokens = token_list_default(attrValue);
  15185. for (var k = 0; k < tokens.length; ++k) {
  15186. idRefs[tokens[k]] = idRefs[tokens[k]] || [];
  15187. idRefs[tokens[k]].push(node);
  15188. }
  15189. }
  15190. }
  15191. for (var _i20 = 0; _i20 < node.childNodes.length; _i20++) {
  15192. if (node.childNodes[_i20].nodeType === 1) {
  15193. cacheIdRefs(node.childNodes[_i20], idRefs, refAttrs);
  15194. }
  15195. }
  15196. }
  15197. function getAccessibleRefs(node) {
  15198. node = node.actualNode || node;
  15199. var root = get_root_node_default2(node);
  15200. root = root.documentElement || root;
  15201. var idRefsByRoot = cache_default.get('idRefsByRoot', function() {
  15202. return new WeakMap();
  15203. });
  15204. var idRefs = idRefsByRoot.get(root);
  15205. if (!idRefs) {
  15206. idRefs = {};
  15207. idRefsByRoot.set(root, idRefs);
  15208. var refAttrs = Object.keys(standards_default.ariaAttrs).filter(function(attr) {
  15209. var type = standards_default.ariaAttrs[attr].type;
  15210. return idRefsRegex.test(type);
  15211. });
  15212. cacheIdRefs(root, idRefs, refAttrs);
  15213. }
  15214. return idRefs[node.id] || [];
  15215. }
  15216. var get_accessible_refs_default = getAccessibleRefs;
  15217. function isAriaRoleAllowedOnElement(node, role) {
  15218. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  15219. var implicitRole3 = implicit_role_default(vNode);
  15220. var spec = get_element_spec_default(vNode);
  15221. if (Array.isArray(spec.allowedRoles)) {
  15222. return spec.allowedRoles.includes(role);
  15223. }
  15224. if (role === implicitRole3) {
  15225. return false;
  15226. }
  15227. return !!spec.allowedRoles;
  15228. }
  15229. var is_aria_role_allowed_on_element_default = isAriaRoleAllowedOnElement;
  15230. var dpubRoles2 = [ 'doc-backlink', 'doc-biblioentry', 'doc-biblioref', 'doc-cover', 'doc-endnote', 'doc-glossref', 'doc-noteref' ];
  15231. var landmarkRoles = {
  15232. header: 'banner',
  15233. footer: 'contentinfo'
  15234. };
  15235. function getRoleSegments(vNode) {
  15236. var roles = [];
  15237. if (!vNode) {
  15238. return roles;
  15239. }
  15240. if (vNode.hasAttr('role')) {
  15241. var nodeRoles = token_list_default(vNode.attr('role').toLowerCase());
  15242. roles = roles.concat(nodeRoles);
  15243. }
  15244. return roles.filter(function(role) {
  15245. return is_valid_role_default(role);
  15246. });
  15247. }
  15248. function getElementUnallowedRoles(node) {
  15249. var allowImplicit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  15250. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  15251. if (!is_html_element_default(vNode)) {
  15252. return [];
  15253. }
  15254. var nodeName2 = vNode.props.nodeName;
  15255. var implicitRole3 = implicit_role_default(vNode) || landmarkRoles[nodeName2];
  15256. var roleSegments = getRoleSegments(vNode);
  15257. return roleSegments.filter(function(role) {
  15258. return !roleIsAllowed(role, vNode, allowImplicit, implicitRole3);
  15259. });
  15260. }
  15261. function roleIsAllowed(role, vNode, allowImplicit, implicitRole3) {
  15262. if (allowImplicit && role === implicitRole3) {
  15263. return true;
  15264. }
  15265. if (dpubRoles2.includes(role) && get_role_type_default(role) !== implicitRole3) {
  15266. return false;
  15267. }
  15268. return is_aria_role_allowed_on_element_default(vNode, role);
  15269. }
  15270. var get_element_unallowed_roles_default = getElementUnallowedRoles;
  15271. function getAriaRolesByType(type) {
  15272. return Object.keys(standards_default.ariaRoles).filter(function(roleName) {
  15273. return standards_default.ariaRoles[roleName].type === type;
  15274. });
  15275. }
  15276. var get_aria_roles_by_type_default = getAriaRolesByType;
  15277. function getRolesByType(roleType) {
  15278. return get_aria_roles_by_type_default(roleType);
  15279. }
  15280. var get_roles_by_type_default = getRolesByType;
  15281. function getAriaRolesSupportingNameFromContent() {
  15282. return cache_default.get('ariaRolesNameFromContent', function() {
  15283. return Object.keys(standards_default.ariaRoles).filter(function(roleName) {
  15284. return standards_default.ariaRoles[roleName].nameFromContent;
  15285. });
  15286. });
  15287. }
  15288. var get_aria_roles_supporting_name_from_content_default = getAriaRolesSupportingNameFromContent;
  15289. function getRolesWithNameFromContents() {
  15290. return get_aria_roles_supporting_name_from_content_default();
  15291. }
  15292. var get_roles_with_name_from_contents_default = getRolesWithNameFromContents;
  15293. var isNull = function isNull(value) {
  15294. return value === null;
  15295. };
  15296. var isNotNull = function isNotNull(value) {
  15297. return value !== null;
  15298. };
  15299. var lookupTable = {};
  15300. lookupTable.attributes = {
  15301. 'aria-activedescendant': {
  15302. type: 'idref',
  15303. allowEmpty: true,
  15304. unsupported: false
  15305. },
  15306. 'aria-atomic': {
  15307. type: 'boolean',
  15308. values: [ 'true', 'false' ],
  15309. unsupported: false
  15310. },
  15311. 'aria-autocomplete': {
  15312. type: 'nmtoken',
  15313. values: [ 'inline', 'list', 'both', 'none' ],
  15314. unsupported: false
  15315. },
  15316. 'aria-busy': {
  15317. type: 'boolean',
  15318. values: [ 'true', 'false' ],
  15319. unsupported: false
  15320. },
  15321. 'aria-checked': {
  15322. type: 'nmtoken',
  15323. values: [ 'true', 'false', 'mixed', 'undefined' ],
  15324. unsupported: false
  15325. },
  15326. 'aria-colcount': {
  15327. type: 'int',
  15328. unsupported: false
  15329. },
  15330. 'aria-colindex': {
  15331. type: 'int',
  15332. unsupported: false
  15333. },
  15334. 'aria-colspan': {
  15335. type: 'int',
  15336. unsupported: false
  15337. },
  15338. 'aria-controls': {
  15339. type: 'idrefs',
  15340. allowEmpty: true,
  15341. unsupported: false
  15342. },
  15343. 'aria-current': {
  15344. type: 'nmtoken',
  15345. allowEmpty: true,
  15346. values: [ 'page', 'step', 'location', 'date', 'time', 'true', 'false' ],
  15347. unsupported: false
  15348. },
  15349. 'aria-describedby': {
  15350. type: 'idrefs',
  15351. allowEmpty: true,
  15352. unsupported: false
  15353. },
  15354. 'aria-describedat': {
  15355. unsupported: true,
  15356. unstandardized: true
  15357. },
  15358. 'aria-details': {
  15359. type: 'idref',
  15360. allowEmpty: true,
  15361. unsupported: false
  15362. },
  15363. 'aria-disabled': {
  15364. type: 'boolean',
  15365. values: [ 'true', 'false' ],
  15366. unsupported: false
  15367. },
  15368. 'aria-dropeffect': {
  15369. type: 'nmtokens',
  15370. values: [ 'copy', 'move', 'reference', 'execute', 'popup', 'none' ],
  15371. unsupported: false
  15372. },
  15373. 'aria-errormessage': {
  15374. type: 'idref',
  15375. allowEmpty: true,
  15376. unsupported: false
  15377. },
  15378. 'aria-expanded': {
  15379. type: 'nmtoken',
  15380. values: [ 'true', 'false', 'undefined' ],
  15381. unsupported: false
  15382. },
  15383. 'aria-flowto': {
  15384. type: 'idrefs',
  15385. allowEmpty: true,
  15386. unsupported: false
  15387. },
  15388. 'aria-grabbed': {
  15389. type: 'nmtoken',
  15390. values: [ 'true', 'false', 'undefined' ],
  15391. unsupported: false
  15392. },
  15393. 'aria-haspopup': {
  15394. type: 'nmtoken',
  15395. allowEmpty: true,
  15396. values: [ 'true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog' ],
  15397. unsupported: false
  15398. },
  15399. 'aria-hidden': {
  15400. type: 'boolean',
  15401. values: [ 'true', 'false' ],
  15402. unsupported: false
  15403. },
  15404. 'aria-invalid': {
  15405. type: 'nmtoken',
  15406. allowEmpty: true,
  15407. values: [ 'true', 'false', 'spelling', 'grammar' ],
  15408. unsupported: false
  15409. },
  15410. 'aria-keyshortcuts': {
  15411. type: 'string',
  15412. allowEmpty: true,
  15413. unsupported: false
  15414. },
  15415. 'aria-label': {
  15416. type: 'string',
  15417. allowEmpty: true,
  15418. unsupported: false
  15419. },
  15420. 'aria-labelledby': {
  15421. type: 'idrefs',
  15422. allowEmpty: true,
  15423. unsupported: false
  15424. },
  15425. 'aria-level': {
  15426. type: 'int',
  15427. unsupported: false
  15428. },
  15429. 'aria-live': {
  15430. type: 'nmtoken',
  15431. values: [ 'off', 'polite', 'assertive' ],
  15432. unsupported: false
  15433. },
  15434. 'aria-modal': {
  15435. type: 'boolean',
  15436. values: [ 'true', 'false' ],
  15437. unsupported: false
  15438. },
  15439. 'aria-multiline': {
  15440. type: 'boolean',
  15441. values: [ 'true', 'false' ],
  15442. unsupported: false
  15443. },
  15444. 'aria-multiselectable': {
  15445. type: 'boolean',
  15446. values: [ 'true', 'false' ],
  15447. unsupported: false
  15448. },
  15449. 'aria-orientation': {
  15450. type: 'nmtoken',
  15451. values: [ 'horizontal', 'vertical' ],
  15452. unsupported: false
  15453. },
  15454. 'aria-owns': {
  15455. type: 'idrefs',
  15456. allowEmpty: true,
  15457. unsupported: false
  15458. },
  15459. 'aria-placeholder': {
  15460. type: 'string',
  15461. allowEmpty: true,
  15462. unsupported: false
  15463. },
  15464. 'aria-posinset': {
  15465. type: 'int',
  15466. unsupported: false
  15467. },
  15468. 'aria-pressed': {
  15469. type: 'nmtoken',
  15470. values: [ 'true', 'false', 'mixed', 'undefined' ],
  15471. unsupported: false
  15472. },
  15473. 'aria-readonly': {
  15474. type: 'boolean',
  15475. values: [ 'true', 'false' ],
  15476. unsupported: false
  15477. },
  15478. 'aria-relevant': {
  15479. type: 'nmtokens',
  15480. values: [ 'additions', 'removals', 'text', 'all' ],
  15481. unsupported: false
  15482. },
  15483. 'aria-required': {
  15484. type: 'boolean',
  15485. values: [ 'true', 'false' ],
  15486. unsupported: false
  15487. },
  15488. 'aria-roledescription': {
  15489. type: 'string',
  15490. allowEmpty: true,
  15491. unsupported: false
  15492. },
  15493. 'aria-rowcount': {
  15494. type: 'int',
  15495. unsupported: false
  15496. },
  15497. 'aria-rowindex': {
  15498. type: 'int',
  15499. unsupported: false
  15500. },
  15501. 'aria-rowspan': {
  15502. type: 'int',
  15503. unsupported: false
  15504. },
  15505. 'aria-selected': {
  15506. type: 'nmtoken',
  15507. values: [ 'true', 'false', 'undefined' ],
  15508. unsupported: false
  15509. },
  15510. 'aria-setsize': {
  15511. type: 'int',
  15512. unsupported: false
  15513. },
  15514. 'aria-sort': {
  15515. type: 'nmtoken',
  15516. values: [ 'ascending', 'descending', 'other', 'none' ],
  15517. unsupported: false
  15518. },
  15519. 'aria-valuemax': {
  15520. type: 'decimal',
  15521. unsupported: false
  15522. },
  15523. 'aria-valuemin': {
  15524. type: 'decimal',
  15525. unsupported: false
  15526. },
  15527. 'aria-valuenow': {
  15528. type: 'decimal',
  15529. unsupported: false
  15530. },
  15531. 'aria-valuetext': {
  15532. type: 'string',
  15533. unsupported: false
  15534. }
  15535. };
  15536. lookupTable.globalAttributes = [ 'aria-atomic', 'aria-busy', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-live', 'aria-owns', 'aria-relevant', 'aria-roledescription' ];
  15537. lookupTable.role = {
  15538. alert: {
  15539. type: 'widget',
  15540. attributes: {
  15541. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15542. },
  15543. owned: null,
  15544. nameFrom: [ 'author' ],
  15545. context: null,
  15546. unsupported: false,
  15547. allowedElements: [ 'section' ]
  15548. },
  15549. alertdialog: {
  15550. type: 'widget',
  15551. attributes: {
  15552. allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ]
  15553. },
  15554. owned: null,
  15555. nameFrom: [ 'author' ],
  15556. context: null,
  15557. unsupported: false,
  15558. allowedElements: [ 'dialog', 'section' ]
  15559. },
  15560. application: {
  15561. type: 'landmark',
  15562. attributes: {
  15563. allowed: [ 'aria-expanded', 'aria-errormessage', 'aria-activedescendant' ]
  15564. },
  15565. owned: null,
  15566. nameFrom: [ 'author' ],
  15567. context: null,
  15568. unsupported: false,
  15569. allowedElements: [ 'article', 'audio', 'embed', 'iframe', 'object', 'section', 'svg', 'video' ]
  15570. },
  15571. article: {
  15572. type: 'structure',
  15573. attributes: {
  15574. allowed: [ 'aria-expanded', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  15575. },
  15576. owned: null,
  15577. nameFrom: [ 'author' ],
  15578. context: null,
  15579. implicit: [ 'article' ],
  15580. unsupported: false
  15581. },
  15582. banner: {
  15583. type: 'landmark',
  15584. attributes: {
  15585. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15586. },
  15587. owned: null,
  15588. nameFrom: [ 'author' ],
  15589. context: null,
  15590. implicit: [ 'header' ],
  15591. unsupported: false,
  15592. allowedElements: [ 'section' ]
  15593. },
  15594. button: {
  15595. type: 'widget',
  15596. attributes: {
  15597. allowed: [ 'aria-expanded', 'aria-pressed', 'aria-errormessage' ]
  15598. },
  15599. owned: null,
  15600. nameFrom: [ 'author', 'contents' ],
  15601. context: null,
  15602. implicit: [ 'button', 'input[type="button"]', 'input[type="image"]', 'input[type="reset"]', 'input[type="submit"]', 'summary' ],
  15603. unsupported: false,
  15604. allowedElements: [ {
  15605. nodeName: 'a',
  15606. attributes: {
  15607. href: isNotNull
  15608. }
  15609. } ]
  15610. },
  15611. cell: {
  15612. type: 'structure',
  15613. attributes: {
  15614. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-errormessage' ]
  15615. },
  15616. owned: null,
  15617. nameFrom: [ 'author', 'contents' ],
  15618. context: [ 'row' ],
  15619. implicit: [ 'td', 'th' ],
  15620. unsupported: false
  15621. },
  15622. checkbox: {
  15623. type: 'widget',
  15624. attributes: {
  15625. allowed: [ 'aria-checked', 'aria-required', 'aria-readonly', 'aria-errormessage' ]
  15626. },
  15627. owned: null,
  15628. nameFrom: [ 'author', 'contents' ],
  15629. context: null,
  15630. implicit: [ 'input[type="checkbox"]' ],
  15631. unsupported: false,
  15632. allowedElements: [ 'button' ]
  15633. },
  15634. columnheader: {
  15635. type: 'structure',
  15636. attributes: {
  15637. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ]
  15638. },
  15639. owned: null,
  15640. nameFrom: [ 'author', 'contents' ],
  15641. context: [ 'row' ],
  15642. implicit: [ 'th' ],
  15643. unsupported: false
  15644. },
  15645. combobox: {
  15646. type: 'composite',
  15647. attributes: {
  15648. allowed: [ 'aria-autocomplete', 'aria-required', 'aria-activedescendant', 'aria-orientation', 'aria-errormessage' ],
  15649. required: [ 'aria-expanded' ]
  15650. },
  15651. owned: {
  15652. all: [ 'listbox', 'tree', 'grid', 'dialog', 'textbox' ]
  15653. },
  15654. nameFrom: [ 'author' ],
  15655. context: null,
  15656. unsupported: false,
  15657. allowedElements: [ {
  15658. nodeName: 'input',
  15659. properties: {
  15660. type: [ 'text', 'search', 'tel', 'url', 'email' ]
  15661. }
  15662. } ]
  15663. },
  15664. command: {
  15665. nameFrom: [ 'author' ],
  15666. type: 'abstract',
  15667. unsupported: false
  15668. },
  15669. complementary: {
  15670. type: 'landmark',
  15671. attributes: {
  15672. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15673. },
  15674. owned: null,
  15675. nameFrom: [ 'author' ],
  15676. context: null,
  15677. implicit: [ 'aside' ],
  15678. unsupported: false,
  15679. allowedElements: [ 'section' ]
  15680. },
  15681. composite: {
  15682. nameFrom: [ 'author' ],
  15683. type: 'abstract',
  15684. unsupported: false
  15685. },
  15686. contentinfo: {
  15687. type: 'landmark',
  15688. attributes: {
  15689. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15690. },
  15691. owned: null,
  15692. nameFrom: [ 'author' ],
  15693. context: null,
  15694. implicit: [ 'footer' ],
  15695. unsupported: false,
  15696. allowedElements: [ 'section' ]
  15697. },
  15698. definition: {
  15699. type: 'structure',
  15700. attributes: {
  15701. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15702. },
  15703. owned: null,
  15704. nameFrom: [ 'author' ],
  15705. context: null,
  15706. implicit: [ 'dd', 'dfn' ],
  15707. unsupported: false
  15708. },
  15709. dialog: {
  15710. type: 'widget',
  15711. attributes: {
  15712. allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ]
  15713. },
  15714. owned: null,
  15715. nameFrom: [ 'author' ],
  15716. context: null,
  15717. implicit: [ 'dialog' ],
  15718. unsupported: false,
  15719. allowedElements: [ 'section' ]
  15720. },
  15721. directory: {
  15722. type: 'structure',
  15723. attributes: {
  15724. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15725. },
  15726. owned: null,
  15727. nameFrom: [ 'author', 'contents' ],
  15728. context: null,
  15729. unsupported: false,
  15730. allowedElements: [ 'ol', 'ul' ]
  15731. },
  15732. document: {
  15733. type: 'structure',
  15734. attributes: {
  15735. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15736. },
  15737. owned: null,
  15738. nameFrom: [ 'author' ],
  15739. context: null,
  15740. implicit: [ 'body' ],
  15741. unsupported: false,
  15742. allowedElements: [ 'article', 'embed', 'iframe', 'object', 'section', 'svg' ]
  15743. },
  15744. 'doc-abstract': {
  15745. type: 'section',
  15746. attributes: {
  15747. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15748. },
  15749. owned: null,
  15750. nameFrom: [ 'author' ],
  15751. context: null,
  15752. unsupported: false,
  15753. allowedElements: [ 'section' ]
  15754. },
  15755. 'doc-acknowledgments': {
  15756. type: 'landmark',
  15757. attributes: {
  15758. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15759. },
  15760. owned: null,
  15761. nameFrom: [ 'author' ],
  15762. context: null,
  15763. unsupported: false,
  15764. allowedElements: [ 'section' ]
  15765. },
  15766. 'doc-afterword': {
  15767. type: 'landmark',
  15768. attributes: {
  15769. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15770. },
  15771. owned: null,
  15772. nameFrom: [ 'author' ],
  15773. context: null,
  15774. unsupported: false,
  15775. allowedElements: [ 'section' ]
  15776. },
  15777. 'doc-appendix': {
  15778. type: 'landmark',
  15779. attributes: {
  15780. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15781. },
  15782. owned: null,
  15783. nameFrom: [ 'author' ],
  15784. context: null,
  15785. unsupported: false,
  15786. allowedElements: [ 'section' ]
  15787. },
  15788. 'doc-backlink': {
  15789. type: 'link',
  15790. attributes: {
  15791. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15792. },
  15793. owned: null,
  15794. nameFrom: [ 'author', 'contents' ],
  15795. context: null,
  15796. unsupported: false,
  15797. allowedElements: [ {
  15798. nodeName: 'a',
  15799. attributes: {
  15800. href: isNotNull
  15801. }
  15802. } ]
  15803. },
  15804. 'doc-biblioentry': {
  15805. type: 'listitem',
  15806. attributes: {
  15807. allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  15808. },
  15809. owned: null,
  15810. nameFrom: [ 'author' ],
  15811. context: [ 'doc-bibliography' ],
  15812. unsupported: false,
  15813. allowedElements: [ 'li' ]
  15814. },
  15815. 'doc-bibliography': {
  15816. type: 'landmark',
  15817. attributes: {
  15818. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15819. },
  15820. owned: {
  15821. one: [ 'doc-biblioentry' ]
  15822. },
  15823. nameFrom: [ 'author' ],
  15824. context: null,
  15825. unsupported: false,
  15826. allowedElements: [ 'section' ]
  15827. },
  15828. 'doc-biblioref': {
  15829. type: 'link',
  15830. attributes: {
  15831. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15832. },
  15833. owned: null,
  15834. nameFrom: [ 'author', 'contents' ],
  15835. context: null,
  15836. unsupported: false,
  15837. allowedElements: [ {
  15838. nodeName: 'a',
  15839. attributes: {
  15840. href: isNotNull
  15841. }
  15842. } ]
  15843. },
  15844. 'doc-chapter': {
  15845. type: 'landmark',
  15846. attributes: {
  15847. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15848. },
  15849. owned: null,
  15850. namefrom: [ 'author' ],
  15851. context: null,
  15852. unsupported: false,
  15853. allowedElements: [ 'section' ]
  15854. },
  15855. 'doc-colophon': {
  15856. type: 'section',
  15857. attributes: {
  15858. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15859. },
  15860. owned: null,
  15861. namefrom: [ 'author' ],
  15862. context: null,
  15863. unsupported: false,
  15864. allowedElements: [ 'section' ]
  15865. },
  15866. 'doc-conclusion': {
  15867. type: 'landmark',
  15868. attributes: {
  15869. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15870. },
  15871. owned: null,
  15872. namefrom: [ 'author' ],
  15873. context: null,
  15874. unsupported: false,
  15875. allowedElements: [ 'section' ]
  15876. },
  15877. 'doc-cover': {
  15878. type: 'img',
  15879. attributes: {
  15880. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15881. },
  15882. owned: null,
  15883. namefrom: [ 'author' ],
  15884. context: null,
  15885. unsupported: false
  15886. },
  15887. 'doc-credit': {
  15888. type: 'section',
  15889. attributes: {
  15890. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15891. },
  15892. owned: null,
  15893. namefrom: [ 'author' ],
  15894. context: null,
  15895. unsupported: false,
  15896. allowedElements: [ 'section' ]
  15897. },
  15898. 'doc-credits': {
  15899. type: 'landmark',
  15900. attributes: {
  15901. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15902. },
  15903. owned: null,
  15904. namefrom: [ 'author' ],
  15905. context: null,
  15906. unsupported: false,
  15907. allowedElements: [ 'section' ]
  15908. },
  15909. 'doc-dedication': {
  15910. type: 'section',
  15911. attributes: {
  15912. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15913. },
  15914. owned: null,
  15915. namefrom: [ 'author' ],
  15916. context: null,
  15917. unsupported: false,
  15918. allowedElements: [ 'section' ]
  15919. },
  15920. 'doc-endnote': {
  15921. type: 'listitem',
  15922. attributes: {
  15923. allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  15924. },
  15925. owned: null,
  15926. namefrom: [ 'author' ],
  15927. context: [ 'doc-endnotes' ],
  15928. unsupported: false,
  15929. allowedElements: [ 'li' ]
  15930. },
  15931. 'doc-endnotes': {
  15932. type: 'landmark',
  15933. attributes: {
  15934. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15935. },
  15936. owned: {
  15937. one: [ 'doc-endnote' ]
  15938. },
  15939. namefrom: [ 'author' ],
  15940. context: null,
  15941. unsupported: false,
  15942. allowedElements: [ 'section' ]
  15943. },
  15944. 'doc-epigraph': {
  15945. type: 'section',
  15946. attributes: {
  15947. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15948. },
  15949. owned: null,
  15950. namefrom: [ 'author' ],
  15951. context: null,
  15952. unsupported: false
  15953. },
  15954. 'doc-epilogue': {
  15955. type: 'landmark',
  15956. attributes: {
  15957. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15958. },
  15959. owned: null,
  15960. namefrom: [ 'author' ],
  15961. context: null,
  15962. unsupported: false,
  15963. allowedElements: [ 'section' ]
  15964. },
  15965. 'doc-errata': {
  15966. type: 'landmark',
  15967. attributes: {
  15968. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15969. },
  15970. owned: null,
  15971. namefrom: [ 'author' ],
  15972. context: null,
  15973. unsupported: false,
  15974. allowedElements: [ 'section' ]
  15975. },
  15976. 'doc-example': {
  15977. type: 'section',
  15978. attributes: {
  15979. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15980. },
  15981. owned: null,
  15982. namefrom: [ 'author' ],
  15983. context: null,
  15984. unsupported: false,
  15985. allowedElements: [ 'aside', 'section' ]
  15986. },
  15987. 'doc-footnote': {
  15988. type: 'section',
  15989. attributes: {
  15990. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  15991. },
  15992. owned: null,
  15993. namefrom: [ 'author' ],
  15994. context: null,
  15995. unsupported: false,
  15996. allowedElements: [ 'aside', 'footer', 'header' ]
  15997. },
  15998. 'doc-foreword': {
  15999. type: 'landmark',
  16000. attributes: {
  16001. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16002. },
  16003. owned: null,
  16004. namefrom: [ 'author' ],
  16005. context: null,
  16006. unsupported: false,
  16007. allowedElements: [ 'section' ]
  16008. },
  16009. 'doc-glossary': {
  16010. type: 'landmark',
  16011. attributes: {
  16012. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16013. },
  16014. owned: [ 'term', 'definition' ],
  16015. namefrom: [ 'author' ],
  16016. context: null,
  16017. unsupported: false,
  16018. allowedElements: [ 'dl' ]
  16019. },
  16020. 'doc-glossref': {
  16021. type: 'link',
  16022. attributes: {
  16023. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16024. },
  16025. owned: null,
  16026. namefrom: [ 'author', 'contents' ],
  16027. context: null,
  16028. unsupported: false,
  16029. allowedElements: [ {
  16030. nodeName: 'a',
  16031. attributes: {
  16032. href: isNotNull
  16033. }
  16034. } ]
  16035. },
  16036. 'doc-index': {
  16037. type: 'navigation',
  16038. attributes: {
  16039. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16040. },
  16041. owned: null,
  16042. namefrom: [ 'author' ],
  16043. context: null,
  16044. unsupported: false,
  16045. allowedElements: [ 'nav', 'section' ]
  16046. },
  16047. 'doc-introduction': {
  16048. type: 'landmark',
  16049. attributes: {
  16050. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16051. },
  16052. owned: null,
  16053. namefrom: [ 'author' ],
  16054. context: null,
  16055. unsupported: false,
  16056. allowedElements: [ 'section' ]
  16057. },
  16058. 'doc-noteref': {
  16059. type: 'link',
  16060. attributes: {
  16061. allowed: [ 'aria-expanded' ]
  16062. },
  16063. owned: null,
  16064. namefrom: [ 'author', 'contents' ],
  16065. context: null,
  16066. unsupported: false,
  16067. allowedElements: [ {
  16068. nodeName: 'a',
  16069. attributes: {
  16070. href: isNotNull
  16071. }
  16072. } ]
  16073. },
  16074. 'doc-notice': {
  16075. type: 'note',
  16076. attributes: {
  16077. allowed: [ 'aria-expanded' ]
  16078. },
  16079. owned: null,
  16080. namefrom: [ 'author' ],
  16081. context: null,
  16082. unsupported: false,
  16083. allowedElements: [ 'section' ]
  16084. },
  16085. 'doc-pagebreak': {
  16086. type: 'separator',
  16087. attributes: {
  16088. allowed: [ 'aria-expanded' ]
  16089. },
  16090. owned: null,
  16091. namefrom: [ 'author' ],
  16092. context: null,
  16093. unsupported: false,
  16094. allowedElements: [ 'hr' ]
  16095. },
  16096. 'doc-pagelist': {
  16097. type: 'navigation',
  16098. attributes: {
  16099. allowed: [ 'aria-expanded' ]
  16100. },
  16101. owned: null,
  16102. namefrom: [ 'author' ],
  16103. context: null,
  16104. unsupported: false,
  16105. allowedElements: [ 'nav', 'section' ]
  16106. },
  16107. 'doc-part': {
  16108. type: 'landmark',
  16109. attributes: {
  16110. allowed: [ 'aria-expanded' ]
  16111. },
  16112. owned: null,
  16113. namefrom: [ 'author' ],
  16114. context: null,
  16115. unsupported: false,
  16116. allowedElements: [ 'section' ]
  16117. },
  16118. 'doc-preface': {
  16119. type: 'landmark',
  16120. attributes: {
  16121. allowed: [ 'aria-expanded' ]
  16122. },
  16123. owned: null,
  16124. namefrom: [ 'author' ],
  16125. context: null,
  16126. unsupported: false,
  16127. allowedElements: [ 'section' ]
  16128. },
  16129. 'doc-prologue': {
  16130. type: 'landmark',
  16131. attributes: {
  16132. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16133. },
  16134. owned: null,
  16135. namefrom: [ 'author' ],
  16136. context: null,
  16137. unsupported: false,
  16138. allowedElements: [ 'section' ]
  16139. },
  16140. 'doc-pullquote': {
  16141. type: 'none',
  16142. attributes: {
  16143. allowed: [ 'aria-expanded' ]
  16144. },
  16145. owned: null,
  16146. namefrom: [ 'author' ],
  16147. context: null,
  16148. unsupported: false,
  16149. allowedElements: [ 'aside', 'section' ]
  16150. },
  16151. 'doc-qna': {
  16152. type: 'section',
  16153. attributes: {
  16154. allowed: [ 'aria-expanded' ]
  16155. },
  16156. owned: null,
  16157. namefrom: [ 'author' ],
  16158. context: null,
  16159. unsupported: false,
  16160. allowedElements: [ 'section' ]
  16161. },
  16162. 'doc-subtitle': {
  16163. type: 'sectionhead',
  16164. attributes: {
  16165. allowed: [ 'aria-expanded' ]
  16166. },
  16167. owned: null,
  16168. namefrom: [ 'author' ],
  16169. context: null,
  16170. unsupported: false,
  16171. allowedElements: {
  16172. nodeName: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ]
  16173. }
  16174. },
  16175. 'doc-tip': {
  16176. type: 'note',
  16177. attributes: {
  16178. allowed: [ 'aria-expanded' ]
  16179. },
  16180. owned: null,
  16181. namefrom: [ 'author' ],
  16182. context: null,
  16183. unsupported: false,
  16184. allowedElements: [ 'aside' ]
  16185. },
  16186. 'doc-toc': {
  16187. type: 'navigation',
  16188. attributes: {
  16189. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16190. },
  16191. owned: null,
  16192. namefrom: [ 'author' ],
  16193. context: null,
  16194. unsupported: false,
  16195. allowedElements: [ 'nav', 'section' ]
  16196. },
  16197. feed: {
  16198. type: 'structure',
  16199. attributes: {
  16200. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16201. },
  16202. owned: {
  16203. one: [ 'article' ]
  16204. },
  16205. nameFrom: [ 'author' ],
  16206. context: null,
  16207. unsupported: false,
  16208. allowedElements: [ 'article', 'aside', 'section' ]
  16209. },
  16210. figure: {
  16211. type: 'structure',
  16212. attributes: {
  16213. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16214. },
  16215. owned: null,
  16216. nameFrom: [ 'author', 'contents' ],
  16217. context: null,
  16218. implicit: [ 'figure' ],
  16219. unsupported: false
  16220. },
  16221. form: {
  16222. type: 'landmark',
  16223. attributes: {
  16224. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16225. },
  16226. owned: null,
  16227. nameFrom: [ 'author' ],
  16228. context: null,
  16229. implicit: [ 'form' ],
  16230. unsupported: false
  16231. },
  16232. grid: {
  16233. type: 'composite',
  16234. attributes: {
  16235. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-colcount', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-rowcount', 'aria-errormessage' ]
  16236. },
  16237. owned: {
  16238. one: [ 'rowgroup', 'row' ]
  16239. },
  16240. nameFrom: [ 'author' ],
  16241. context: null,
  16242. implicit: [ 'table' ],
  16243. unsupported: false
  16244. },
  16245. gridcell: {
  16246. type: 'widget',
  16247. attributes: {
  16248. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-readonly', 'aria-required', 'aria-errormessage' ]
  16249. },
  16250. owned: null,
  16251. nameFrom: [ 'author', 'contents' ],
  16252. context: [ 'row' ],
  16253. implicit: [ 'td', 'th' ],
  16254. unsupported: false
  16255. },
  16256. group: {
  16257. type: 'structure',
  16258. attributes: {
  16259. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ]
  16260. },
  16261. owned: null,
  16262. nameFrom: [ 'author' ],
  16263. context: null,
  16264. implicit: [ 'details', 'optgroup' ],
  16265. unsupported: false,
  16266. allowedElements: [ 'dl', 'figcaption', 'fieldset', 'figure', 'footer', 'header', 'ol', 'ul' ]
  16267. },
  16268. heading: {
  16269. type: 'structure',
  16270. attributes: {
  16271. required: [ 'aria-level' ],
  16272. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16273. },
  16274. owned: null,
  16275. nameFrom: [ 'author', 'contents' ],
  16276. context: null,
  16277. implicit: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],
  16278. unsupported: false
  16279. },
  16280. img: {
  16281. type: 'structure',
  16282. attributes: {
  16283. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16284. },
  16285. owned: null,
  16286. nameFrom: [ 'author' ],
  16287. context: null,
  16288. implicit: [ 'img' ],
  16289. unsupported: false,
  16290. allowedElements: [ 'embed', 'iframe', 'object', 'svg' ]
  16291. },
  16292. input: {
  16293. nameFrom: [ 'author' ],
  16294. type: 'abstract',
  16295. unsupported: false
  16296. },
  16297. landmark: {
  16298. nameFrom: [ 'author' ],
  16299. type: 'abstract',
  16300. unsupported: false
  16301. },
  16302. link: {
  16303. type: 'widget',
  16304. attributes: {
  16305. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16306. },
  16307. owned: null,
  16308. nameFrom: [ 'author', 'contents' ],
  16309. context: null,
  16310. implicit: [ 'a[href]', 'area[href]' ],
  16311. unsupported: false,
  16312. allowedElements: [ 'button', {
  16313. nodeName: 'input',
  16314. properties: {
  16315. type: [ 'image', 'button' ]
  16316. }
  16317. } ]
  16318. },
  16319. list: {
  16320. type: 'structure',
  16321. attributes: {
  16322. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16323. },
  16324. owned: {
  16325. all: [ 'listitem' ]
  16326. },
  16327. nameFrom: [ 'author' ],
  16328. context: null,
  16329. implicit: [ 'ol', 'ul', 'dl' ],
  16330. unsupported: false
  16331. },
  16332. listbox: {
  16333. type: 'composite',
  16334. attributes: {
  16335. allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  16336. },
  16337. owned: {
  16338. all: [ 'option' ]
  16339. },
  16340. nameFrom: [ 'author' ],
  16341. context: null,
  16342. implicit: [ 'select' ],
  16343. unsupported: false,
  16344. allowedElements: [ 'ol', 'ul' ]
  16345. },
  16346. listitem: {
  16347. type: 'structure',
  16348. attributes: {
  16349. allowed: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ]
  16350. },
  16351. owned: null,
  16352. nameFrom: [ 'author', 'contents' ],
  16353. context: [ 'list' ],
  16354. implicit: [ 'li', 'dt' ],
  16355. unsupported: false
  16356. },
  16357. log: {
  16358. type: 'widget',
  16359. attributes: {
  16360. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16361. },
  16362. owned: null,
  16363. nameFrom: [ 'author' ],
  16364. context: null,
  16365. unsupported: false,
  16366. allowedElements: [ 'section' ]
  16367. },
  16368. main: {
  16369. type: 'landmark',
  16370. attributes: {
  16371. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16372. },
  16373. owned: null,
  16374. nameFrom: [ 'author' ],
  16375. context: null,
  16376. implicit: [ 'main' ],
  16377. unsupported: false,
  16378. allowedElements: [ 'article', 'section' ]
  16379. },
  16380. marquee: {
  16381. type: 'widget',
  16382. attributes: {
  16383. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16384. },
  16385. owned: null,
  16386. nameFrom: [ 'author' ],
  16387. context: null,
  16388. unsupported: false,
  16389. allowedElements: [ 'section' ]
  16390. },
  16391. math: {
  16392. type: 'structure',
  16393. attributes: {
  16394. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16395. },
  16396. owned: null,
  16397. nameFrom: [ 'author' ],
  16398. context: null,
  16399. implicit: [ 'math' ],
  16400. unsupported: false
  16401. },
  16402. menu: {
  16403. type: 'composite',
  16404. attributes: {
  16405. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  16406. },
  16407. owned: {
  16408. one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ]
  16409. },
  16410. nameFrom: [ 'author' ],
  16411. context: null,
  16412. implicit: [ 'menu[type="context"]' ],
  16413. unsupported: false,
  16414. allowedElements: [ 'ol', 'ul' ]
  16415. },
  16416. menubar: {
  16417. type: 'composite',
  16418. attributes: {
  16419. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  16420. },
  16421. owned: {
  16422. one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ]
  16423. },
  16424. nameFrom: [ 'author' ],
  16425. context: null,
  16426. unsupported: false,
  16427. allowedElements: [ 'ol', 'ul' ]
  16428. },
  16429. menuitem: {
  16430. type: 'widget',
  16431. attributes: {
  16432. allowed: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ]
  16433. },
  16434. owned: null,
  16435. nameFrom: [ 'author', 'contents' ],
  16436. context: [ 'menu', 'menubar' ],
  16437. implicit: [ 'menuitem[type="command"]' ],
  16438. unsupported: false,
  16439. allowedElements: [ 'button', 'li', {
  16440. nodeName: 'iput',
  16441. properties: {
  16442. type: [ 'image', 'button' ]
  16443. }
  16444. }, {
  16445. nodeName: 'a',
  16446. attributes: {
  16447. href: isNotNull
  16448. }
  16449. } ]
  16450. },
  16451. menuitemcheckbox: {
  16452. type: 'widget',
  16453. attributes: {
  16454. allowed: [ 'aria-checked', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  16455. },
  16456. owned: null,
  16457. nameFrom: [ 'author', 'contents' ],
  16458. context: [ 'menu', 'menubar' ],
  16459. implicit: [ 'menuitem[type="checkbox"]' ],
  16460. unsupported: false,
  16461. allowedElements: [ {
  16462. nodeName: [ 'button', 'li' ]
  16463. }, {
  16464. nodeName: 'input',
  16465. properties: {
  16466. type: [ 'checkbox', 'image', 'button' ]
  16467. }
  16468. }, {
  16469. nodeName: 'a',
  16470. attributes: {
  16471. href: isNotNull
  16472. }
  16473. } ]
  16474. },
  16475. menuitemradio: {
  16476. type: 'widget',
  16477. attributes: {
  16478. allowed: [ 'aria-checked', 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  16479. },
  16480. owned: null,
  16481. nameFrom: [ 'author', 'contents' ],
  16482. context: [ 'menu', 'menubar' ],
  16483. implicit: [ 'menuitem[type="radio"]' ],
  16484. unsupported: false,
  16485. allowedElements: [ {
  16486. nodeName: [ 'button', 'li' ]
  16487. }, {
  16488. nodeName: 'input',
  16489. properties: {
  16490. type: [ 'image', 'button', 'radio' ]
  16491. }
  16492. }, {
  16493. nodeName: 'a',
  16494. attributes: {
  16495. href: isNotNull
  16496. }
  16497. } ]
  16498. },
  16499. navigation: {
  16500. type: 'landmark',
  16501. attributes: {
  16502. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16503. },
  16504. owned: null,
  16505. nameFrom: [ 'author' ],
  16506. context: null,
  16507. implicit: [ 'nav' ],
  16508. unsupported: false,
  16509. allowedElements: [ 'section' ]
  16510. },
  16511. none: {
  16512. type: 'structure',
  16513. attributes: null,
  16514. owned: null,
  16515. nameFrom: [ 'author' ],
  16516. context: null,
  16517. unsupported: false,
  16518. allowedElements: [ {
  16519. nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ]
  16520. }, {
  16521. nodeName: 'img',
  16522. attributes: {
  16523. alt: isNotNull
  16524. }
  16525. } ]
  16526. },
  16527. note: {
  16528. type: 'structure',
  16529. attributes: {
  16530. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16531. },
  16532. owned: null,
  16533. nameFrom: [ 'author' ],
  16534. context: null,
  16535. unsupported: false,
  16536. allowedElements: [ 'aside' ]
  16537. },
  16538. option: {
  16539. type: 'widget',
  16540. attributes: {
  16541. allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-checked', 'aria-errormessage' ]
  16542. },
  16543. owned: null,
  16544. nameFrom: [ 'author', 'contents' ],
  16545. context: [ 'listbox' ],
  16546. implicit: [ 'option' ],
  16547. unsupported: false,
  16548. allowedElements: [ {
  16549. nodeName: [ 'button', 'li' ]
  16550. }, {
  16551. nodeName: 'input',
  16552. properties: {
  16553. type: [ 'checkbox', 'button' ]
  16554. }
  16555. }, {
  16556. nodeName: 'a',
  16557. attributes: {
  16558. href: isNotNull
  16559. }
  16560. } ]
  16561. },
  16562. presentation: {
  16563. type: 'structure',
  16564. attributes: null,
  16565. owned: null,
  16566. nameFrom: [ 'author' ],
  16567. context: null,
  16568. unsupported: false,
  16569. allowedElements: [ {
  16570. nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ]
  16571. }, {
  16572. nodeName: 'img',
  16573. attributes: {
  16574. alt: isNotNull
  16575. }
  16576. } ]
  16577. },
  16578. progressbar: {
  16579. type: 'widget',
  16580. attributes: {
  16581. allowed: [ 'aria-valuetext', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-expanded', 'aria-errormessage' ]
  16582. },
  16583. owned: null,
  16584. nameFrom: [ 'author' ],
  16585. context: null,
  16586. implicit: [ 'progress' ],
  16587. unsupported: false
  16588. },
  16589. radio: {
  16590. type: 'widget',
  16591. attributes: {
  16592. allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-required', 'aria-errormessage', 'aria-checked' ]
  16593. },
  16594. owned: null,
  16595. nameFrom: [ 'author', 'contents' ],
  16596. context: null,
  16597. implicit: [ 'input[type="radio"]' ],
  16598. unsupported: false,
  16599. allowedElements: [ {
  16600. nodeName: [ 'button', 'li' ]
  16601. }, {
  16602. nodeName: 'input',
  16603. properties: {
  16604. type: [ 'image', 'button' ]
  16605. }
  16606. } ]
  16607. },
  16608. radiogroup: {
  16609. type: 'composite',
  16610. attributes: {
  16611. allowed: [ 'aria-activedescendant', 'aria-required', 'aria-expanded', 'aria-readonly', 'aria-errormessage', 'aria-orientation' ]
  16612. },
  16613. owned: {
  16614. all: [ 'radio' ]
  16615. },
  16616. nameFrom: [ 'author' ],
  16617. context: null,
  16618. unsupported: false,
  16619. allowedElements: {
  16620. nodeName: [ 'ol', 'ul', 'fieldset' ]
  16621. }
  16622. },
  16623. range: {
  16624. nameFrom: [ 'author' ],
  16625. type: 'abstract',
  16626. unsupported: false
  16627. },
  16628. region: {
  16629. type: 'landmark',
  16630. attributes: {
  16631. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16632. },
  16633. owned: null,
  16634. nameFrom: [ 'author' ],
  16635. context: null,
  16636. implicit: [ 'section[aria-label]', 'section[aria-labelledby]', 'section[title]' ],
  16637. unsupported: false,
  16638. allowedElements: {
  16639. nodeName: [ 'article', 'aside' ]
  16640. }
  16641. },
  16642. roletype: {
  16643. type: 'abstract',
  16644. unsupported: false
  16645. },
  16646. row: {
  16647. type: 'structure',
  16648. attributes: {
  16649. allowed: [ 'aria-activedescendant', 'aria-colindex', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowindex', 'aria-errormessage' ]
  16650. },
  16651. owned: {
  16652. one: [ 'cell', 'columnheader', 'rowheader', 'gridcell' ]
  16653. },
  16654. nameFrom: [ 'author', 'contents' ],
  16655. context: [ 'rowgroup', 'grid', 'treegrid', 'table' ],
  16656. implicit: [ 'tr' ],
  16657. unsupported: false
  16658. },
  16659. rowgroup: {
  16660. type: 'structure',
  16661. attributes: {
  16662. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ]
  16663. },
  16664. owned: {
  16665. all: [ 'row' ]
  16666. },
  16667. nameFrom: [ 'author', 'contents' ],
  16668. context: [ 'grid', 'table', 'treegrid' ],
  16669. implicit: [ 'tbody', 'thead', 'tfoot' ],
  16670. unsupported: false
  16671. },
  16672. rowheader: {
  16673. type: 'structure',
  16674. attributes: {
  16675. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ]
  16676. },
  16677. owned: null,
  16678. nameFrom: [ 'author', 'contents' ],
  16679. context: [ 'row' ],
  16680. implicit: [ 'th' ],
  16681. unsupported: false
  16682. },
  16683. scrollbar: {
  16684. type: 'widget',
  16685. attributes: {
  16686. required: [ 'aria-controls', 'aria-valuenow' ],
  16687. allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ]
  16688. },
  16689. owned: null,
  16690. nameFrom: [ 'author' ],
  16691. context: null,
  16692. unsupported: false
  16693. },
  16694. search: {
  16695. type: 'landmark',
  16696. attributes: {
  16697. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16698. },
  16699. owned: null,
  16700. nameFrom: [ 'author' ],
  16701. context: null,
  16702. unsupported: false,
  16703. allowedElements: {
  16704. nodeName: [ 'aside', 'form', 'section' ]
  16705. }
  16706. },
  16707. searchbox: {
  16708. type: 'widget',
  16709. attributes: {
  16710. allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ]
  16711. },
  16712. owned: null,
  16713. nameFrom: [ 'author' ],
  16714. context: null,
  16715. implicit: [ 'input[type="search"]' ],
  16716. unsupported: false,
  16717. allowedElements: {
  16718. nodeName: 'input',
  16719. properties: {
  16720. type: 'text'
  16721. }
  16722. }
  16723. },
  16724. section: {
  16725. nameFrom: [ 'author', 'contents' ],
  16726. type: 'abstract',
  16727. unsupported: false
  16728. },
  16729. sectionhead: {
  16730. nameFrom: [ 'author', 'contents' ],
  16731. type: 'abstract',
  16732. unsupported: false
  16733. },
  16734. select: {
  16735. nameFrom: [ 'author' ],
  16736. type: 'abstract',
  16737. unsupported: false
  16738. },
  16739. separator: {
  16740. type: 'structure',
  16741. attributes: {
  16742. allowed: [ 'aria-expanded', 'aria-orientation', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext', 'aria-errormessage' ]
  16743. },
  16744. owned: null,
  16745. nameFrom: [ 'author' ],
  16746. context: null,
  16747. implicit: [ 'hr' ],
  16748. unsupported: false,
  16749. allowedElements: [ 'li' ]
  16750. },
  16751. slider: {
  16752. type: 'widget',
  16753. attributes: {
  16754. allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ],
  16755. required: [ 'aria-valuenow' ]
  16756. },
  16757. owned: null,
  16758. nameFrom: [ 'author' ],
  16759. context: null,
  16760. implicit: [ 'input[type="range"]' ],
  16761. unsupported: false
  16762. },
  16763. spinbutton: {
  16764. type: 'widget',
  16765. attributes: {
  16766. allowed: [ 'aria-valuetext', 'aria-required', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ],
  16767. required: [ 'aria-valuenow' ]
  16768. },
  16769. owned: null,
  16770. nameFrom: [ 'author' ],
  16771. context: null,
  16772. implicit: [ 'input[type="number"]' ],
  16773. unsupported: false,
  16774. allowedElements: {
  16775. nodeName: 'input',
  16776. properties: {
  16777. type: [ 'text', 'tel' ]
  16778. }
  16779. }
  16780. },
  16781. status: {
  16782. type: 'widget',
  16783. attributes: {
  16784. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16785. },
  16786. owned: null,
  16787. nameFrom: [ 'author' ],
  16788. context: null,
  16789. implicit: [ 'output' ],
  16790. unsupported: false,
  16791. allowedElements: [ 'section' ]
  16792. },
  16793. structure: {
  16794. type: 'abstract',
  16795. unsupported: false
  16796. },
  16797. switch: {
  16798. type: 'widget',
  16799. attributes: {
  16800. allowed: [ 'aria-errormessage' ],
  16801. required: [ 'aria-checked' ]
  16802. },
  16803. owned: null,
  16804. nameFrom: [ 'author', 'contents' ],
  16805. context: null,
  16806. unsupported: false,
  16807. allowedElements: [ 'button', {
  16808. nodeName: 'input',
  16809. properties: {
  16810. type: [ 'checkbox', 'image', 'button' ]
  16811. }
  16812. }, {
  16813. nodeName: 'a',
  16814. attributes: {
  16815. href: isNotNull
  16816. }
  16817. } ]
  16818. },
  16819. tab: {
  16820. type: 'widget',
  16821. attributes: {
  16822. allowed: [ 'aria-selected', 'aria-expanded', 'aria-setsize', 'aria-posinset', 'aria-errormessage' ]
  16823. },
  16824. owned: null,
  16825. nameFrom: [ 'author', 'contents' ],
  16826. context: [ 'tablist' ],
  16827. unsupported: false,
  16828. allowedElements: [ {
  16829. nodeName: [ 'button', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li' ]
  16830. }, {
  16831. nodeName: 'input',
  16832. properties: {
  16833. type: 'button'
  16834. }
  16835. }, {
  16836. nodeName: 'a',
  16837. attributes: {
  16838. href: isNotNull
  16839. }
  16840. } ]
  16841. },
  16842. table: {
  16843. type: 'structure',
  16844. attributes: {
  16845. allowed: [ 'aria-colcount', 'aria-rowcount', 'aria-errormessage' ]
  16846. },
  16847. owned: {
  16848. one: [ 'rowgroup', 'row' ]
  16849. },
  16850. nameFrom: [ 'author', 'contents' ],
  16851. context: null,
  16852. implicit: [ 'table' ],
  16853. unsupported: false
  16854. },
  16855. tablist: {
  16856. type: 'composite',
  16857. attributes: {
  16858. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-errormessage' ]
  16859. },
  16860. owned: {
  16861. all: [ 'tab' ]
  16862. },
  16863. nameFrom: [ 'author' ],
  16864. context: null,
  16865. unsupported: false,
  16866. allowedElements: [ 'ol', 'ul' ]
  16867. },
  16868. tabpanel: {
  16869. type: 'widget',
  16870. attributes: {
  16871. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16872. },
  16873. owned: null,
  16874. nameFrom: [ 'author' ],
  16875. context: null,
  16876. unsupported: false,
  16877. allowedElements: [ 'section' ]
  16878. },
  16879. term: {
  16880. type: 'structure',
  16881. attributes: {
  16882. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16883. },
  16884. owned: null,
  16885. nameFrom: [ 'author', 'contents' ],
  16886. context: null,
  16887. implicit: [ 'dt' ],
  16888. unsupported: false
  16889. },
  16890. textbox: {
  16891. type: 'widget',
  16892. attributes: {
  16893. allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ]
  16894. },
  16895. owned: null,
  16896. nameFrom: [ 'author' ],
  16897. context: null,
  16898. implicit: [ 'input[type="text"]', 'input[type="email"]', 'input[type="password"]', 'input[type="tel"]', 'input[type="url"]', 'input:not([type])', 'textarea' ],
  16899. unsupported: false
  16900. },
  16901. timer: {
  16902. type: 'widget',
  16903. attributes: {
  16904. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16905. },
  16906. owned: null,
  16907. nameFrom: [ 'author' ],
  16908. context: null,
  16909. unsupported: false
  16910. },
  16911. toolbar: {
  16912. type: 'structure',
  16913. attributes: {
  16914. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  16915. },
  16916. owned: null,
  16917. nameFrom: [ 'author' ],
  16918. context: null,
  16919. implicit: [ 'menu[type="toolbar"]' ],
  16920. unsupported: false,
  16921. allowedElements: [ 'ol', 'ul' ]
  16922. },
  16923. tooltip: {
  16924. type: 'structure',
  16925. attributes: {
  16926. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  16927. },
  16928. owned: null,
  16929. nameFrom: [ 'author', 'contents' ],
  16930. context: null,
  16931. unsupported: false
  16932. },
  16933. tree: {
  16934. type: 'composite',
  16935. attributes: {
  16936. allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  16937. },
  16938. owned: {
  16939. all: [ 'treeitem' ]
  16940. },
  16941. nameFrom: [ 'author' ],
  16942. context: null,
  16943. unsupported: false,
  16944. allowedElements: [ 'ol', 'ul' ]
  16945. },
  16946. treegrid: {
  16947. type: 'composite',
  16948. attributes: {
  16949. allowed: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-rowcount', 'aria-orientation', 'aria-errormessage' ]
  16950. },
  16951. owned: {
  16952. one: [ 'rowgroup', 'row' ]
  16953. },
  16954. nameFrom: [ 'author' ],
  16955. context: null,
  16956. unsupported: false
  16957. },
  16958. treeitem: {
  16959. type: 'widget',
  16960. attributes: {
  16961. allowed: [ 'aria-checked', 'aria-selected', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  16962. },
  16963. owned: null,
  16964. nameFrom: [ 'author', 'contents' ],
  16965. context: [ 'group', 'tree' ],
  16966. unsupported: false,
  16967. allowedElements: [ 'li', {
  16968. nodeName: 'a',
  16969. attributes: {
  16970. href: isNotNull
  16971. }
  16972. } ]
  16973. },
  16974. widget: {
  16975. type: 'abstract',
  16976. unsupported: false
  16977. },
  16978. window: {
  16979. nameFrom: [ 'author' ],
  16980. type: 'abstract',
  16981. unsupported: false
  16982. }
  16983. };
  16984. lookupTable.implicitHtmlRole = implicit_html_roles_default;
  16985. lookupTable.elementsAllowedNoRole = [ {
  16986. nodeName: [ 'base', 'body', 'caption', 'col', 'colgroup', 'datalist', 'dd', 'details', 'dt', 'head', 'html', 'keygen', 'label', 'legend', 'main', 'map', 'math', 'meta', 'meter', 'noscript', 'optgroup', 'param', 'picture', 'progress', 'script', 'source', 'style', 'template', 'textarea', 'title', 'track' ]
  16987. }, {
  16988. nodeName: 'area',
  16989. attributes: {
  16990. href: isNotNull
  16991. }
  16992. }, {
  16993. nodeName: 'input',
  16994. properties: {
  16995. type: [ 'color', 'data', 'datatime', 'file', 'hidden', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ]
  16996. }
  16997. }, {
  16998. nodeName: 'link',
  16999. attributes: {
  17000. href: isNotNull
  17001. }
  17002. }, {
  17003. nodeName: 'menu',
  17004. attributes: {
  17005. type: 'context'
  17006. }
  17007. }, {
  17008. nodeName: 'menuitem',
  17009. attributes: {
  17010. type: [ 'command', 'checkbox', 'radio' ]
  17011. }
  17012. }, {
  17013. nodeName: 'select',
  17014. condition: function condition(vNode) {
  17015. if (!(vNode instanceof axe.AbstractVirtualNode)) {
  17016. vNode = axe.utils.getNodeFromTree(vNode);
  17017. }
  17018. return Number(vNode.attr('size')) > 1;
  17019. },
  17020. properties: {
  17021. multiple: true
  17022. }
  17023. }, {
  17024. nodeName: [ 'clippath', 'cursor', 'defs', 'desc', 'feblend', 'fecolormatrix', 'fecomponenttransfer', 'fecomposite', 'feconvolvematrix', 'fediffuselighting', 'fedisplacementmap', 'fedistantlight', 'fedropshadow', 'feflood', 'fefunca', 'fefuncb', 'fefuncg', 'fefuncr', 'fegaussianblur', 'feimage', 'femerge', 'femergenode', 'femorphology', 'feoffset', 'fepointlight', 'fespecularlighting', 'fespotlight', 'fetile', 'feturbulence', 'filter', 'hatch', 'hatchpath', 'lineargradient', 'marker', 'mask', 'meshgradient', 'meshpatch', 'meshrow', 'metadata', 'mpath', 'pattern', 'radialgradient', 'solidcolor', 'stop', 'switch', 'view' ]
  17025. } ];
  17026. lookupTable.elementsAllowedAnyRole = [ {
  17027. nodeName: 'a',
  17028. attributes: {
  17029. href: isNull
  17030. }
  17031. }, {
  17032. nodeName: 'img',
  17033. attributes: {
  17034. alt: isNull
  17035. }
  17036. }, {
  17037. nodeName: [ 'abbr', 'address', 'canvas', 'div', 'p', 'pre', 'blockquote', 'ins', 'del', 'output', 'span', 'table', 'tbody', 'thead', 'tfoot', 'td', 'em', 'strong', 'small', 's', 'cite', 'q', 'dfn', 'abbr', 'time', 'code', 'var', 'samp', 'kbd', 'sub', 'sup', 'i', 'b', 'u', 'mark', 'ruby', 'rt', 'rp', 'bdi', 'bdo', 'br', 'wbr', 'th', 'tr' ]
  17038. } ];
  17039. lookupTable.evaluateRoleForElement = {
  17040. A: function A(_ref65) {
  17041. var node = _ref65.node, out = _ref65.out;
  17042. if (node.namespaceURI === 'http://www.w3.org/2000/svg') {
  17043. return true;
  17044. }
  17045. if (node.href.length) {
  17046. return out;
  17047. }
  17048. return true;
  17049. },
  17050. AREA: function AREA(_ref66) {
  17051. var node = _ref66.node;
  17052. return !node.href;
  17053. },
  17054. BUTTON: function BUTTON(_ref67) {
  17055. var node = _ref67.node, role = _ref67.role, out = _ref67.out;
  17056. if (node.getAttribute('type') === 'menu') {
  17057. return role === 'menuitem';
  17058. }
  17059. return out;
  17060. },
  17061. IMG: function IMG(_ref68) {
  17062. var node = _ref68.node, role = _ref68.role, out = _ref68.out;
  17063. switch (node.alt) {
  17064. case null:
  17065. return out;
  17066. case '':
  17067. return role === 'presentation' || role === 'none';
  17068. default:
  17069. return role !== 'presentation' && role !== 'none';
  17070. }
  17071. },
  17072. INPUT: function INPUT(_ref69) {
  17073. var node = _ref69.node, role = _ref69.role, out = _ref69.out;
  17074. switch (node.type) {
  17075. case 'button':
  17076. case 'image':
  17077. return out;
  17078. case 'checkbox':
  17079. if (role === 'button' && node.hasAttribute('aria-pressed')) {
  17080. return true;
  17081. }
  17082. return out;
  17083. case 'radio':
  17084. return role === 'menuitemradio';
  17085. case 'text':
  17086. return role === 'combobox' || role === 'searchbox' || role === 'spinbutton';
  17087. case 'tel':
  17088. return role === 'combobox' || role === 'spinbutton';
  17089. case 'url':
  17090. case 'search':
  17091. case 'email':
  17092. return role === 'combobox';
  17093. default:
  17094. return false;
  17095. }
  17096. },
  17097. LI: function LI(_ref70) {
  17098. var node = _ref70.node, out = _ref70.out;
  17099. var hasImplicitListitemRole = axe.utils.matchesSelector(node, 'ol li, ul li');
  17100. if (hasImplicitListitemRole) {
  17101. return out;
  17102. }
  17103. return true;
  17104. },
  17105. MENU: function MENU(_ref71) {
  17106. var node = _ref71.node;
  17107. if (node.getAttribute('type') === 'context') {
  17108. return false;
  17109. }
  17110. return true;
  17111. },
  17112. OPTION: function OPTION(_ref72) {
  17113. var node = _ref72.node;
  17114. var withinOptionList = axe.utils.matchesSelector(node, 'select > option, datalist > option, optgroup > option');
  17115. return !withinOptionList;
  17116. },
  17117. SELECT: function SELECT(_ref73) {
  17118. var node = _ref73.node, role = _ref73.role;
  17119. return !node.multiple && node.size <= 1 && role === 'menu';
  17120. },
  17121. SVG: function SVG(_ref74) {
  17122. var node = _ref74.node, out = _ref74.out;
  17123. if (node.parentNode && node.parentNode.namespaceURI === 'http://www.w3.org/2000/svg') {
  17124. return true;
  17125. }
  17126. return out;
  17127. }
  17128. };
  17129. lookupTable.rolesOfType = {
  17130. widget: [ 'button', 'checkbox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'scrollbar', 'searchbox', 'slider', 'spinbutton', 'status', 'switch', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'tree', 'treeitem' ]
  17131. };
  17132. var lookup_table_default = lookupTable;
  17133. function implicitNodes(role) {
  17134. var implicit = null;
  17135. var roles = lookup_table_default.role[role];
  17136. if (roles && roles.implicit) {
  17137. implicit = clone_default(roles.implicit);
  17138. }
  17139. return implicit;
  17140. }
  17141. var implicit_nodes_default = implicitNodes;
  17142. function isAccessibleRef(node) {
  17143. return !!get_accessible_refs_default(node).length;
  17144. }
  17145. var is_accessible_ref_default = isAccessibleRef;
  17146. function _isComboboxPopup(virtualNode) {
  17147. var _popupRoles;
  17148. var _ref75 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, popupRoles = _ref75.popupRoles;
  17149. var role = get_role_default(virtualNode);
  17150. (_popupRoles = popupRoles) !== null && _popupRoles !== void 0 ? _popupRoles : popupRoles = aria_attrs_default['aria-haspopup'].values;
  17151. if (!popupRoles.includes(role)) {
  17152. return false;
  17153. }
  17154. var vParent = nearestParentWithRole(virtualNode);
  17155. if (isCombobox(vParent)) {
  17156. return true;
  17157. }
  17158. var id = virtualNode.props.id;
  17159. if (!id) {
  17160. return false;
  17161. }
  17162. if (!virtualNode.actualNode) {
  17163. throw new Error('Unable to determine combobox popup without an actualNode');
  17164. }
  17165. var root = get_root_node_default(virtualNode.actualNode);
  17166. var ownedCombobox = root.querySelectorAll('[aria-owns~="'.concat(id, '"][role~="combobox"]:not(select),\n [aria-controls~="').concat(id, '"][role~="combobox"]:not(select)'));
  17167. return Array.from(ownedCombobox).some(isCombobox);
  17168. }
  17169. var isCombobox = function isCombobox(node) {
  17170. return node && get_role_default(node) === 'combobox';
  17171. };
  17172. function nearestParentWithRole(vNode) {
  17173. while (vNode = vNode.parent) {
  17174. if (get_role_default(vNode, {
  17175. noPresentational: true
  17176. }) !== null) {
  17177. return vNode;
  17178. }
  17179. }
  17180. return null;
  17181. }
  17182. function label2(node) {
  17183. node = get_node_from_tree_default(node);
  17184. return label_virtual_default(node);
  17185. }
  17186. var label_default2 = label2;
  17187. function requiredAttr(role) {
  17188. var roleDef = standards_default.ariaRoles[role];
  17189. if (!roleDef || !Array.isArray(roleDef.requiredAttrs)) {
  17190. return [];
  17191. }
  17192. return _toConsumableArray(roleDef.requiredAttrs);
  17193. }
  17194. var required_attr_default = requiredAttr;
  17195. function requiredContext(role) {
  17196. var roleDef = standards_default.ariaRoles[role];
  17197. if (!roleDef || !Array.isArray(roleDef.requiredContext)) {
  17198. return null;
  17199. }
  17200. return _toConsumableArray(roleDef.requiredContext);
  17201. }
  17202. var required_context_default = requiredContext;
  17203. function requiredOwned(role) {
  17204. var roleDef = standards_default.ariaRoles[role];
  17205. if (!roleDef || !Array.isArray(roleDef.requiredOwned)) {
  17206. return null;
  17207. }
  17208. return _toConsumableArray(roleDef.requiredOwned);
  17209. }
  17210. var required_owned_default = requiredOwned;
  17211. function validateAttrValue(vNode, attr) {
  17212. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  17213. var matches4;
  17214. var list;
  17215. var value = vNode.attr(attr);
  17216. var attrInfo = standards_default.ariaAttrs[attr];
  17217. if (!attrInfo) {
  17218. return true;
  17219. }
  17220. if (attrInfo.allowEmpty && (!value || value.trim() === '')) {
  17221. return true;
  17222. }
  17223. switch (attrInfo.type) {
  17224. case 'boolean':
  17225. return [ 'true', 'false' ].includes(value.toLowerCase());
  17226. case 'nmtoken':
  17227. return typeof value === 'string' && attrInfo.values.includes(value.toLowerCase());
  17228. case 'nmtokens':
  17229. list = token_list_default(value);
  17230. return list.reduce(function(result, token) {
  17231. return result && attrInfo.values.includes(token);
  17232. }, list.length !== 0);
  17233. case 'idref':
  17234. try {
  17235. var doc = get_root_node_default2(vNode.actualNode);
  17236. return !!(value && doc.getElementById(value));
  17237. } catch (e) {
  17238. throw new TypeError('Cannot resolve id references for partial DOM');
  17239. }
  17240. case 'idrefs':
  17241. return idrefs_default(vNode, attr).some(function(node) {
  17242. return !!node;
  17243. });
  17244. case 'string':
  17245. return value.trim() !== '';
  17246. case 'decimal':
  17247. matches4 = value.match(/^[-+]?([0-9]*)\.?([0-9]*)$/);
  17248. return !!(matches4 && (matches4[1] || matches4[2]));
  17249. case 'int':
  17250. var minValue = typeof attrInfo.minValue !== 'undefined' ? attrInfo.minValue : -Infinity;
  17251. return /^[-+]?[0-9]+$/.test(value) && parseInt(value) >= minValue;
  17252. }
  17253. }
  17254. var validate_attr_value_default = validateAttrValue;
  17255. function validateAttr(att) {
  17256. var attrDefinition = standards_default.ariaAttrs[att];
  17257. return !!attrDefinition;
  17258. }
  17259. var validate_attr_default = validateAttr;
  17260. function abstractroleEvaluate(node, options, virtualNode) {
  17261. var abstractRoles = token_list_default(virtualNode.attr('role')).filter(function(role) {
  17262. return get_role_type_default(role) === 'abstract';
  17263. });
  17264. if (abstractRoles.length > 0) {
  17265. this.data(abstractRoles);
  17266. return true;
  17267. }
  17268. return false;
  17269. }
  17270. var abstractrole_evaluate_default = abstractroleEvaluate;
  17271. function ariaAllowedAttrEvaluate(node, options, virtualNode) {
  17272. var invalid = [];
  17273. var role = get_role_default(virtualNode);
  17274. var attrs = virtualNode.attrNames;
  17275. var allowed = allowed_attr_default(role);
  17276. if (Array.isArray(options[role])) {
  17277. allowed = unique_array_default(options[role].concat(allowed));
  17278. }
  17279. var tableMap = cache_default.get('aria-allowed-attr-table', function() {
  17280. return new WeakMap();
  17281. });
  17282. function validateRowAttrs() {
  17283. if (virtualNode.parent && role === 'row') {
  17284. var table = closest_default(virtualNode, 'table, [role="treegrid"], [role="table"], [role="grid"]');
  17285. var tableRole = tableMap.get(table);
  17286. if (table && !tableRole) {
  17287. tableRole = get_role_default(table);
  17288. tableMap.set(table, tableRole);
  17289. }
  17290. if ([ 'table', 'grid' ].includes(tableRole) && role === 'row') {
  17291. return true;
  17292. }
  17293. }
  17294. }
  17295. var ariaAttr = Array.isArray(options.validTreeRowAttrs) ? options.validTreeRowAttrs : [];
  17296. var preChecks = {};
  17297. ariaAttr.forEach(function(attr) {
  17298. preChecks[attr] = validateRowAttrs;
  17299. });
  17300. if (allowed) {
  17301. for (var _i21 = 0; _i21 < attrs.length; _i21++) {
  17302. var _preChecks$attrName;
  17303. var attrName = attrs[_i21];
  17304. if (validate_attr_default(attrName) && (_preChecks$attrName = preChecks[attrName]) !== null && _preChecks$attrName !== void 0 && _preChecks$attrName.call(preChecks)) {
  17305. invalid.push(attrName + '="' + virtualNode.attr(attrName) + '"');
  17306. } else if (validate_attr_default(attrName) && !allowed.includes(attrName)) {
  17307. invalid.push(attrName + '="' + virtualNode.attr(attrName) + '"');
  17308. }
  17309. }
  17310. }
  17311. if (invalid.length) {
  17312. this.data(invalid);
  17313. if (!is_html_element_default(virtualNode) && !role && !_isFocusable(virtualNode)) {
  17314. return void 0;
  17315. }
  17316. return false;
  17317. }
  17318. return true;
  17319. }
  17320. function ariaAllowedRoleEvaluate(node) {
  17321. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17322. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  17323. var _options$allowImplici = options.allowImplicit, allowImplicit = _options$allowImplici === void 0 ? true : _options$allowImplici, _options$ignoredTags = options.ignoredTags, ignoredTags = _options$ignoredTags === void 0 ? [] : _options$ignoredTags;
  17324. var nodeName2 = virtualNode.props.nodeName;
  17325. if (ignoredTags.map(function(tag) {
  17326. return tag.toLowerCase();
  17327. }).includes(nodeName2)) {
  17328. return true;
  17329. }
  17330. var unallowedRoles = get_element_unallowed_roles_default(virtualNode, allowImplicit);
  17331. if (unallowedRoles.length) {
  17332. this.data(unallowedRoles);
  17333. if (!_isVisibleToScreenReaders(virtualNode)) {
  17334. return void 0;
  17335. }
  17336. return false;
  17337. }
  17338. return true;
  17339. }
  17340. var aria_allowed_role_evaluate_default = ariaAllowedRoleEvaluate;
  17341. function ariaBusyEvaluate(node, options, virtualNode) {
  17342. return virtualNode.attr('aria-busy') === 'true';
  17343. }
  17344. function ariaErrormessageEvaluate(node, options, virtualNode) {
  17345. options = Array.isArray(options) ? options : [];
  17346. var attr = virtualNode.attr('aria-errormessage');
  17347. var hasAttr = virtualNode.hasAttr('aria-errormessage');
  17348. var invaid = virtualNode.attr('aria-invalid');
  17349. var hasInvallid = virtualNode.hasAttr('aria-invalid');
  17350. if (!hasInvallid || invaid === 'false') {
  17351. return true;
  17352. }
  17353. function validateAttrValue2(attr2) {
  17354. if (attr2.trim() === '') {
  17355. return standards_default.ariaAttrs['aria-errormessage'].allowEmpty;
  17356. }
  17357. var idref;
  17358. try {
  17359. idref = attr2 && idrefs_default(virtualNode, 'aria-errormessage')[0];
  17360. } catch (e) {
  17361. this.data({
  17362. messageKey: 'idrefs',
  17363. values: token_list_default(attr2)
  17364. });
  17365. return void 0;
  17366. }
  17367. if (idref) {
  17368. if (!_isVisibleToScreenReaders(idref)) {
  17369. this.data({
  17370. messageKey: 'hidden',
  17371. values: token_list_default(attr2)
  17372. });
  17373. return false;
  17374. }
  17375. return idref.getAttribute('role') === 'alert' || idref.getAttribute('aria-live') === 'assertive' || idref.getAttribute('aria-live') === 'polite' || token_list_default(virtualNode.attr('aria-describedby')).indexOf(attr2) > -1;
  17376. }
  17377. return;
  17378. }
  17379. if (options.indexOf(attr) === -1 && hasAttr) {
  17380. this.data(token_list_default(attr));
  17381. return validateAttrValue2.call(this, attr);
  17382. }
  17383. return true;
  17384. }
  17385. var aria_errormessage_evaluate_default = ariaErrormessageEvaluate;
  17386. function ariaHiddenBodyEvaluate(node, options, virtualNode) {
  17387. return virtualNode.attr('aria-hidden') !== 'true';
  17388. }
  17389. var aria_hidden_body_evaluate_default = ariaHiddenBodyEvaluate;
  17390. function ariaLevelEvaluate(node, options, virtualNode) {
  17391. var ariaHeadingLevel = virtualNode.attr('aria-level');
  17392. var ariaLevel = parseInt(ariaHeadingLevel, 10);
  17393. if (ariaLevel > 6) {
  17394. return void 0;
  17395. }
  17396. return true;
  17397. }
  17398. var aria_level_evaluate_default = ariaLevelEvaluate;
  17399. function ariaProhibitedAttrEvaluate(node) {
  17400. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17401. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  17402. var elementsAllowedAriaLabel = (options === null || options === void 0 ? void 0 : options.elementsAllowedAriaLabel) || [];
  17403. var nodeName2 = virtualNode.props.nodeName;
  17404. var role = get_role_default(virtualNode, {
  17405. chromium: true
  17406. });
  17407. var prohibitedList = listProhibitedAttrs(role, nodeName2, elementsAllowedAriaLabel);
  17408. var prohibited = prohibitedList.filter(function(attrName) {
  17409. if (!virtualNode.attrNames.includes(attrName)) {
  17410. return false;
  17411. }
  17412. return sanitize_default(virtualNode.attr(attrName)) !== '';
  17413. });
  17414. if (prohibited.length === 0) {
  17415. return false;
  17416. }
  17417. var messageKey = virtualNode.hasAttr('role') ? 'hasRole' : 'noRole';
  17418. messageKey += prohibited.length > 1 ? 'Plural' : 'Singular';
  17419. this.data({
  17420. role: role,
  17421. nodeName: nodeName2,
  17422. messageKey: messageKey,
  17423. prohibited: prohibited
  17424. });
  17425. var textContent = subtree_text_default(virtualNode, {
  17426. subtreeDescendant: true
  17427. });
  17428. if (sanitize_default(textContent) !== '') {
  17429. return void 0;
  17430. }
  17431. return true;
  17432. }
  17433. function listProhibitedAttrs(role, nodeName2, elementsAllowedAriaLabel) {
  17434. var roleSpec = standards_default.ariaRoles[role];
  17435. if (roleSpec) {
  17436. return roleSpec.prohibitedAttrs || [];
  17437. }
  17438. if (!!role || elementsAllowedAriaLabel.includes(nodeName2)) {
  17439. return [];
  17440. }
  17441. return [ 'aria-label', 'aria-labelledby' ];
  17442. }
  17443. var standards_exports = {};
  17444. __export(standards_exports, {
  17445. getAriaRolesByType: function getAriaRolesByType() {
  17446. return get_aria_roles_by_type_default;
  17447. },
  17448. getAriaRolesSupportingNameFromContent: function getAriaRolesSupportingNameFromContent() {
  17449. return get_aria_roles_supporting_name_from_content_default;
  17450. },
  17451. getElementSpec: function getElementSpec() {
  17452. return get_element_spec_default;
  17453. },
  17454. getElementsByContentType: function getElementsByContentType() {
  17455. return get_elements_by_content_type_default;
  17456. },
  17457. getGlobalAriaAttrs: function getGlobalAriaAttrs() {
  17458. return get_global_aria_attrs_default;
  17459. },
  17460. implicitHtmlRoles: function implicitHtmlRoles() {
  17461. return implicit_html_roles_default;
  17462. }
  17463. });
  17464. function ariaRequiredAttrEvaluate(node) {
  17465. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17466. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  17467. var role = get_explicit_role_default(virtualNode);
  17468. var attrs = virtualNode.attrNames;
  17469. var requiredAttrs = required_attr_default(role);
  17470. if (Array.isArray(options[role])) {
  17471. requiredAttrs = unique_array_default(options[role], requiredAttrs);
  17472. }
  17473. if (!role || !attrs.length || !requiredAttrs.length) {
  17474. return true;
  17475. }
  17476. if (isStaticSeparator(virtualNode, role) || isClosedCombobox(virtualNode, role)) {
  17477. return true;
  17478. }
  17479. var elmSpec = get_element_spec_default(virtualNode);
  17480. var missingAttrs = requiredAttrs.filter(function(requiredAttr2) {
  17481. return !virtualNode.attr(requiredAttr2) && !hasImplicitAttr(elmSpec, requiredAttr2);
  17482. });
  17483. if (missingAttrs.length) {
  17484. this.data(missingAttrs);
  17485. return false;
  17486. }
  17487. return true;
  17488. }
  17489. function isStaticSeparator(vNode, role) {
  17490. return role === 'separator' && !_isFocusable(vNode);
  17491. }
  17492. function hasImplicitAttr(elmSpec, attr) {
  17493. var _elmSpec$implicitAttr;
  17494. return ((_elmSpec$implicitAttr = elmSpec.implicitAttrs) === null || _elmSpec$implicitAttr === void 0 ? void 0 : _elmSpec$implicitAttr[attr]) !== void 0;
  17495. }
  17496. function isClosedCombobox(vNode, role) {
  17497. return role === 'combobox' && vNode.attr('aria-expanded') === 'false';
  17498. }
  17499. function ariaRequiredChildrenEvaluate(node, options, virtualNode) {
  17500. var reviewEmpty = options && Array.isArray(options.reviewEmpty) ? options.reviewEmpty : [];
  17501. var role = get_explicit_role_default(virtualNode, {
  17502. dpub: true
  17503. });
  17504. var required = required_owned_default(role);
  17505. if (required === null) {
  17506. return true;
  17507. }
  17508. var ownedRoles = getOwnedRoles(virtualNode, required);
  17509. var unallowed = ownedRoles.filter(function(_ref76) {
  17510. var role2 = _ref76.role;
  17511. return !required.includes(role2);
  17512. });
  17513. if (unallowed.length) {
  17514. this.relatedNodes(unallowed.map(function(_ref77) {
  17515. var ownedElement = _ref77.ownedElement;
  17516. return ownedElement;
  17517. }));
  17518. this.data({
  17519. messageKey: 'unallowed',
  17520. values: unallowed.map(function(_ref78) {
  17521. var ownedElement = _ref78.ownedElement, attr = _ref78.attr;
  17522. return getUnallowedSelector(ownedElement, attr);
  17523. }).filter(function(selector, index, array) {
  17524. return array.indexOf(selector) === index;
  17525. }).join(', ')
  17526. });
  17527. return false;
  17528. }
  17529. var missing = missingRequiredChildren(virtualNode, role, required, ownedRoles);
  17530. if (!missing) {
  17531. return true;
  17532. }
  17533. this.data(missing);
  17534. if (reviewEmpty.includes(role) && !has_content_virtual_default(virtualNode, false, true) && !ownedRoles.length && (!virtualNode.hasAttr('aria-owns') || !idrefs_default(node, 'aria-owns').length)) {
  17535. return void 0;
  17536. }
  17537. return false;
  17538. }
  17539. function getOwnedRoles(virtualNode, required) {
  17540. var ownedRoles = [];
  17541. var ownedElements = get_owned_virtual_default(virtualNode);
  17542. var _loop5 = function _loop5(_i22) {
  17543. var ownedElement = ownedElements[_i22];
  17544. if (ownedElement.props.nodeType !== 1) {
  17545. return 'continue';
  17546. }
  17547. var role = get_role_default(ownedElement, {
  17548. noPresentational: true
  17549. });
  17550. var globalAriaAttr = getGlobalAriaAttr(ownedElement);
  17551. var hasGlobalAriaOrFocusable = !!globalAriaAttr || _isFocusable(ownedElement);
  17552. if (!_isVisibleToScreenReaders(ownedElement) || !role && !hasGlobalAriaOrFocusable || [ 'group', 'rowgroup' ].includes(role) && required.some(function(requiredRole) {
  17553. return requiredRole === role;
  17554. })) {
  17555. ownedElements.push.apply(ownedElements, _toConsumableArray(ownedElement.children));
  17556. } else if (role || hasGlobalAriaOrFocusable) {
  17557. ownedRoles.push({
  17558. role: role,
  17559. attr: globalAriaAttr || 'tabindex',
  17560. ownedElement: ownedElement
  17561. });
  17562. }
  17563. };
  17564. for (var _i22 = 0; _i22 < ownedElements.length; _i22++) {
  17565. var _ret2 = _loop5(_i22);
  17566. if (_ret2 === 'continue') {
  17567. continue;
  17568. }
  17569. }
  17570. return ownedRoles;
  17571. }
  17572. function missingRequiredChildren(virtualNode, role, required, ownedRoles) {
  17573. var _loop6 = function _loop6(_i23) {
  17574. var role2 = ownedRoles[_i23].role;
  17575. if (required.includes(role2)) {
  17576. required = required.filter(function(requiredRole) {
  17577. return requiredRole !== role2;
  17578. });
  17579. return {
  17580. v: null
  17581. };
  17582. }
  17583. };
  17584. for (var _i23 = 0; _i23 < ownedRoles.length; _i23++) {
  17585. var _ret3 = _loop6(_i23);
  17586. if (_typeof(_ret3) === 'object') {
  17587. return _ret3.v;
  17588. }
  17589. }
  17590. if (required.length) {
  17591. return required;
  17592. }
  17593. return null;
  17594. }
  17595. function getGlobalAriaAttr(vNode) {
  17596. return get_global_aria_attrs_default().find(function(attr) {
  17597. return vNode.hasAttr(attr);
  17598. });
  17599. }
  17600. function getUnallowedSelector(vNode, attr) {
  17601. var _vNode$props = vNode.props, nodeName2 = _vNode$props.nodeName, nodeType = _vNode$props.nodeType;
  17602. if (nodeType === 3) {
  17603. return '#text';
  17604. }
  17605. var role = get_explicit_role_default(vNode, {
  17606. dpub: true
  17607. });
  17608. if (role) {
  17609. return '[role='.concat(role, ']');
  17610. }
  17611. if (attr) {
  17612. return nodeName2 + '['.concat(attr, ']');
  17613. }
  17614. return nodeName2;
  17615. }
  17616. function getMissingContext(virtualNode, ownGroupRoles, reqContext, includeElement) {
  17617. var explicitRole2 = get_explicit_role_default(virtualNode);
  17618. if (!reqContext) {
  17619. reqContext = required_context_default(explicitRole2);
  17620. }
  17621. if (!reqContext) {
  17622. return null;
  17623. }
  17624. var allowsGroup = reqContext.includes('group');
  17625. var vNode = includeElement ? virtualNode : virtualNode.parent;
  17626. while (vNode) {
  17627. var role = get_role_default(vNode, {
  17628. noPresentational: true
  17629. });
  17630. if (!role) {
  17631. vNode = vNode.parent;
  17632. } else if (role === 'group' && allowsGroup) {
  17633. if (ownGroupRoles.includes(explicitRole2)) {
  17634. reqContext.push(explicitRole2);
  17635. }
  17636. reqContext = reqContext.filter(function(r) {
  17637. return r !== 'group';
  17638. });
  17639. vNode = vNode.parent;
  17640. } else if (reqContext.includes(role)) {
  17641. return null;
  17642. } else {
  17643. return reqContext;
  17644. }
  17645. }
  17646. return reqContext;
  17647. }
  17648. function getAriaOwners(element) {
  17649. var owners = [], o = null;
  17650. while (element) {
  17651. if (element.getAttribute('id')) {
  17652. var id = escape_selector_default(element.getAttribute('id'));
  17653. var doc = get_root_node_default2(element);
  17654. o = doc.querySelector('[aria-owns~='.concat(id, ']'));
  17655. if (o) {
  17656. owners.push(o);
  17657. }
  17658. }
  17659. element = element.parentElement;
  17660. }
  17661. return owners.length ? owners : null;
  17662. }
  17663. function ariaRequiredParentEvaluate(node, options, virtualNode) {
  17664. var ownGroupRoles = options && Array.isArray(options.ownGroupRoles) ? options.ownGroupRoles : [];
  17665. var missingParents = getMissingContext(virtualNode, ownGroupRoles);
  17666. if (!missingParents) {
  17667. return true;
  17668. }
  17669. var owners = getAriaOwners(node);
  17670. if (owners) {
  17671. for (var _i24 = 0, l = owners.length; _i24 < l; _i24++) {
  17672. missingParents = getMissingContext(get_node_from_tree_default(owners[_i24]), ownGroupRoles, missingParents, true);
  17673. if (!missingParents) {
  17674. return true;
  17675. }
  17676. }
  17677. }
  17678. this.data(missingParents);
  17679. return false;
  17680. }
  17681. var aria_required_parent_evaluate_default = ariaRequiredParentEvaluate;
  17682. function ariaRoledescriptionEvaluate(node) {
  17683. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17684. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  17685. var role = get_role_default(virtualNode);
  17686. var supportedRoles = options.supportedRoles || [];
  17687. if (supportedRoles.includes(role)) {
  17688. return true;
  17689. }
  17690. if (role && role !== 'presentation' && role !== 'none') {
  17691. return void 0;
  17692. }
  17693. return false;
  17694. }
  17695. var aria_roledescription_evaluate_default = ariaRoledescriptionEvaluate;
  17696. function ariaUnsupportedAttrEvaluate(node, options, virtualNode) {
  17697. var unsupportedAttrs = virtualNode.attrNames.filter(function(name) {
  17698. var attribute = standards_default.ariaAttrs[name];
  17699. if (!validate_attr_default(name)) {
  17700. return false;
  17701. }
  17702. var unsupported2 = attribute.unsupported;
  17703. if (_typeof(unsupported2) !== 'object') {
  17704. return !!unsupported2;
  17705. }
  17706. return !matches_default3(node, unsupported2.exceptions);
  17707. });
  17708. if (unsupportedAttrs.length) {
  17709. this.data(unsupportedAttrs);
  17710. return true;
  17711. }
  17712. return false;
  17713. }
  17714. var aria_unsupported_attr_evaluate_default = ariaUnsupportedAttrEvaluate;
  17715. function ariaValidAttrEvaluate(node, options, virtualNode) {
  17716. options = Array.isArray(options.value) ? options.value : [];
  17717. var invalid = [];
  17718. var aria = /^aria-/;
  17719. virtualNode.attrNames.forEach(function(attr) {
  17720. if (options.indexOf(attr) === -1 && aria.test(attr) && !validate_attr_default(attr)) {
  17721. invalid.push(attr);
  17722. }
  17723. });
  17724. if (invalid.length) {
  17725. this.data(invalid);
  17726. return false;
  17727. }
  17728. return true;
  17729. }
  17730. var aria_valid_attr_evaluate_default = ariaValidAttrEvaluate;
  17731. function ariaValidAttrValueEvaluate(node, options, virtualNode) {
  17732. options = Array.isArray(options.value) ? options.value : [];
  17733. var needsReview = '';
  17734. var messageKey = '';
  17735. var invalid = [];
  17736. var aria = /^aria-/;
  17737. var skipAttrs = [ 'aria-errormessage' ];
  17738. var preChecks = {
  17739. 'aria-controls': function ariaControls() {
  17740. return virtualNode.attr('aria-expanded') !== 'false' && virtualNode.attr('aria-selected') !== 'false';
  17741. },
  17742. 'aria-current': function ariaCurrent(validValue) {
  17743. if (!validValue) {
  17744. needsReview = 'aria-current="'.concat(virtualNode.attr('aria-current'), '"');
  17745. messageKey = 'ariaCurrent';
  17746. }
  17747. return;
  17748. },
  17749. 'aria-owns': function ariaOwns() {
  17750. return virtualNode.attr('aria-expanded') !== 'false';
  17751. },
  17752. 'aria-describedby': function ariaDescribedby(validValue) {
  17753. if (!validValue) {
  17754. needsReview = 'aria-describedby="'.concat(virtualNode.attr('aria-describedby'), '"');
  17755. messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId';
  17756. }
  17757. return;
  17758. },
  17759. 'aria-labelledby': function ariaLabelledby(validValue) {
  17760. if (!validValue) {
  17761. needsReview = 'aria-labelledby="'.concat(virtualNode.attr('aria-labelledby'), '"');
  17762. messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId';
  17763. }
  17764. }
  17765. };
  17766. virtualNode.attrNames.forEach(function(attrName) {
  17767. if (skipAttrs.includes(attrName) || options.includes(attrName) || !aria.test(attrName)) {
  17768. return;
  17769. }
  17770. var validValue;
  17771. var attrValue = virtualNode.attr(attrName);
  17772. try {
  17773. validValue = validate_attr_value_default(virtualNode, attrName);
  17774. } catch (e) {
  17775. needsReview = ''.concat(attrName, '="').concat(attrValue, '"');
  17776. messageKey = 'idrefs';
  17777. return;
  17778. }
  17779. if ((preChecks[attrName] ? preChecks[attrName](validValue) : true) && !validValue) {
  17780. if (attrValue === '' && !isStringType(attrName)) {
  17781. needsReview = attrName;
  17782. messageKey = 'empty';
  17783. } else {
  17784. invalid.push(''.concat(attrName, '="').concat(attrValue, '"'));
  17785. }
  17786. }
  17787. });
  17788. if (invalid.length) {
  17789. this.data(invalid);
  17790. return false;
  17791. }
  17792. if (needsReview) {
  17793. this.data({
  17794. messageKey: messageKey,
  17795. needsReview: needsReview
  17796. });
  17797. return void 0;
  17798. }
  17799. return true;
  17800. }
  17801. function isStringType(attrName) {
  17802. var _standards_default$ar;
  17803. return ((_standards_default$ar = standards_default.ariaAttrs[attrName]) === null || _standards_default$ar === void 0 ? void 0 : _standards_default$ar.type) === 'string';
  17804. }
  17805. function deprecatedroleEvaluate(node, options, virtualNode) {
  17806. var role = get_role_default(virtualNode, {
  17807. dpub: true,
  17808. fallback: true
  17809. });
  17810. var roleDefinition = standards_default.ariaRoles[role];
  17811. if (!(roleDefinition !== null && roleDefinition !== void 0 && roleDefinition.deprecated)) {
  17812. return false;
  17813. }
  17814. this.data(role);
  17815. return true;
  17816. }
  17817. function nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) {
  17818. var hasImplicitRole = implicit_role_default(virtualNode);
  17819. return !hasImplicitRole && explicitRoles.length === 2 && explicitRoles.includes('none') && explicitRoles.includes('presentation');
  17820. }
  17821. function fallbackroleEvaluate(node, options, virtualNode) {
  17822. var explicitRoles = token_list_default(virtualNode.attr('role'));
  17823. if (explicitRoles.length <= 1) {
  17824. return false;
  17825. }
  17826. return nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) ? void 0 : true;
  17827. }
  17828. var fallbackrole_evaluate_default = fallbackroleEvaluate;
  17829. function hasGlobalAriaAttributeEvaluate(node, options, virtualNode) {
  17830. var globalAttrs = get_global_aria_attrs_default().filter(function(attr) {
  17831. return virtualNode.hasAttr(attr);
  17832. });
  17833. this.data(globalAttrs);
  17834. return globalAttrs.length > 0;
  17835. }
  17836. var has_global_aria_attribute_evaluate_default = hasGlobalAriaAttributeEvaluate;
  17837. function hasWidgetRoleEvaluate(node) {
  17838. var role = node.getAttribute('role');
  17839. if (role === null) {
  17840. return false;
  17841. }
  17842. var roleType = get_role_type_default(role);
  17843. return roleType === 'widget' || roleType === 'composite';
  17844. }
  17845. var has_widget_role_evaluate_default = hasWidgetRoleEvaluate;
  17846. function invalidroleEvaluate(node, options, virtualNode) {
  17847. var allRoles = token_list_default(virtualNode.attr('role'));
  17848. var allInvalid = allRoles.every(function(role) {
  17849. return !is_valid_role_default(role, {
  17850. allowAbstract: true
  17851. });
  17852. });
  17853. if (allInvalid) {
  17854. this.data(allRoles);
  17855. return true;
  17856. }
  17857. return false;
  17858. }
  17859. var invalidrole_evaluate_default = invalidroleEvaluate;
  17860. function isElementFocusableEvaluate(node, options, virtualNode) {
  17861. return _isFocusable(virtualNode);
  17862. }
  17863. var is_element_focusable_evaluate_default = isElementFocusableEvaluate;
  17864. function noImplicitExplicitLabelEvaluate(node, options, virtualNode) {
  17865. var role = get_role_default(virtualNode, {
  17866. noImplicit: true
  17867. });
  17868. this.data(role);
  17869. var label3;
  17870. var accText;
  17871. try {
  17872. label3 = sanitize_default(label_text_default(virtualNode)).toLowerCase();
  17873. accText = sanitize_default(accessible_text_virtual_default(virtualNode)).toLowerCase();
  17874. } catch (e) {
  17875. return void 0;
  17876. }
  17877. if (!accText && !label3) {
  17878. return false;
  17879. }
  17880. if (!accText && label3) {
  17881. return void 0;
  17882. }
  17883. if (!accText.includes(label3)) {
  17884. return void 0;
  17885. }
  17886. return false;
  17887. }
  17888. var no_implicit_explicit_label_evaluate_default = noImplicitExplicitLabelEvaluate;
  17889. function unsupportedroleEvaluate(node, options, virtualNode) {
  17890. var role = get_role_default(virtualNode, {
  17891. dpub: true,
  17892. fallback: true
  17893. });
  17894. var isUnsupported = is_unsupported_role_default(role);
  17895. if (isUnsupported) {
  17896. this.data(role);
  17897. }
  17898. return isUnsupported;
  17899. }
  17900. var unsupportedrole_evaluate_default = unsupportedroleEvaluate;
  17901. var VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS = {
  17902. ARTICLE: true,
  17903. ASIDE: true,
  17904. NAV: true,
  17905. SECTION: true
  17906. };
  17907. var VALID_ROLES_FOR_SCROLLABLE_REGIONS = {
  17908. application: true,
  17909. article: true,
  17910. banner: false,
  17911. complementary: true,
  17912. contentinfo: true,
  17913. form: true,
  17914. main: true,
  17915. navigation: true,
  17916. region: true,
  17917. search: false
  17918. };
  17919. function validScrollableTagName(node) {
  17920. var nodeName2 = node.nodeName.toUpperCase();
  17921. return VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS[nodeName2] || false;
  17922. }
  17923. function validScrollableRole(node, options) {
  17924. var role = get_explicit_role_default(node);
  17925. if (!role) {
  17926. return false;
  17927. }
  17928. return VALID_ROLES_FOR_SCROLLABLE_REGIONS[role] || options.roles.includes(role) || false;
  17929. }
  17930. function validScrollableSemanticsEvaluate(node, options) {
  17931. return validScrollableRole(node, options) || validScrollableTagName(node);
  17932. }
  17933. var valid_scrollable_semantics_evaluate_default = validScrollableSemanticsEvaluate;
  17934. var color_exports = {};
  17935. __export(color_exports, {
  17936. Color: function Color() {
  17937. return color_default;
  17938. },
  17939. centerPointOfRect: function centerPointOfRect() {
  17940. return center_point_of_rect_default;
  17941. },
  17942. elementHasImage: function elementHasImage() {
  17943. return element_has_image_default;
  17944. },
  17945. elementIsDistinct: function elementIsDistinct() {
  17946. return element_is_distinct_default;
  17947. },
  17948. filteredRectStack: function filteredRectStack() {
  17949. return filtered_rect_stack_default;
  17950. },
  17951. flattenColors: function flattenColors() {
  17952. return flatten_colors_default;
  17953. },
  17954. flattenShadowColors: function flattenShadowColors() {
  17955. return _flattenShadowColors;
  17956. },
  17957. getBackgroundColor: function getBackgroundColor() {
  17958. return _getBackgroundColor2;
  17959. },
  17960. getBackgroundStack: function getBackgroundStack() {
  17961. return _getBackgroundStack;
  17962. },
  17963. getContrast: function getContrast() {
  17964. return get_contrast_default;
  17965. },
  17966. getForegroundColor: function getForegroundColor() {
  17967. return _getForegroundColor;
  17968. },
  17969. getOwnBackgroundColor: function getOwnBackgroundColor() {
  17970. return get_own_background_color_default;
  17971. },
  17972. getRectStack: function getRectStack() {
  17973. return get_rect_stack_default;
  17974. },
  17975. getStackingContext: function getStackingContext() {
  17976. return _getStackingContext;
  17977. },
  17978. getTextShadowColors: function getTextShadowColors() {
  17979. return get_text_shadow_colors_default;
  17980. },
  17981. hasValidContrastRatio: function hasValidContrastRatio() {
  17982. return has_valid_contrast_ratio_default;
  17983. },
  17984. incompleteData: function incompleteData() {
  17985. return incomplete_data_default;
  17986. },
  17987. stackingContextToColor: function stackingContextToColor() {
  17988. return _stackingContextToColor;
  17989. }
  17990. });
  17991. function centerPointOfRect(rect) {
  17992. if (rect.left > window.innerWidth) {
  17993. return void 0;
  17994. }
  17995. if (rect.top > window.innerHeight) {
  17996. return void 0;
  17997. }
  17998. var x = Math.min(Math.ceil(rect.left + rect.width / 2), window.innerWidth - 1);
  17999. var y = Math.min(Math.ceil(rect.top + rect.height / 2), window.innerHeight - 1);
  18000. return {
  18001. x: x,
  18002. y: y
  18003. };
  18004. }
  18005. var center_point_of_rect_default = centerPointOfRect;
  18006. function _getFonts(style) {
  18007. return style.getPropertyValue('font-family').split(/[,;]/g).map(function(font) {
  18008. return font.trim().toLowerCase();
  18009. });
  18010. }
  18011. function elementIsDistinct(node, ancestorNode) {
  18012. var nodeStyle = window.getComputedStyle(node);
  18013. if (nodeStyle.getPropertyValue('background-image') !== 'none') {
  18014. return true;
  18015. }
  18016. var hasBorder = [ 'border-bottom', 'border-top', 'outline' ].reduce(function(result, edge) {
  18017. var borderClr = new color_default();
  18018. borderClr.parseString(nodeStyle.getPropertyValue(edge + '-color'));
  18019. return result || nodeStyle.getPropertyValue(edge + '-style') !== 'none' && parseFloat(nodeStyle.getPropertyValue(edge + '-width')) > 0 && borderClr.alpha !== 0;
  18020. }, false);
  18021. if (hasBorder) {
  18022. return true;
  18023. }
  18024. var parentStyle = window.getComputedStyle(ancestorNode);
  18025. if (_getFonts(nodeStyle)[0] !== _getFonts(parentStyle)[0]) {
  18026. return true;
  18027. }
  18028. var hasStyle = [ 'text-decoration-line', 'text-decoration-style', 'font-weight', 'font-style', 'font-size' ].reduce(function(result, cssProp) {
  18029. return result || nodeStyle.getPropertyValue(cssProp) !== parentStyle.getPropertyValue(cssProp);
  18030. }, false);
  18031. var tDec = nodeStyle.getPropertyValue('text-decoration');
  18032. if (tDec.split(' ').length < 3) {
  18033. hasStyle = hasStyle || tDec !== parentStyle.getPropertyValue('text-decoration');
  18034. }
  18035. return hasStyle;
  18036. }
  18037. var element_is_distinct_default = elementIsDistinct;
  18038. function getRectStack2(elm) {
  18039. var boundingStack = get_element_stack_default(elm);
  18040. var filteredArr = get_text_element_stack_default(elm);
  18041. if (!filteredArr || filteredArr.length <= 1) {
  18042. return [ boundingStack ];
  18043. }
  18044. if (filteredArr.some(function(stack) {
  18045. return stack === void 0;
  18046. })) {
  18047. return null;
  18048. }
  18049. filteredArr.splice(0, 0, boundingStack);
  18050. return filteredArr;
  18051. }
  18052. var get_rect_stack_default = getRectStack2;
  18053. function filteredRectStack(elm) {
  18054. var rectStack = get_rect_stack_default(elm);
  18055. if (rectStack && rectStack.length === 1) {
  18056. return rectStack[0];
  18057. }
  18058. if (rectStack && rectStack.length > 1) {
  18059. var boundingStack = rectStack.shift();
  18060. var isSame;
  18061. rectStack.forEach(function(rectList, index) {
  18062. if (index === 0) {
  18063. return;
  18064. }
  18065. var rectA = rectStack[index - 1], rectB = rectStack[index];
  18066. isSame = rectA.every(function(element, elementIndex) {
  18067. return element === rectB[elementIndex];
  18068. }) || boundingStack.includes(elm);
  18069. });
  18070. if (!isSame) {
  18071. incomplete_data_default.set('bgColor', 'elmPartiallyObscuring');
  18072. return null;
  18073. }
  18074. return rectStack[0];
  18075. }
  18076. incomplete_data_default.set('bgColor', 'outsideViewport');
  18077. return null;
  18078. }
  18079. var filtered_rect_stack_default = filteredRectStack;
  18080. function clamp(value, min, max) {
  18081. return Math.min(Math.max(min, value), max);
  18082. }
  18083. var blendFunctions = {
  18084. normal: function normal(Cb, Cs) {
  18085. return Cs;
  18086. },
  18087. multiply: function multiply(Cb, Cs) {
  18088. return Cs * Cb;
  18089. },
  18090. screen: function screen(Cb, Cs) {
  18091. return Cb + Cs - Cb * Cs;
  18092. },
  18093. overlay: function overlay(Cb, Cs) {
  18094. return this['hard-light'](Cs, Cb);
  18095. },
  18096. darken: function darken(Cb, Cs) {
  18097. return Math.min(Cb, Cs);
  18098. },
  18099. lighten: function lighten(Cb, Cs) {
  18100. return Math.max(Cb, Cs);
  18101. },
  18102. 'color-dodge': function colorDodge(Cb, Cs) {
  18103. return Cb === 0 ? 0 : Cs === 1 ? 1 : Math.min(1, Cb / (1 - Cs));
  18104. },
  18105. 'color-burn': function colorBurn(Cb, Cs) {
  18106. return Cb === 1 ? 1 : Cs === 0 ? 0 : 1 - Math.min(1, (1 - Cb) / Cs);
  18107. },
  18108. 'hard-light': function hardLight(Cb, Cs) {
  18109. return Cs <= .5 ? this.multiply(Cb, 2 * Cs) : this.screen(Cb, 2 * Cs - 1);
  18110. },
  18111. 'soft-light': function softLight(Cb, Cs) {
  18112. if (Cs <= .5) {
  18113. return Cb - (1 - 2 * Cs) * Cb * (1 - Cb);
  18114. } else {
  18115. var D = Cb <= .25 ? ((16 * Cb - 12) * Cb + 4) * Cb : Math.sqrt(Cb);
  18116. return Cb + (2 * Cs - 1) * (D - Cb);
  18117. }
  18118. },
  18119. difference: function difference(Cb, Cs) {
  18120. return Math.abs(Cb - Cs);
  18121. },
  18122. exclusion: function exclusion(Cb, Cs) {
  18123. return Cb + Cs - 2 * Cb * Cs;
  18124. }
  18125. };
  18126. function simpleAlphaCompositing(Cs, \u03b1s, Cb, \u03b1b, blendMode) {
  18127. return \u03b1s * (1 - \u03b1b) * Cs + \u03b1s * \u03b1b * blendFunctions[blendMode](Cb / 255, Cs / 255) * 255 + (1 - \u03b1s) * \u03b1b * Cb;
  18128. }
  18129. function flattenColors(sourceColor, backdrop) {
  18130. var blendMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'normal';
  18131. var r = simpleAlphaCompositing(sourceColor.red, sourceColor.alpha, backdrop.red, backdrop.alpha, blendMode);
  18132. var g = simpleAlphaCompositing(sourceColor.green, sourceColor.alpha, backdrop.green, backdrop.alpha, blendMode);
  18133. var b = simpleAlphaCompositing(sourceColor.blue, sourceColor.alpha, backdrop.blue, backdrop.alpha, blendMode);
  18134. var \u03b1o = clamp(sourceColor.alpha + backdrop.alpha * (1 - sourceColor.alpha), 0, 1);
  18135. if (\u03b1o === 0) {
  18136. return new color_default(r, g, b, \u03b1o);
  18137. }
  18138. var Cr = Math.round(r / \u03b1o);
  18139. var Cg = Math.round(g / \u03b1o);
  18140. var Cb = Math.round(b / \u03b1o);
  18141. return new color_default(Cr, Cg, Cb, \u03b1o);
  18142. }
  18143. var flatten_colors_default = flattenColors;
  18144. function _flattenShadowColors(fgColor, bgColor) {
  18145. var alpha = fgColor.alpha;
  18146. var r = (1 - alpha) * bgColor.red + alpha * fgColor.red;
  18147. var g = (1 - alpha) * bgColor.green + alpha * fgColor.green;
  18148. var b = (1 - alpha) * bgColor.blue + alpha * fgColor.blue;
  18149. var a = fgColor.alpha + bgColor.alpha * (1 - fgColor.alpha);
  18150. return new color_default(r, g, b, a);
  18151. }
  18152. function _getBackgroundStack(node) {
  18153. var stacks = get_text_element_stack_default(node).map(function(stack) {
  18154. stack = reduce_to_elements_below_floating_default(stack, node);
  18155. stack = sortPageBackground(stack);
  18156. return stack;
  18157. });
  18158. for (var index = 0; index < stacks.length; index++) {
  18159. var stack = stacks[index];
  18160. if (stack[0] !== node) {
  18161. incomplete_data_default.set('bgColor', 'bgOverlap');
  18162. return null;
  18163. }
  18164. if (index !== 0 && !shallowArraysEqual(stack, stacks[0])) {
  18165. incomplete_data_default.set('bgColor', 'elmPartiallyObscuring');
  18166. return null;
  18167. }
  18168. }
  18169. return stacks[0] || null;
  18170. }
  18171. function sortPageBackground(elmStack) {
  18172. var bodyIndex = elmStack.indexOf(document.body);
  18173. var bgNodes = elmStack;
  18174. var htmlBgColor = get_own_background_color_default(window.getComputedStyle(document.documentElement));
  18175. if (bodyIndex > 1 && htmlBgColor.alpha === 0 && !element_has_image_default(document.documentElement)) {
  18176. if (bodyIndex > 1) {
  18177. bgNodes.splice(bodyIndex, 1);
  18178. bgNodes.push(document.body);
  18179. }
  18180. var htmlIndex = bgNodes.indexOf(document.documentElement);
  18181. if (htmlIndex > 0) {
  18182. bgNodes.splice(htmlIndex, 1);
  18183. bgNodes.push(document.documentElement);
  18184. }
  18185. }
  18186. return bgNodes;
  18187. }
  18188. function shallowArraysEqual(a, b) {
  18189. if (a === b) {
  18190. return true;
  18191. }
  18192. if (a === null || b === null) {
  18193. return false;
  18194. }
  18195. if (a.length !== b.length) {
  18196. return false;
  18197. }
  18198. for (var i = 0; i < a.length; ++i) {
  18199. if (a[i] !== b[i]) {
  18200. return false;
  18201. }
  18202. }
  18203. return true;
  18204. }
  18205. function getTextShadowColors(node) {
  18206. var _ref79 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, minRatio = _ref79.minRatio, maxRatio = _ref79.maxRatio;
  18207. var style = window.getComputedStyle(node);
  18208. var textShadow = style.getPropertyValue('text-shadow');
  18209. if (textShadow === 'none') {
  18210. return [];
  18211. }
  18212. var fontSizeStr = style.getPropertyValue('font-size');
  18213. var fontSize = parseInt(fontSizeStr);
  18214. assert_default(isNaN(fontSize) === false, 'Unable to determine font-size value '.concat(fontSizeStr));
  18215. var shadowColors = [];
  18216. var shadows = parseTextShadows(textShadow);
  18217. shadows.forEach(function(_ref80) {
  18218. var colorStr = _ref80.colorStr, pixels = _ref80.pixels;
  18219. colorStr = colorStr || style.getPropertyValue('color');
  18220. var _pixels = _slicedToArray(pixels, 3), offsetY = _pixels[0], offsetX = _pixels[1], _pixels$ = _pixels[2], blurRadius = _pixels$ === void 0 ? 0 : _pixels$;
  18221. if ((!minRatio || blurRadius >= fontSize * minRatio) && (!maxRatio || blurRadius < fontSize * maxRatio)) {
  18222. var color = textShadowColor({
  18223. colorStr: colorStr,
  18224. offsetY: offsetY,
  18225. offsetX: offsetX,
  18226. blurRadius: blurRadius,
  18227. fontSize: fontSize
  18228. });
  18229. shadowColors.push(color);
  18230. }
  18231. });
  18232. return shadowColors;
  18233. }
  18234. function parseTextShadows(textShadow) {
  18235. var current = {
  18236. pixels: []
  18237. };
  18238. var str = textShadow.trim();
  18239. var shadows = [ current ];
  18240. if (!str) {
  18241. return [];
  18242. }
  18243. while (str) {
  18244. var colorMatch = str.match(/^rgba?\([0-9,.\s]+\)/i) || str.match(/^[a-z]+/i) || str.match(/^#[0-9a-f]+/i);
  18245. var pixelMatch = str.match(/^([0-9.-]+)px/i) || str.match(/^(0)/);
  18246. if (colorMatch) {
  18247. assert_default(!current.colorStr, 'Multiple colors identified in text-shadow: '.concat(textShadow));
  18248. str = str.replace(colorMatch[0], '').trim();
  18249. current.colorStr = colorMatch[0];
  18250. } else if (pixelMatch) {
  18251. assert_default(current.pixels.length < 3, 'Too many pixel units in text-shadow: '.concat(textShadow));
  18252. str = str.replace(pixelMatch[0], '').trim();
  18253. var pixelUnit = parseFloat((pixelMatch[1][0] === '.' ? '0' : '') + pixelMatch[1]);
  18254. current.pixels.push(pixelUnit);
  18255. } else if (str[0] === ',') {
  18256. assert_default(current.pixels.length >= 2, 'Missing pixel value in text-shadow: '.concat(textShadow));
  18257. current = {
  18258. pixels: []
  18259. };
  18260. shadows.push(current);
  18261. str = str.substr(1).trim();
  18262. } else {
  18263. throw new Error('Unable to process text-shadows: '.concat(textShadow));
  18264. }
  18265. }
  18266. return shadows;
  18267. }
  18268. function textShadowColor(_ref81) {
  18269. var colorStr = _ref81.colorStr, offsetX = _ref81.offsetX, offsetY = _ref81.offsetY, blurRadius = _ref81.blurRadius, fontSize = _ref81.fontSize;
  18270. if (offsetX > blurRadius || offsetY > blurRadius) {
  18271. return new color_default(0, 0, 0, 0);
  18272. }
  18273. var shadowColor = new color_default();
  18274. shadowColor.parseString(colorStr);
  18275. shadowColor.alpha *= blurRadiusToAlpha(blurRadius, fontSize);
  18276. return shadowColor;
  18277. }
  18278. function blurRadiusToAlpha(blurRadius, fontSize) {
  18279. if (blurRadius === 0) {
  18280. return 1;
  18281. }
  18282. var relativeBlur = blurRadius / fontSize;
  18283. return .185 / (relativeBlur + .4);
  18284. }
  18285. var get_text_shadow_colors_default = getTextShadowColors;
  18286. function _getStackingContext(elm, elmStack) {
  18287. var _elmStack;
  18288. var vNode = get_node_from_tree_default(elm);
  18289. if (vNode._stackingContext) {
  18290. return vNode._stackingContext;
  18291. }
  18292. var stackingContext = [];
  18293. var contextMap = new Map();
  18294. elmStack = (_elmStack = elmStack) !== null && _elmStack !== void 0 ? _elmStack : _getBackgroundStack(elm);
  18295. elmStack.forEach(function(bgElm) {
  18296. var _stackingOrder2;
  18297. var bgVNode = get_node_from_tree_default(bgElm);
  18298. var bgColor = getOwnBackgroundColor2(bgVNode);
  18299. var stackingOrder = bgVNode._stackingOrder.filter(function(_ref82) {
  18300. var vNode2 = _ref82.vNode;
  18301. return !!vNode2;
  18302. });
  18303. stackingOrder.forEach(function(_ref83, index) {
  18304. var _stackingOrder;
  18305. var vNode2 = _ref83.vNode;
  18306. var ancestorVNode2 = (_stackingOrder = stackingOrder[index - 1]) === null || _stackingOrder === void 0 ? void 0 : _stackingOrder.vNode;
  18307. var context2 = addToStackingContext(contextMap, vNode2, ancestorVNode2);
  18308. if (index === 0 && !contextMap.get(vNode2)) {
  18309. stackingContext.unshift(context2);
  18310. }
  18311. contextMap.set(vNode2, context2);
  18312. });
  18313. var ancestorVNode = (_stackingOrder2 = stackingOrder[stackingOrder.length - 1]) === null || _stackingOrder2 === void 0 ? void 0 : _stackingOrder2.vNode;
  18314. var context = addToStackingContext(contextMap, bgVNode, ancestorVNode);
  18315. if (!stackingOrder.length) {
  18316. stackingContext.unshift(context);
  18317. }
  18318. context.bgColor = bgColor;
  18319. });
  18320. vNode._stackingContext = stackingContext;
  18321. return stackingContext;
  18322. }
  18323. function _stackingContextToColor(context) {
  18324. var _context$descendants;
  18325. if (!((_context$descendants = context.descendants) !== null && _context$descendants !== void 0 && _context$descendants.length)) {
  18326. var color2 = context.bgColor;
  18327. color2.alpha *= context.opacity;
  18328. return {
  18329. color: color2,
  18330. blendMode: context.blendMode
  18331. };
  18332. }
  18333. var sourceColor = context.descendants.reduce(reduceToColor, createStackingContext());
  18334. var color = flatten_colors_default(sourceColor, context.bgColor, context.descendants[0].blendMode);
  18335. color.alpha *= context.opacity;
  18336. return {
  18337. color: color,
  18338. blendMode: context.blendMode
  18339. };
  18340. }
  18341. function reduceToColor(backdropContext, sourceContext) {
  18342. var backdrop;
  18343. if (backdropContext instanceof color_default) {
  18344. backdrop = backdropContext;
  18345. } else {
  18346. backdrop = _stackingContextToColor(backdropContext).color;
  18347. }
  18348. var sourceColor = _stackingContextToColor(sourceContext).color;
  18349. return flatten_colors_default(sourceColor, backdrop, sourceContext.blendMode);
  18350. }
  18351. function createStackingContext(vNode, ancestorContext) {
  18352. var _vNode$getComputedSty;
  18353. return {
  18354. vNode: vNode,
  18355. ancestor: ancestorContext,
  18356. opacity: parseFloat((_vNode$getComputedSty = vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('opacity')) !== null && _vNode$getComputedSty !== void 0 ? _vNode$getComputedSty : 1),
  18357. bgColor: new color_default(0, 0, 0, 0),
  18358. blendMode: normalizeBlendMode(vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('mix-blend-mode')),
  18359. descendants: []
  18360. };
  18361. }
  18362. function normalizeBlendMode(blendmode) {
  18363. return !!blendmode ? blendmode : void 0;
  18364. }
  18365. function addToStackingContext(contextMap, vNode, ancestorVNode) {
  18366. var _contextMap$get;
  18367. var ancestorContext = contextMap.get(ancestorVNode);
  18368. var context = (_contextMap$get = contextMap.get(vNode)) !== null && _contextMap$get !== void 0 ? _contextMap$get : createStackingContext(vNode, ancestorContext);
  18369. if (ancestorContext && ancestorVNode !== vNode && !ancestorContext.descendants.includes(context)) {
  18370. ancestorContext.descendants.unshift(context);
  18371. }
  18372. return context;
  18373. }
  18374. function getOwnBackgroundColor2(vNode) {
  18375. var bgColor = new color_default();
  18376. bgColor.parseString(vNode.getComputedStylePropertyValue('background-color'));
  18377. return bgColor;
  18378. }
  18379. function _getBackgroundColor2(elm) {
  18380. var bgElms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  18381. var shadowOutlineEmMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .1;
  18382. var vNode = get_node_from_tree_default(elm);
  18383. var bgColorCache = vNode._cache.getBackgroundColor;
  18384. if (bgColorCache) {
  18385. bgElms.push.apply(bgElms, _toConsumableArray(bgColorCache.bgElms));
  18386. incomplete_data_default.set('bgColor', bgColorCache.incompleteData);
  18387. return bgColorCache.bgColor;
  18388. }
  18389. var bgColor = _getBackgroundColor(elm, bgElms, shadowOutlineEmMax);
  18390. vNode._cache.getBackgroundColor = {
  18391. bgColor: bgColor,
  18392. bgElms: bgElms,
  18393. incompleteData: incomplete_data_default.get('bgColor')
  18394. };
  18395. return bgColor;
  18396. }
  18397. function _getBackgroundColor(elm, bgElms, shadowOutlineEmMax) {
  18398. var _bgColors;
  18399. var elmStack = _getBackgroundStack(elm);
  18400. if (!elmStack) {
  18401. return null;
  18402. }
  18403. var textRects = get_visible_child_text_rects_default(elm);
  18404. var bgColors = get_text_shadow_colors_default(elm, {
  18405. minRatio: shadowOutlineEmMax
  18406. });
  18407. if (bgColors.length) {
  18408. bgColors = [ {
  18409. color: bgColors.reduce(_flattenShadowColors)
  18410. } ];
  18411. }
  18412. for (var _i25 = 0; _i25 < elmStack.length; _i25++) {
  18413. var bgElm = elmStack[_i25];
  18414. var bgElmStyle = window.getComputedStyle(bgElm);
  18415. if (element_has_image_default(bgElm, bgElmStyle)) {
  18416. bgElms.push(bgElm);
  18417. return null;
  18418. }
  18419. var bgColor = get_own_background_color_default(bgElmStyle);
  18420. if (bgColor.alpha === 0) {
  18421. continue;
  18422. }
  18423. if (bgElmStyle.getPropertyValue('display') !== 'inline' && !fullyEncompasses(bgElm, textRects)) {
  18424. bgElms.push(bgElm);
  18425. incomplete_data_default.set('bgColor', 'elmPartiallyObscured');
  18426. return null;
  18427. }
  18428. bgElms.push(bgElm);
  18429. if (bgColor.alpha === 1) {
  18430. break;
  18431. }
  18432. }
  18433. var stackingContext = _getStackingContext(elm, elmStack);
  18434. bgColors = stackingContext.map(_stackingContextToColor).concat(bgColors);
  18435. var pageBgs = getPageBackgroundColors(elm, elmStack.includes(document.body));
  18436. (_bgColors = bgColors).unshift.apply(_bgColors, _toConsumableArray(pageBgs));
  18437. if (bgColors.length === 0) {
  18438. return new color_default(255, 255, 255, 1);
  18439. }
  18440. var blendedColor = bgColors.reduce(function(bgColor, fgColor) {
  18441. return flatten_colors_default(fgColor.color, bgColor.color instanceof color_default ? bgColor.color : bgColor, fgColor.blendMode);
  18442. });
  18443. return flatten_colors_default(blendedColor.color instanceof color_default ? blendedColor.color : blendedColor, new color_default(255, 255, 255, 1));
  18444. }
  18445. function fullyEncompasses(node, rects) {
  18446. rects = Array.isArray(rects) ? rects : [ rects ];
  18447. var nodeRect = node.getBoundingClientRect();
  18448. var right = nodeRect.right, bottom = nodeRect.bottom;
  18449. var style = window.getComputedStyle(node);
  18450. var overflow = style.getPropertyValue('overflow');
  18451. if ([ 'scroll', 'auto' ].includes(overflow) || node instanceof window.HTMLHtmlElement) {
  18452. right = nodeRect.left + node.scrollWidth;
  18453. bottom = nodeRect.top + node.scrollHeight;
  18454. }
  18455. return rects.every(function(rect) {
  18456. return rect.top >= nodeRect.top && rect.bottom <= bottom && rect.left >= nodeRect.left && rect.right <= right;
  18457. });
  18458. }
  18459. function normalizeBlendMode2(blendmode) {
  18460. return !!blendmode ? blendmode : void 0;
  18461. }
  18462. function getPageBackgroundColors(elm, stackContainsBody) {
  18463. var pageColors = [];
  18464. if (!stackContainsBody) {
  18465. var html = document.documentElement;
  18466. var body = document.body;
  18467. var htmlStyle = window.getComputedStyle(html);
  18468. var bodyStyle = window.getComputedStyle(body);
  18469. var htmlBgColor = get_own_background_color_default(htmlStyle);
  18470. var bodyBgColor = get_own_background_color_default(bodyStyle);
  18471. var bodyBgColorApplies = bodyBgColor.alpha !== 0 && fullyEncompasses(body, elm.getBoundingClientRect());
  18472. if (bodyBgColor.alpha !== 0 && htmlBgColor.alpha === 0 || bodyBgColorApplies && bodyBgColor.alpha !== 1) {
  18473. pageColors.unshift({
  18474. color: bodyBgColor,
  18475. blendMode: normalizeBlendMode2(bodyStyle.getPropertyValue('mix-blend-mode'))
  18476. });
  18477. }
  18478. if (htmlBgColor.alpha !== 0 && (!bodyBgColorApplies || bodyBgColorApplies && bodyBgColor.alpha !== 1)) {
  18479. pageColors.unshift({
  18480. color: htmlBgColor,
  18481. blendMode: normalizeBlendMode2(htmlStyle.getPropertyValue('mix-blend-mode'))
  18482. });
  18483. }
  18484. }
  18485. return pageColors;
  18486. }
  18487. function getContrast(bgColor, fgColor) {
  18488. if (!fgColor || !bgColor) {
  18489. return null;
  18490. }
  18491. if (fgColor.alpha < 1) {
  18492. fgColor = flatten_colors_default(fgColor, bgColor);
  18493. }
  18494. var bL = bgColor.getRelativeLuminance();
  18495. var fL = fgColor.getRelativeLuminance();
  18496. return (Math.max(fL, bL) + .05) / (Math.min(fL, bL) + .05);
  18497. }
  18498. var get_contrast_default = getContrast;
  18499. function _getForegroundColor(node, _, bgColor) {
  18500. var _bgColor;
  18501. var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  18502. var nodeStyle = window.getComputedStyle(node);
  18503. var colorStack = [ function() {
  18504. return getStrokeColor(nodeStyle, options);
  18505. }, function() {
  18506. return getTextColor(nodeStyle);
  18507. }, function() {
  18508. return get_text_shadow_colors_default(node, {
  18509. minRatio: 0
  18510. });
  18511. } ];
  18512. var fgColors = [];
  18513. for (var _i26 = 0, _colorStack = colorStack; _i26 < _colorStack.length; _i26++) {
  18514. var colorFn = _colorStack[_i26];
  18515. var color = colorFn();
  18516. if (!color) {
  18517. continue;
  18518. }
  18519. fgColors = fgColors.concat(color);
  18520. if (color.alpha === 1) {
  18521. break;
  18522. }
  18523. }
  18524. var fgColor = fgColors.reduce(function(source, backdrop) {
  18525. return flatten_colors_default(source, backdrop);
  18526. });
  18527. (_bgColor = bgColor) !== null && _bgColor !== void 0 ? _bgColor : bgColor = _getBackgroundColor2(node, []);
  18528. if (bgColor === null) {
  18529. var reason = incomplete_data_default.get('bgColor');
  18530. incomplete_data_default.set('fgColor', reason);
  18531. return null;
  18532. }
  18533. var stackingContexts = _getStackingContext(node);
  18534. var context = findNodeInContexts(stackingContexts, node);
  18535. return flatten_colors_default(calculateBlendedForegroundColor(fgColor, context, stackingContexts), new color_default(255, 255, 255, 1));
  18536. }
  18537. function getTextColor(nodeStyle) {
  18538. return new color_default().parseString(nodeStyle.getPropertyValue('-webkit-text-fill-color') || nodeStyle.getPropertyValue('color'));
  18539. }
  18540. function getStrokeColor(nodeStyle, _ref84) {
  18541. var _ref84$textStrokeEmMi = _ref84.textStrokeEmMin, textStrokeEmMin = _ref84$textStrokeEmMi === void 0 ? 0 : _ref84$textStrokeEmMi;
  18542. var strokeWidth = parseFloat(nodeStyle.getPropertyValue('-webkit-text-stroke-width'));
  18543. if (strokeWidth === 0) {
  18544. return null;
  18545. }
  18546. var fontSize = nodeStyle.getPropertyValue('font-size');
  18547. var relativeStrokeWidth = strokeWidth / parseFloat(fontSize);
  18548. if (isNaN(relativeStrokeWidth) || relativeStrokeWidth < textStrokeEmMin) {
  18549. return null;
  18550. }
  18551. var strokeColor = nodeStyle.getPropertyValue('-webkit-text-stroke-color');
  18552. return new color_default().parseString(strokeColor);
  18553. }
  18554. function calculateBlendedForegroundColor(fgColor, context, stackingContexts) {
  18555. while (context) {
  18556. var _context$ancestor;
  18557. if (context.opacity === 1 && context.ancestor) {
  18558. context = context.ancestor;
  18559. continue;
  18560. }
  18561. fgColor.alpha *= context.opacity;
  18562. var stack = ((_context$ancestor = context.ancestor) === null || _context$ancestor === void 0 ? void 0 : _context$ancestor.descendants) || stackingContexts;
  18563. if (context.opacity !== 1) {
  18564. stack = stack.slice(0, stack.indexOf(context));
  18565. }
  18566. var bgColors = stack.map(_stackingContextToColor);
  18567. if (!bgColors.length) {
  18568. context = context.ancestor;
  18569. continue;
  18570. }
  18571. var bgColor = bgColors.reduce(function(backdrop, source) {
  18572. return flatten_colors_default(source.color, backdrop.color instanceof color_default ? backdrop.color : backdrop);
  18573. }, {
  18574. color: new color_default(0, 0, 0, 0),
  18575. blendMode: 'normal'
  18576. });
  18577. fgColor = flatten_colors_default(fgColor, bgColor);
  18578. context = context.ancestor;
  18579. }
  18580. return fgColor;
  18581. }
  18582. function findNodeInContexts(contexts, node) {
  18583. var _iterator8 = _createForOfIteratorHelper(contexts), _step8;
  18584. try {
  18585. for (_iterator8.s(); !(_step8 = _iterator8.n()).done; ) {
  18586. var _context$vNode;
  18587. var context = _step8.value;
  18588. if (((_context$vNode = context.vNode) === null || _context$vNode === void 0 ? void 0 : _context$vNode.actualNode) === node) {
  18589. return context;
  18590. }
  18591. var found = findNodeInContexts(context.descendants, node);
  18592. if (found) {
  18593. return found;
  18594. }
  18595. }
  18596. } catch (err) {
  18597. _iterator8.e(err);
  18598. } finally {
  18599. _iterator8.f();
  18600. }
  18601. }
  18602. function hasValidContrastRatio(bg, fg, fontSize, isBold) {
  18603. var contrast = get_contrast_default(bg, fg);
  18604. var isSmallFont = isBold && Math.ceil(fontSize * 72) / 96 < 14 || !isBold && Math.ceil(fontSize * 72) / 96 < 18;
  18605. var expectedContrastRatio = isSmallFont ? 4.5 : 3;
  18606. return {
  18607. isValid: contrast > expectedContrastRatio,
  18608. contrastRatio: contrast,
  18609. expectedContrastRatio: expectedContrastRatio
  18610. };
  18611. }
  18612. var has_valid_contrast_ratio_default = hasValidContrastRatio;
  18613. function colorContrastEvaluate(node, options, virtualNode) {
  18614. var ignoreUnicode = options.ignoreUnicode, ignoreLength = options.ignoreLength, ignorePseudo = options.ignorePseudo, boldValue = options.boldValue, boldTextPt = options.boldTextPt, largeTextPt = options.largeTextPt, contrastRatio = options.contrastRatio, shadowOutlineEmMax = options.shadowOutlineEmMax, pseudoSizeThreshold = options.pseudoSizeThreshold;
  18615. if (!_isVisibleOnScreen(node)) {
  18616. this.data({
  18617. messageKey: 'hidden'
  18618. });
  18619. return true;
  18620. }
  18621. var visibleText = visible_virtual_default(virtualNode, false, true);
  18622. if (ignoreUnicode && textIsEmojis(visibleText)) {
  18623. this.data({
  18624. messageKey: 'nonBmp'
  18625. });
  18626. return void 0;
  18627. }
  18628. var nodeStyle = window.getComputedStyle(node);
  18629. var fontSize = parseFloat(nodeStyle.getPropertyValue('font-size'));
  18630. var fontWeight = nodeStyle.getPropertyValue('font-weight');
  18631. var bold = parseFloat(fontWeight) >= boldValue || fontWeight === 'bold';
  18632. var ptSize = Math.ceil(fontSize * 72) / 96;
  18633. var isSmallFont = bold && ptSize < boldTextPt || !bold && ptSize < largeTextPt;
  18634. var _ref85 = isSmallFont ? contrastRatio.normal : contrastRatio.large, expected = _ref85.expected, minThreshold = _ref85.minThreshold, maxThreshold = _ref85.maxThreshold;
  18635. var pseudoElm = findPseudoElement(virtualNode, {
  18636. ignorePseudo: ignorePseudo,
  18637. pseudoSizeThreshold: pseudoSizeThreshold
  18638. });
  18639. if (pseudoElm) {
  18640. this.data({
  18641. fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'),
  18642. fontWeight: bold ? 'bold' : 'normal',
  18643. messageKey: 'pseudoContent',
  18644. expectedContrastRatio: expected + ':1'
  18645. });
  18646. this.relatedNodes(pseudoElm.actualNode);
  18647. return void 0;
  18648. }
  18649. var bgNodes = [];
  18650. var bgColor = _getBackgroundColor2(node, bgNodes, shadowOutlineEmMax);
  18651. var fgColor = _getForegroundColor(node, false, bgColor, options);
  18652. var shadowColors = get_text_shadow_colors_default(node, {
  18653. minRatio: .001,
  18654. maxRatio: shadowOutlineEmMax
  18655. });
  18656. var contrast = null;
  18657. var contrastContributor = null;
  18658. var shadowColor = null;
  18659. if (shadowColors.length === 0) {
  18660. contrast = get_contrast_default(bgColor, fgColor);
  18661. } else if (fgColor && bgColor) {
  18662. shadowColor = [].concat(_toConsumableArray(shadowColors), [ bgColor ]).reduce(_flattenShadowColors);
  18663. var fgBgContrast = get_contrast_default(bgColor, fgColor);
  18664. var bgShContrast = get_contrast_default(bgColor, shadowColor);
  18665. var fgShContrast = get_contrast_default(shadowColor, fgColor);
  18666. contrast = Math.max(fgBgContrast, bgShContrast, fgShContrast);
  18667. if (contrast !== fgBgContrast) {
  18668. contrastContributor = bgShContrast > fgShContrast ? 'shadowOnBgColor' : 'fgOnShadowColor';
  18669. }
  18670. }
  18671. var isValid = contrast > expected;
  18672. if (typeof minThreshold === 'number' && (typeof contrast !== 'number' || contrast < minThreshold) || typeof maxThreshold === 'number' && (typeof contrast !== 'number' || contrast > maxThreshold)) {
  18673. this.data({
  18674. contrastRatio: contrast
  18675. });
  18676. return true;
  18677. }
  18678. var truncatedResult = Math.floor(contrast * 100) / 100;
  18679. var missing;
  18680. if (bgColor === null) {
  18681. missing = incomplete_data_default.get('bgColor');
  18682. } else if (!isValid) {
  18683. missing = contrastContributor;
  18684. }
  18685. var equalRatio = truncatedResult === 1;
  18686. var shortTextContent = visibleText.length === 1;
  18687. if (equalRatio) {
  18688. missing = incomplete_data_default.set('bgColor', 'equalRatio');
  18689. } else if (!isValid && shortTextContent && !ignoreLength) {
  18690. missing = 'shortTextContent';
  18691. }
  18692. this.data({
  18693. fgColor: fgColor ? fgColor.toHexString() : void 0,
  18694. bgColor: bgColor ? bgColor.toHexString() : void 0,
  18695. contrastRatio: truncatedResult,
  18696. fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'),
  18697. fontWeight: bold ? 'bold' : 'normal',
  18698. messageKey: missing,
  18699. expectedContrastRatio: expected + ':1',
  18700. shadowColor: shadowColor ? shadowColor.toHexString() : void 0
  18701. });
  18702. if (fgColor === null || bgColor === null || equalRatio || shortTextContent && !ignoreLength && !isValid) {
  18703. missing = null;
  18704. incomplete_data_default.clear();
  18705. this.relatedNodes(bgNodes);
  18706. return void 0;
  18707. }
  18708. if (!isValid) {
  18709. this.relatedNodes(bgNodes);
  18710. }
  18711. return isValid;
  18712. }
  18713. function findPseudoElement(vNode, _ref86) {
  18714. var _ref86$pseudoSizeThre = _ref86.pseudoSizeThreshold, pseudoSizeThreshold = _ref86$pseudoSizeThre === void 0 ? .25 : _ref86$pseudoSizeThre, _ref86$ignorePseudo = _ref86.ignorePseudo, ignorePseudo = _ref86$ignorePseudo === void 0 ? false : _ref86$ignorePseudo;
  18715. if (ignorePseudo) {
  18716. return;
  18717. }
  18718. var rect = vNode.boundingClientRect;
  18719. var minimumSize = rect.width * rect.height * pseudoSizeThreshold;
  18720. do {
  18721. var beforeSize = getPseudoElementArea(vNode.actualNode, ':before');
  18722. var afterSize = getPseudoElementArea(vNode.actualNode, ':after');
  18723. if (beforeSize + afterSize > minimumSize) {
  18724. return vNode;
  18725. }
  18726. } while (vNode = vNode.parent);
  18727. }
  18728. var getPseudoElementArea = memoize_default(function getPseudoElementArea2(node, pseudo) {
  18729. var style = window.getComputedStyle(node, pseudo);
  18730. var matchPseudoStyle = function matchPseudoStyle(prop, value) {
  18731. return style.getPropertyValue(prop) === value;
  18732. };
  18733. if (matchPseudoStyle('content', 'none') || matchPseudoStyle('display', 'none') || matchPseudoStyle('visibility', 'hidden') || matchPseudoStyle('position', 'absolute') === false) {
  18734. return 0;
  18735. }
  18736. if (get_own_background_color_default(style).alpha === 0 && matchPseudoStyle('background-image', 'none')) {
  18737. return 0;
  18738. }
  18739. var pseudoWidth = parseUnit(style.getPropertyValue('width'));
  18740. var pseudoHeight = parseUnit(style.getPropertyValue('height'));
  18741. if (pseudoWidth.unit !== 'px' || pseudoHeight.unit !== 'px') {
  18742. return pseudoWidth.value === 0 || pseudoHeight.value === 0 ? 0 : Infinity;
  18743. }
  18744. return pseudoWidth.value * pseudoHeight.value;
  18745. });
  18746. function textIsEmojis(visibleText) {
  18747. var options = {
  18748. nonBmp: true
  18749. };
  18750. var hasUnicodeChars = has_unicode_default(visibleText, options);
  18751. var hasNonUnicodeChars = sanitize_default(remove_unicode_default(visibleText, options)) === '';
  18752. return hasUnicodeChars && hasNonUnicodeChars;
  18753. }
  18754. function parseUnit(str) {
  18755. var unitRegex = /^([0-9.]+)([a-z]+)$/i;
  18756. var _ref87 = str.match(unitRegex) || [], _ref88 = _slicedToArray(_ref87, 3), _ref88$ = _ref88[1], value = _ref88$ === void 0 ? '' : _ref88$, _ref88$2 = _ref88[2], unit = _ref88$2 === void 0 ? '' : _ref88$2;
  18757. return {
  18758. value: parseFloat(value),
  18759. unit: unit.toLowerCase()
  18760. };
  18761. }
  18762. function getContrast2(color1, color2) {
  18763. var c1lum = color1.getRelativeLuminance();
  18764. var c2lum = color2.getRelativeLuminance();
  18765. return (Math.max(c1lum, c2lum) + .05) / (Math.min(c1lum, c2lum) + .05);
  18766. }
  18767. var blockLike2 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
  18768. function isBlock2(elm) {
  18769. var display = window.getComputedStyle(elm).getPropertyValue('display');
  18770. return blockLike2.indexOf(display) !== -1 || display.substr(0, 6) === 'table-';
  18771. }
  18772. function linkInTextBlockEvaluate(node, options) {
  18773. var requiredContrastRatio = options.requiredContrastRatio, allowSameColor = options.allowSameColor;
  18774. if (isBlock2(node)) {
  18775. return false;
  18776. }
  18777. var parentBlock = get_composed_parent_default(node);
  18778. while (parentBlock && parentBlock.nodeType === 1 && !isBlock2(parentBlock)) {
  18779. parentBlock = get_composed_parent_default(parentBlock);
  18780. }
  18781. if (!parentBlock) {
  18782. return void 0;
  18783. }
  18784. this.relatedNodes([ parentBlock ]);
  18785. var nodeColor = _getForegroundColor(node);
  18786. var parentColor = _getForegroundColor(parentBlock);
  18787. var nodeBackgroundColor = _getBackgroundColor2(node);
  18788. var parentBackgroundColor = _getBackgroundColor2(parentBlock);
  18789. var textContrast = nodeColor && parentColor ? getContrast2(nodeColor, parentColor) : void 0;
  18790. if (textContrast) {
  18791. textContrast = Math.floor(textContrast * 100) / 100;
  18792. }
  18793. if (textContrast && textContrast >= requiredContrastRatio) {
  18794. return true;
  18795. }
  18796. var backgroundContrast = nodeBackgroundColor && parentBackgroundColor ? getContrast2(nodeBackgroundColor, parentBackgroundColor) : void 0;
  18797. if (backgroundContrast) {
  18798. backgroundContrast = Math.floor(backgroundContrast * 100) / 100;
  18799. }
  18800. if (backgroundContrast && backgroundContrast >= requiredContrastRatio) {
  18801. return true;
  18802. }
  18803. if (!backgroundContrast) {
  18804. var _incomplete_data_defa;
  18805. var reason = (_incomplete_data_defa = incomplete_data_default.get('bgColor')) !== null && _incomplete_data_defa !== void 0 ? _incomplete_data_defa : 'bgContrast';
  18806. this.data({
  18807. messageKey: reason
  18808. });
  18809. incomplete_data_default.clear();
  18810. return void 0;
  18811. }
  18812. if (!textContrast) {
  18813. return void 0;
  18814. }
  18815. if (allowSameColor && textContrast === 1 && backgroundContrast === 1) {
  18816. return true;
  18817. }
  18818. if (textContrast === 1 && backgroundContrast > 1) {
  18819. this.data({
  18820. messageKey: 'bgContrast',
  18821. contrastRatio: backgroundContrast,
  18822. requiredContrastRatio: requiredContrastRatio,
  18823. nodeBackgroundColor: nodeBackgroundColor ? nodeBackgroundColor.toHexString() : void 0,
  18824. parentBackgroundColor: parentBackgroundColor ? parentBackgroundColor.toHexString() : void 0
  18825. });
  18826. return false;
  18827. }
  18828. this.data({
  18829. messageKey: 'fgContrast',
  18830. contrastRatio: textContrast,
  18831. requiredContrastRatio: requiredContrastRatio,
  18832. nodeColor: nodeColor ? nodeColor.toHexString() : void 0,
  18833. parentColor: parentColor ? parentColor.toHexString() : void 0
  18834. });
  18835. return false;
  18836. }
  18837. var link_in_text_block_evaluate_default = linkInTextBlockEvaluate;
  18838. var blockLike3 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
  18839. function isBlock3(elm) {
  18840. var display = window.getComputedStyle(elm).getPropertyValue('display');
  18841. return blockLike3.indexOf(display) !== -1 || display.substr(0, 6) === 'table-';
  18842. }
  18843. function linkInTextBlockStyleEvaluate(node) {
  18844. if (isBlock3(node)) {
  18845. return false;
  18846. }
  18847. var parentBlock = get_composed_parent_default(node);
  18848. while (parentBlock && parentBlock.nodeType === 1 && !isBlock3(parentBlock)) {
  18849. parentBlock = get_composed_parent_default(parentBlock);
  18850. }
  18851. if (!parentBlock) {
  18852. return void 0;
  18853. }
  18854. this.relatedNodes([ parentBlock ]);
  18855. return element_is_distinct_default(node, parentBlock);
  18856. }
  18857. var link_in_text_block_style_evaluate_default = linkInTextBlockStyleEvaluate;
  18858. function autocompleteAppropriateEvaluate(node, options, virtualNode) {
  18859. if (virtualNode.props.nodeName !== 'input') {
  18860. return true;
  18861. }
  18862. var number = [ 'text', 'search', 'number', 'tel' ];
  18863. var url = [ 'text', 'search', 'url' ];
  18864. var allowedTypesMap = {
  18865. bday: [ 'text', 'search', 'date' ],
  18866. email: [ 'text', 'search', 'email' ],
  18867. username: [ 'text', 'search', 'email' ],
  18868. 'street-address': [ 'text' ],
  18869. tel: [ 'text', 'search', 'tel' ],
  18870. 'tel-country-code': [ 'text', 'search', 'tel' ],
  18871. 'tel-national': [ 'text', 'search', 'tel' ],
  18872. 'tel-area-code': [ 'text', 'search', 'tel' ],
  18873. 'tel-local': [ 'text', 'search', 'tel' ],
  18874. 'tel-local-prefix': [ 'text', 'search', 'tel' ],
  18875. 'tel-local-suffix': [ 'text', 'search', 'tel' ],
  18876. 'tel-extension': [ 'text', 'search', 'tel' ],
  18877. 'cc-number': number,
  18878. 'cc-exp': [ 'text', 'search', 'month', 'tel' ],
  18879. 'cc-exp-month': number,
  18880. 'cc-exp-year': number,
  18881. 'cc-csc': number,
  18882. 'transaction-amount': number,
  18883. 'bday-day': number,
  18884. 'bday-month': number,
  18885. 'bday-year': number,
  18886. 'new-password': [ 'text', 'search', 'password' ],
  18887. 'current-password': [ 'text', 'search', 'password' ],
  18888. url: url,
  18889. photo: url,
  18890. impp: url
  18891. };
  18892. if (_typeof(options) === 'object') {
  18893. Object.keys(options).forEach(function(key) {
  18894. if (!allowedTypesMap[key]) {
  18895. allowedTypesMap[key] = [];
  18896. }
  18897. allowedTypesMap[key] = allowedTypesMap[key].concat(options[key]);
  18898. });
  18899. }
  18900. var autocompleteAttr = virtualNode.attr('autocomplete');
  18901. var autocompleteTerms = autocompleteAttr.split(/\s+/g).map(function(term) {
  18902. return term.toLowerCase();
  18903. });
  18904. var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
  18905. if (_autocomplete.stateTerms.includes(purposeTerm)) {
  18906. return true;
  18907. }
  18908. var allowedTypes = allowedTypesMap[purposeTerm];
  18909. var type = virtualNode.hasAttr('type') ? sanitize_default(virtualNode.attr('type')).toLowerCase() : 'text';
  18910. type = valid_input_type_default().includes(type) ? type : 'text';
  18911. if (typeof allowedTypes === 'undefined') {
  18912. return type === 'text';
  18913. }
  18914. return allowedTypes.includes(type);
  18915. }
  18916. var autocomplete_appropriate_evaluate_default = autocompleteAppropriateEvaluate;
  18917. function autocompleteValidEvaluate(node, options, virtualNode) {
  18918. var autocomplete2 = virtualNode.attr('autocomplete') || '';
  18919. return is_valid_autocomplete_default(autocomplete2, options);
  18920. }
  18921. var autocomplete_valid_evaluate_default = autocompleteValidEvaluate;
  18922. function attrNonSpaceContentEvaluate(node) {
  18923. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18924. var vNode = arguments.length > 2 ? arguments[2] : undefined;
  18925. if (!options.attribute || typeof options.attribute !== 'string') {
  18926. throw new TypeError('attr-non-space-content requires options.attribute to be a string');
  18927. }
  18928. if (!vNode.hasAttr(options.attribute)) {
  18929. this.data({
  18930. messageKey: 'noAttr'
  18931. });
  18932. return false;
  18933. }
  18934. var attribute = vNode.attr(options.attribute);
  18935. var attributeIsEmpty = !sanitize_default(attribute);
  18936. if (attributeIsEmpty) {
  18937. this.data({
  18938. messageKey: 'emptyAttr'
  18939. });
  18940. return false;
  18941. }
  18942. return true;
  18943. }
  18944. var attr_non_space_content_evaluate_default = attrNonSpaceContentEvaluate;
  18945. function pageHasElmAfter(results) {
  18946. var elmUsedAnywhere = results.some(function(frameResult) {
  18947. return frameResult.result === true;
  18948. });
  18949. if (elmUsedAnywhere) {
  18950. results.forEach(function(result) {
  18951. result.result = true;
  18952. });
  18953. }
  18954. return results;
  18955. }
  18956. var has_descendant_after_default = pageHasElmAfter;
  18957. function hasDescendant(node, options, virtualNode) {
  18958. if (!options || !options.selector || typeof options.selector !== 'string') {
  18959. throw new TypeError('has-descendant requires options.selector to be a string');
  18960. }
  18961. if (options.passForModal && is_modal_open_default()) {
  18962. return true;
  18963. }
  18964. var matchingElms = query_selector_all_filter_default(virtualNode, options.selector, function(vNode) {
  18965. return _isVisibleToScreenReaders(vNode);
  18966. });
  18967. this.relatedNodes(matchingElms.map(function(vNode) {
  18968. return vNode.actualNode;
  18969. }));
  18970. return matchingElms.length > 0;
  18971. }
  18972. var has_descendant_evaluate_default = hasDescendant;
  18973. function hasTextContentEvaluate(node, options, virtualNode) {
  18974. try {
  18975. return sanitize_default(subtree_text_default(virtualNode)) !== '';
  18976. } catch (e) {
  18977. return void 0;
  18978. }
  18979. }
  18980. function matchesDefinitionEvaluate(_, options, virtualNode) {
  18981. return matches_default3(virtualNode, options.matcher);
  18982. }
  18983. var matches_definition_evaluate_default = matchesDefinitionEvaluate;
  18984. function pageNoDuplicateAfter(results) {
  18985. return results.filter(function(checkResult) {
  18986. return checkResult.data !== 'ignored';
  18987. });
  18988. }
  18989. var page_no_duplicate_after_default = pageNoDuplicateAfter;
  18990. function pageNoDuplicateEvaluate(node, options, virtualNode) {
  18991. if (!options || !options.selector || typeof options.selector !== 'string') {
  18992. throw new TypeError('page-no-duplicate requires options.selector to be a string');
  18993. }
  18994. var key = 'page-no-duplicate;' + options.selector;
  18995. if (cache_default.get(key)) {
  18996. this.data('ignored');
  18997. return;
  18998. }
  18999. cache_default.set(key, true);
  19000. var elms = query_selector_all_filter_default(axe._tree[0], options.selector, function(elm) {
  19001. return _isVisibleToScreenReaders(elm);
  19002. });
  19003. if (typeof options.nativeScopeFilter === 'string') {
  19004. elms = elms.filter(function(elm) {
  19005. return elm.actualNode.hasAttribute('role') || !find_up_virtual_default(elm, options.nativeScopeFilter);
  19006. });
  19007. }
  19008. this.relatedNodes(elms.filter(function(elm) {
  19009. return elm !== virtualNode;
  19010. }).map(function(elm) {
  19011. return elm.actualNode;
  19012. }));
  19013. return elms.length <= 1;
  19014. }
  19015. var page_no_duplicate_evaluate_default = pageNoDuplicateEvaluate;
  19016. function accesskeysAfter(results) {
  19017. var seen = {};
  19018. return results.filter(function(r) {
  19019. if (!r.data) {
  19020. return false;
  19021. }
  19022. var key = r.data.toUpperCase();
  19023. if (!seen[key]) {
  19024. seen[key] = r;
  19025. r.relatedNodes = [];
  19026. return true;
  19027. }
  19028. seen[key].relatedNodes.push(r.relatedNodes[0]);
  19029. return false;
  19030. }).map(function(r) {
  19031. r.result = !!r.relatedNodes.length;
  19032. return r;
  19033. });
  19034. }
  19035. var accesskeys_after_default = accesskeysAfter;
  19036. function accesskeysEvaluate(node, options, vNode) {
  19037. if (!_isHiddenForEveryone(vNode)) {
  19038. this.data(vNode.attr('accesskey'));
  19039. this.relatedNodes([ node ]);
  19040. }
  19041. return true;
  19042. }
  19043. var accesskeys_evaluate_default = accesskeysEvaluate;
  19044. function focusableContentEvaluate(node, options, virtualNode) {
  19045. var tabbableElements = virtualNode.tabbableElements;
  19046. if (!tabbableElements) {
  19047. return false;
  19048. }
  19049. var tabbableContentElements = tabbableElements.filter(function(el) {
  19050. return el !== virtualNode;
  19051. });
  19052. return tabbableContentElements.length > 0;
  19053. }
  19054. var focusable_content_evaluate_default = focusableContentEvaluate;
  19055. function focusableDisabledEvaluate(node, options, virtualNode) {
  19056. var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ];
  19057. var tabbableElements = virtualNode.tabbableElements;
  19058. if (!tabbableElements || !tabbableElements.length) {
  19059. return true;
  19060. }
  19061. var relatedNodes = tabbableElements.filter(function(vNode) {
  19062. return elementsThatCanBeDisabled.includes(vNode.props.nodeName);
  19063. });
  19064. this.relatedNodes(relatedNodes.map(function(vNode) {
  19065. return vNode.actualNode;
  19066. }));
  19067. if (relatedNodes.length === 0 || is_modal_open_default()) {
  19068. return true;
  19069. }
  19070. return relatedNodes.every(function(vNode) {
  19071. var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events');
  19072. var width = parseInt(vNode.getComputedStylePropertyValue('width'));
  19073. var height = parseInt(vNode.getComputedStylePropertyValue('height'));
  19074. return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none';
  19075. }) ? void 0 : false;
  19076. }
  19077. var focusable_disabled_evaluate_default = focusableDisabledEvaluate;
  19078. function focusableElementEvaluate(node, options, virtualNode) {
  19079. if (virtualNode.hasAttr('contenteditable') && isContenteditable(virtualNode)) {
  19080. return true;
  19081. }
  19082. return _isInTabOrder(virtualNode);
  19083. function isContenteditable(vNode) {
  19084. var contenteditable = vNode.attr('contenteditable');
  19085. if (contenteditable === 'true' || contenteditable === '') {
  19086. return true;
  19087. }
  19088. if (contenteditable === 'false') {
  19089. return false;
  19090. }
  19091. var ancestor = closest_default(virtualNode.parent, '[contenteditable]');
  19092. if (!ancestor) {
  19093. return false;
  19094. }
  19095. return isContenteditable(ancestor);
  19096. }
  19097. }
  19098. var focusable_element_evaluate_default = focusableElementEvaluate;
  19099. function focusableModalOpenEvaluate(node, options, virtualNode) {
  19100. var tabbableElements = virtualNode.tabbableElements.map(function(_ref89) {
  19101. var actualNode = _ref89.actualNode;
  19102. return actualNode;
  19103. });
  19104. if (!tabbableElements || !tabbableElements.length) {
  19105. return true;
  19106. }
  19107. if (is_modal_open_default()) {
  19108. this.relatedNodes(tabbableElements);
  19109. return void 0;
  19110. }
  19111. return true;
  19112. }
  19113. var focusable_modal_open_evaluate_default = focusableModalOpenEvaluate;
  19114. function focusableNoNameEvaluate(node, options, virtualNode) {
  19115. var tabIndex = virtualNode.attr('tabindex');
  19116. var inFocusOrder = _isFocusable(virtualNode) && tabIndex > -1;
  19117. if (!inFocusOrder) {
  19118. return false;
  19119. }
  19120. try {
  19121. return !accessible_text_virtual_default(virtualNode);
  19122. } catch (e) {
  19123. return void 0;
  19124. }
  19125. }
  19126. var focusable_no_name_evaluate_default = focusableNoNameEvaluate;
  19127. function focusableNotTabbableEvaluate(node, options, virtualNode) {
  19128. var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ];
  19129. var tabbableElements = virtualNode.tabbableElements;
  19130. if (!tabbableElements || !tabbableElements.length) {
  19131. return true;
  19132. }
  19133. var relatedNodes = tabbableElements.filter(function(vNode) {
  19134. return !elementsThatCanBeDisabled.includes(vNode.props.nodeName);
  19135. });
  19136. this.relatedNodes(relatedNodes.map(function(vNode) {
  19137. return vNode.actualNode;
  19138. }));
  19139. if (relatedNodes.length === 0 || is_modal_open_default()) {
  19140. return true;
  19141. }
  19142. return relatedNodes.every(function(vNode) {
  19143. var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events');
  19144. var width = parseInt(vNode.getComputedStylePropertyValue('width'));
  19145. var height = parseInt(vNode.getComputedStylePropertyValue('height'));
  19146. return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none';
  19147. }) ? void 0 : false;
  19148. }
  19149. var focusable_not_tabbable_evaluate_default = focusableNotTabbableEvaluate;
  19150. function frameFocusableContentEvaluate(node, options, virtualNode) {
  19151. if (!virtualNode.children) {
  19152. return void 0;
  19153. }
  19154. try {
  19155. return !virtualNode.children.some(function(child) {
  19156. return focusableDescendants(child);
  19157. });
  19158. } catch (e) {
  19159. return void 0;
  19160. }
  19161. }
  19162. function focusableDescendants(vNode) {
  19163. if (_isInTabOrder(vNode)) {
  19164. return true;
  19165. }
  19166. if (!vNode.children) {
  19167. if (vNode.props.nodeType === 1) {
  19168. throw new Error('Cannot determine children');
  19169. }
  19170. return false;
  19171. }
  19172. return vNode.children.some(function(child) {
  19173. return focusableDescendants(child);
  19174. });
  19175. }
  19176. function landmarkIsTopLevelEvaluate(node) {
  19177. var landmarks = get_aria_roles_by_type_default('landmark');
  19178. var parent = get_composed_parent_default(node);
  19179. var nodeRole = get_role_default(node);
  19180. this.data({
  19181. role: nodeRole
  19182. });
  19183. while (parent) {
  19184. var role = parent.getAttribute('role');
  19185. if (!role && parent.nodeName.toUpperCase() !== 'FORM') {
  19186. role = implicit_role_default(parent);
  19187. }
  19188. if (role && landmarks.includes(role) && !(role === 'main' && nodeRole === 'complementary')) {
  19189. return false;
  19190. }
  19191. parent = get_composed_parent_default(parent);
  19192. }
  19193. return true;
  19194. }
  19195. var landmark_is_top_level_evaluate_default = landmarkIsTopLevelEvaluate;
  19196. function noFocusableContentEvaluate(node, options, virtualNode) {
  19197. if (!virtualNode.children) {
  19198. return void 0;
  19199. }
  19200. try {
  19201. var focusableDescendants2 = getFocusableDescendants(virtualNode);
  19202. if (!focusableDescendants2.length) {
  19203. return true;
  19204. }
  19205. var notHiddenElements = focusableDescendants2.filter(usesUnreliableHidingStrategy);
  19206. if (notHiddenElements.length > 0) {
  19207. this.data({
  19208. messageKey: 'notHidden'
  19209. });
  19210. this.relatedNodes(notHiddenElements);
  19211. } else {
  19212. this.relatedNodes(focusableDescendants2);
  19213. }
  19214. return false;
  19215. } catch (e) {
  19216. return void 0;
  19217. }
  19218. }
  19219. function getFocusableDescendants(vNode) {
  19220. if (!vNode.children) {
  19221. if (vNode.props.nodeType === 1) {
  19222. throw new Error('Cannot determine children');
  19223. }
  19224. return [];
  19225. }
  19226. var retVal = [];
  19227. vNode.children.forEach(function(child) {
  19228. if (get_role_type_default(child) === 'widget' && _isFocusable(child)) {
  19229. retVal.push(child);
  19230. } else {
  19231. retVal.push.apply(retVal, _toConsumableArray(getFocusableDescendants(child)));
  19232. }
  19233. });
  19234. return retVal;
  19235. }
  19236. function usesUnreliableHidingStrategy(vNode) {
  19237. var tabIndex = parseInt(vNode.attr('tabindex'), 10);
  19238. return !isNaN(tabIndex) && tabIndex < 0;
  19239. }
  19240. function tabindexEvaluate(node, options, virtualNode) {
  19241. var tabIndex = parseInt(virtualNode.attr('tabindex'), 10);
  19242. return isNaN(tabIndex) ? true : tabIndex <= 0;
  19243. }
  19244. var tabindex_evaluate_default = tabindexEvaluate;
  19245. function altSpaceValueEvaluate(node, options, virtualNode) {
  19246. var alt = virtualNode.attr('alt');
  19247. var isOnlySpace = /^\s+$/;
  19248. return typeof alt === 'string' && isOnlySpace.test(alt);
  19249. }
  19250. var alt_space_value_evaluate_default = altSpaceValueEvaluate;
  19251. function duplicateImgLabelEvaluate(node, options, virtualNode) {
  19252. if ([ 'none', 'presentation' ].includes(get_role_default(virtualNode))) {
  19253. return false;
  19254. }
  19255. var parentVNode = closest_default(virtualNode, options.parentSelector);
  19256. if (!parentVNode) {
  19257. return false;
  19258. }
  19259. var visibleText = visible_virtual_default(parentVNode, true).toLowerCase();
  19260. if (visibleText === '') {
  19261. return false;
  19262. }
  19263. return visibleText === accessible_text_virtual_default(virtualNode).toLowerCase();
  19264. }
  19265. var duplicate_img_label_evaluate_default = duplicateImgLabelEvaluate;
  19266. function explicitEvaluate(node, options, virtualNode) {
  19267. var _this4 = this;
  19268. if (!virtualNode.attr('id')) {
  19269. return false;
  19270. }
  19271. if (!virtualNode.actualNode) {
  19272. return void 0;
  19273. }
  19274. var root = get_root_node_default2(virtualNode.actualNode);
  19275. var id = escape_selector_default(virtualNode.attr('id'));
  19276. var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]')));
  19277. this.relatedNodes(labels);
  19278. if (!labels.length) {
  19279. return false;
  19280. }
  19281. try {
  19282. return labels.some(function(label3) {
  19283. if (!_isVisibleOnScreen(label3)) {
  19284. return true;
  19285. } else {
  19286. var explicitLabel = sanitize_default(accessible_text_default(label3, {
  19287. inControlContext: true,
  19288. startNode: virtualNode
  19289. }));
  19290. _this4.data({
  19291. explicitLabel: explicitLabel
  19292. });
  19293. return !!explicitLabel;
  19294. }
  19295. });
  19296. } catch (e) {
  19297. return void 0;
  19298. }
  19299. }
  19300. var explicit_evaluate_default = explicitEvaluate;
  19301. function helpSameAsLabelEvaluate(node, options, virtualNode) {
  19302. var labelText2 = label_virtual_default2(virtualNode), check = node.getAttribute('title');
  19303. if (!labelText2) {
  19304. return false;
  19305. }
  19306. if (!check) {
  19307. check = '';
  19308. if (node.getAttribute('aria-describedby')) {
  19309. var ref = idrefs_default(node, 'aria-describedby');
  19310. check = ref.map(function(thing) {
  19311. return thing ? accessible_text_default(thing) : '';
  19312. }).join('');
  19313. }
  19314. }
  19315. return sanitize_default(check) === sanitize_default(labelText2);
  19316. }
  19317. var help_same_as_label_evaluate_default = helpSameAsLabelEvaluate;
  19318. function hiddenExplicitLabelEvaluate(node, options, virtualNode) {
  19319. if (virtualNode.hasAttr('id')) {
  19320. if (!virtualNode.actualNode) {
  19321. return void 0;
  19322. }
  19323. var root = get_root_node_default2(node);
  19324. var id = escape_selector_default(node.getAttribute('id'));
  19325. var label3 = root.querySelector('label[for="'.concat(id, '"]'));
  19326. if (label3 && !_isVisibleToScreenReaders(label3)) {
  19327. var name;
  19328. try {
  19329. name = accessible_text_virtual_default(virtualNode).trim();
  19330. } catch (e) {
  19331. return void 0;
  19332. }
  19333. var isNameEmpty = name === '';
  19334. return isNameEmpty;
  19335. }
  19336. }
  19337. return false;
  19338. }
  19339. var hidden_explicit_label_evaluate_default = hiddenExplicitLabelEvaluate;
  19340. function implicitEvaluate(node, options, virtualNode) {
  19341. try {
  19342. var label3 = closest_default(virtualNode, 'label');
  19343. if (label3) {
  19344. var implicitLabel = sanitize_default(accessible_text_virtual_default(label3, {
  19345. inControlContext: true,
  19346. startNode: virtualNode
  19347. }));
  19348. if (label3.actualNode) {
  19349. this.relatedNodes([ label3.actualNode ]);
  19350. }
  19351. this.data({
  19352. implicitLabel: implicitLabel
  19353. });
  19354. return !!implicitLabel;
  19355. }
  19356. return false;
  19357. } catch (e) {
  19358. return void 0;
  19359. }
  19360. }
  19361. var implicit_evaluate_default = implicitEvaluate;
  19362. function isStringContained(compare, compareWith) {
  19363. var curatedCompareWith = curateString(compareWith);
  19364. var curatedCompare = curateString(compare);
  19365. if (!curatedCompareWith || !curatedCompare) {
  19366. return false;
  19367. }
  19368. return curatedCompareWith.includes(curatedCompare);
  19369. }
  19370. function curateString(str) {
  19371. var noUnicodeStr = remove_unicode_default(str, {
  19372. emoji: true,
  19373. nonBmp: true,
  19374. punctuations: true
  19375. });
  19376. return sanitize_default(noUnicodeStr);
  19377. }
  19378. function labelContentNameMismatchEvaluate(node, options, virtualNode) {
  19379. var _options$occurrenceTh;
  19380. var pixelThreshold = options === null || options === void 0 ? void 0 : options.pixelThreshold;
  19381. var occurrenceThreshold = (_options$occurrenceTh = options === null || options === void 0 ? void 0 : options.occurrenceThreshold) !== null && _options$occurrenceTh !== void 0 ? _options$occurrenceTh : options === null || options === void 0 ? void 0 : options.occuranceThreshold;
  19382. var accText = accessible_text_default(node).toLowerCase();
  19383. if (is_human_interpretable_default(accText) < 1) {
  19384. return void 0;
  19385. }
  19386. var visibleText = sanitize_default(subtree_text_default(virtualNode, {
  19387. subtreeDescendant: true,
  19388. ignoreIconLigature: true,
  19389. pixelThreshold: pixelThreshold,
  19390. occurrenceThreshold: occurrenceThreshold
  19391. })).toLowerCase();
  19392. if (!visibleText) {
  19393. return true;
  19394. }
  19395. if (is_human_interpretable_default(visibleText) < 1) {
  19396. if (isStringContained(visibleText, accText)) {
  19397. return true;
  19398. }
  19399. return void 0;
  19400. }
  19401. return isStringContained(visibleText, accText);
  19402. }
  19403. var label_content_name_mismatch_evaluate_default = labelContentNameMismatchEvaluate;
  19404. function multipleLabelEvaluate(node) {
  19405. var id = escape_selector_default(node.getAttribute('id'));
  19406. var parent = node.parentNode;
  19407. var root = get_root_node_default2(node);
  19408. root = root.documentElement || root;
  19409. var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]')));
  19410. if (labels.length) {
  19411. labels = labels.filter(function(label3) {
  19412. return !_isHiddenForEveryone(label3);
  19413. });
  19414. }
  19415. while (parent) {
  19416. if (parent.nodeName.toUpperCase() === 'LABEL' && labels.indexOf(parent) === -1) {
  19417. labels.push(parent);
  19418. }
  19419. parent = parent.parentNode;
  19420. }
  19421. this.relatedNodes(labels);
  19422. if (labels.length > 1) {
  19423. var ATVisibleLabels = labels.filter(function(label3) {
  19424. return _isVisibleToScreenReaders(label3);
  19425. });
  19426. if (ATVisibleLabels.length > 1) {
  19427. return void 0;
  19428. }
  19429. var labelledby = idrefs_default(node, 'aria-labelledby');
  19430. return !labelledby.includes(ATVisibleLabels[0]) ? void 0 : false;
  19431. }
  19432. return false;
  19433. }
  19434. var multiple_label_evaluate_default = multipleLabelEvaluate;
  19435. function titleOnlyEvaluate(node, options, virtualNode) {
  19436. var labelText2 = label_virtual_default2(virtualNode);
  19437. var title = title_text_default(virtualNode);
  19438. var ariaDescribedBy = virtualNode.attr('aria-describedby');
  19439. return !labelText2 && !!(title || ariaDescribedBy);
  19440. }
  19441. var title_only_evaluate_default = titleOnlyEvaluate;
  19442. function landmarkIsUniqueAfter(results) {
  19443. var uniqueLandmarks = [];
  19444. return results.filter(function(currentResult) {
  19445. var findMatch = function findMatch(someResult) {
  19446. return currentResult.data.role === someResult.data.role && currentResult.data.accessibleText === someResult.data.accessibleText;
  19447. };
  19448. var matchedResult = uniqueLandmarks.find(findMatch);
  19449. if (matchedResult) {
  19450. matchedResult.result = false;
  19451. matchedResult.relatedNodes.push(currentResult.relatedNodes[0]);
  19452. return false;
  19453. }
  19454. uniqueLandmarks.push(currentResult);
  19455. currentResult.relatedNodes = [];
  19456. return true;
  19457. });
  19458. }
  19459. var landmark_is_unique_after_default = landmarkIsUniqueAfter;
  19460. function landmarkIsUniqueEvaluate(node, options, virtualNode) {
  19461. var role = get_role_default(node);
  19462. var accessibleText2 = accessible_text_virtual_default(virtualNode);
  19463. accessibleText2 = accessibleText2 ? accessibleText2.toLowerCase() : null;
  19464. this.data({
  19465. role: role,
  19466. accessibleText: accessibleText2
  19467. });
  19468. this.relatedNodes([ node ]);
  19469. return true;
  19470. }
  19471. var landmark_is_unique_evaluate_default = landmarkIsUniqueEvaluate;
  19472. function hasValue(value) {
  19473. return (value || '').trim() !== '';
  19474. }
  19475. function hasLangEvaluate(node, options, virtualNode) {
  19476. var xhtml2 = typeof document !== 'undefined' ? is_xhtml_default(document) : false;
  19477. if (options.attributes.includes('xml:lang') && options.attributes.includes('lang') && hasValue(virtualNode.attr('xml:lang')) && !hasValue(virtualNode.attr('lang')) && !xhtml2) {
  19478. this.data({
  19479. messageKey: 'noXHTML'
  19480. });
  19481. return false;
  19482. }
  19483. var hasLang = options.attributes.some(function(name) {
  19484. return hasValue(virtualNode.attr(name));
  19485. });
  19486. if (!hasLang) {
  19487. this.data({
  19488. messageKey: 'noLang'
  19489. });
  19490. return false;
  19491. }
  19492. return true;
  19493. }
  19494. var has_lang_evaluate_default = hasLangEvaluate;
  19495. function validLangEvaluate(node, options, virtualNode) {
  19496. var invalid = [];
  19497. options.attributes.forEach(function(langAttr) {
  19498. var langVal = virtualNode.attr(langAttr);
  19499. if (typeof langVal !== 'string') {
  19500. return;
  19501. }
  19502. var baselangVal = get_base_lang_default(langVal);
  19503. var invalidLang = options.value ? !options.value.map(get_base_lang_default).includes(baselangVal) : !valid_langs_default(baselangVal);
  19504. if (baselangVal !== '' && invalidLang || langVal !== '' && !sanitize_default(langVal)) {
  19505. invalid.push(langAttr + '="' + virtualNode.attr(langAttr) + '"');
  19506. }
  19507. });
  19508. if (!invalid.length) {
  19509. return false;
  19510. }
  19511. if (virtualNode.props.nodeName !== 'html' && !_hasLangText(virtualNode)) {
  19512. return false;
  19513. }
  19514. this.data(invalid);
  19515. return true;
  19516. }
  19517. var valid_lang_evaluate_default = validLangEvaluate;
  19518. function xmlLangMismatchEvaluate(node, options, vNode) {
  19519. var primaryLangValue = get_base_lang_default(vNode.attr('lang'));
  19520. var primaryXmlLangValue = get_base_lang_default(vNode.attr('xml:lang'));
  19521. return primaryLangValue === primaryXmlLangValue;
  19522. }
  19523. var xml_lang_mismatch_evaluate_default = xmlLangMismatchEvaluate;
  19524. function dlitemEvaluate(node) {
  19525. var parent = get_composed_parent_default(node);
  19526. var parentTagName = parent.nodeName.toUpperCase();
  19527. var parentRole = get_explicit_role_default(parent);
  19528. if (parentTagName === 'DIV' && [ 'presentation', 'none', null ].includes(parentRole)) {
  19529. parent = get_composed_parent_default(parent);
  19530. parentTagName = parent.nodeName.toUpperCase();
  19531. parentRole = get_explicit_role_default(parent);
  19532. }
  19533. if (parentTagName !== 'DL') {
  19534. return false;
  19535. }
  19536. if (!parentRole || [ 'presentation', 'none', 'list' ].includes(parentRole)) {
  19537. return true;
  19538. }
  19539. return false;
  19540. }
  19541. var dlitem_evaluate_default = dlitemEvaluate;
  19542. function invalidChildrenEvaluate(node) {
  19543. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19544. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  19545. var relatedNodes = [];
  19546. var issues = [];
  19547. if (!virtualNode.children) {
  19548. return void 0;
  19549. }
  19550. var vChildren = mapWithNested(virtualNode.children);
  19551. while (vChildren.length) {
  19552. var _vChild$actualNode;
  19553. var _vChildren$shift = vChildren.shift(), vChild = _vChildren$shift.vChild, nested = _vChildren$shift.nested;
  19554. if (options.divGroups && !nested && isDivGroup(vChild)) {
  19555. if (!vChild.children) {
  19556. return void 0;
  19557. }
  19558. var vGrandChildren = mapWithNested(vChild.children, true);
  19559. vChildren.push.apply(vChildren, _toConsumableArray(vGrandChildren));
  19560. continue;
  19561. }
  19562. var issue = getInvalidSelector(vChild, nested, options);
  19563. if (!issue) {
  19564. continue;
  19565. }
  19566. if (!issues.includes(issue)) {
  19567. issues.push(issue);
  19568. }
  19569. if ((vChild === null || vChild === void 0 ? void 0 : (_vChild$actualNode = vChild.actualNode) === null || _vChild$actualNode === void 0 ? void 0 : _vChild$actualNode.nodeType) === 1) {
  19570. relatedNodes.push(vChild.actualNode);
  19571. }
  19572. }
  19573. if (issues.length === 0) {
  19574. return false;
  19575. }
  19576. this.data({
  19577. values: issues.join(', ')
  19578. });
  19579. this.relatedNodes(relatedNodes);
  19580. return true;
  19581. }
  19582. function getInvalidSelector(vChild, nested, _ref90) {
  19583. var _ref90$validRoles = _ref90.validRoles, validRoles = _ref90$validRoles === void 0 ? [] : _ref90$validRoles, _ref90$validNodeNames = _ref90.validNodeNames, validNodeNames = _ref90$validNodeNames === void 0 ? [] : _ref90$validNodeNames;
  19584. var _vChild$props = vChild.props, nodeName2 = _vChild$props.nodeName, nodeType = _vChild$props.nodeType, nodeValue = _vChild$props.nodeValue;
  19585. var selector = nested ? 'div > ' : '';
  19586. if (nodeType === 3 && nodeValue.trim() !== '') {
  19587. return selector + '#text';
  19588. }
  19589. if (nodeType !== 1 || !_isVisibleToScreenReaders(vChild)) {
  19590. return false;
  19591. }
  19592. var role = get_explicit_role_default(vChild);
  19593. if (role) {
  19594. return validRoles.includes(role) ? false : selector + '[role='.concat(role, ']');
  19595. } else {
  19596. return validNodeNames.includes(nodeName2) ? false : selector + nodeName2;
  19597. }
  19598. }
  19599. function isDivGroup(vNode) {
  19600. return vNode.props.nodeName === 'div' && get_explicit_role_default(vNode) === null;
  19601. }
  19602. function mapWithNested(vNodes) {
  19603. var nested = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  19604. return vNodes.map(function(vChild) {
  19605. return {
  19606. vChild: vChild,
  19607. nested: nested
  19608. };
  19609. });
  19610. }
  19611. function listitemEvaluate(node, options, virtualNode) {
  19612. var parent = virtualNode.parent;
  19613. if (!parent) {
  19614. return void 0;
  19615. }
  19616. var parentNodeName = parent.props.nodeName;
  19617. var parentRole = get_explicit_role_default(parent);
  19618. if ([ 'presentation', 'none', 'list' ].includes(parentRole)) {
  19619. return true;
  19620. }
  19621. if (parentRole && is_valid_role_default(parentRole)) {
  19622. this.data({
  19623. messageKey: 'roleNotValid'
  19624. });
  19625. return false;
  19626. }
  19627. return [ 'ul', 'ol', 'menu' ].includes(parentNodeName);
  19628. }
  19629. function onlyDlitemsEvaluate(node, options, virtualNode) {
  19630. var ALLOWED_ROLES = [ 'definition', 'term', 'list' ];
  19631. var base = {
  19632. badNodes: [],
  19633. hasNonEmptyTextNode: false
  19634. };
  19635. var content = virtualNode.children.reduce(function(content2, child) {
  19636. var actualNode = child.actualNode;
  19637. if (actualNode.nodeName.toUpperCase() === 'DIV' && get_role_default(actualNode) === null) {
  19638. return content2.concat(child.children);
  19639. }
  19640. return content2.concat(child);
  19641. }, []);
  19642. var result = content.reduce(function(out, childNode) {
  19643. var actualNode = childNode.actualNode;
  19644. var tagName = actualNode.nodeName.toUpperCase();
  19645. if (actualNode.nodeType === 1 && _isVisibleToScreenReaders(actualNode)) {
  19646. var explicitRole2 = get_explicit_role_default(actualNode);
  19647. if (tagName !== 'DT' && tagName !== 'DD' || explicitRole2) {
  19648. if (!ALLOWED_ROLES.includes(explicitRole2)) {
  19649. out.badNodes.push(actualNode);
  19650. }
  19651. }
  19652. } else if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') {
  19653. out.hasNonEmptyTextNode = true;
  19654. }
  19655. return out;
  19656. }, base);
  19657. if (result.badNodes.length) {
  19658. this.relatedNodes(result.badNodes);
  19659. }
  19660. return !!result.badNodes.length || result.hasNonEmptyTextNode;
  19661. }
  19662. var only_dlitems_evaluate_default = onlyDlitemsEvaluate;
  19663. function onlyListitemsEvaluate(node, options, virtualNode) {
  19664. var hasNonEmptyTextNode = false;
  19665. var atLeastOneListitem = false;
  19666. var isEmpty = true;
  19667. var badNodes = [];
  19668. var badRoleNodes = [];
  19669. var badRoles = [];
  19670. virtualNode.children.forEach(function(vNode) {
  19671. var actualNode = vNode.actualNode;
  19672. if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') {
  19673. hasNonEmptyTextNode = true;
  19674. return;
  19675. }
  19676. if (actualNode.nodeType !== 1 || !_isVisibleToScreenReaders(actualNode)) {
  19677. return;
  19678. }
  19679. isEmpty = false;
  19680. var isLi = actualNode.nodeName.toUpperCase() === 'LI';
  19681. var role = get_role_default(vNode);
  19682. var isListItemRole = role === 'listitem';
  19683. if (!isLi && !isListItemRole) {
  19684. badNodes.push(actualNode);
  19685. }
  19686. if (isLi && !isListItemRole) {
  19687. badRoleNodes.push(actualNode);
  19688. if (!badRoles.includes(role)) {
  19689. badRoles.push(role);
  19690. }
  19691. }
  19692. if (isListItemRole) {
  19693. atLeastOneListitem = true;
  19694. }
  19695. });
  19696. if (hasNonEmptyTextNode || badNodes.length) {
  19697. this.relatedNodes(badNodes);
  19698. return true;
  19699. }
  19700. if (isEmpty || atLeastOneListitem) {
  19701. return false;
  19702. }
  19703. this.relatedNodes(badRoleNodes);
  19704. this.data({
  19705. messageKey: 'roleNotValid',
  19706. roles: badRoles.join(', ')
  19707. });
  19708. return true;
  19709. }
  19710. var only_listitems_evaluate_default = onlyListitemsEvaluate;
  19711. function structuredDlitemsEvaluate(node, options, virtualNode) {
  19712. var children = virtualNode.children;
  19713. if (!children || !children.length) {
  19714. return false;
  19715. }
  19716. var hasDt = false, hasDd = false, nodeName2;
  19717. for (var i = 0; i < children.length; i++) {
  19718. nodeName2 = children[i].props.nodeName.toUpperCase();
  19719. if (nodeName2 === 'DT') {
  19720. hasDt = true;
  19721. }
  19722. if (hasDt && nodeName2 === 'DD') {
  19723. return false;
  19724. }
  19725. if (nodeName2 === 'DD') {
  19726. hasDd = true;
  19727. }
  19728. }
  19729. return hasDt || hasDd;
  19730. }
  19731. var structured_dlitems_evaluate_default = structuredDlitemsEvaluate;
  19732. function captionEvaluate(node, options, virtualNode) {
  19733. var tracks = query_selector_all_default(virtualNode, 'track');
  19734. var hasCaptions = tracks.some(function(vNode) {
  19735. return (vNode.attr('kind') || '').toLowerCase() === 'captions';
  19736. });
  19737. return hasCaptions ? false : void 0;
  19738. }
  19739. var caption_evaluate_default = captionEvaluate;
  19740. var joinStr = ' > ';
  19741. function frameTestedAfter(results) {
  19742. var iframes = {};
  19743. return results.filter(function(result) {
  19744. var frameResult = result.node.ancestry[result.node.ancestry.length - 1] !== 'html';
  19745. if (frameResult) {
  19746. var ancestry2 = result.node.ancestry.flat(Infinity).join(joinStr);
  19747. iframes[ancestry2] = result;
  19748. return true;
  19749. }
  19750. var ancestry = result.node.ancestry.slice(0, result.node.ancestry.length - 1).flat(Infinity).join(joinStr);
  19751. if (iframes[ancestry]) {
  19752. iframes[ancestry].result = true;
  19753. }
  19754. return false;
  19755. });
  19756. }
  19757. var frame_tested_after_default = frameTestedAfter;
  19758. function frameTestedEvaluate(node, options) {
  19759. return options.isViolation ? false : void 0;
  19760. }
  19761. var frame_tested_evaluate_default = frameTestedEvaluate;
  19762. function noAutoplayAudioEvaluate(node, options) {
  19763. if (!node.duration) {
  19764. console.warn('axe.utils.preloadMedia did not load metadata');
  19765. return void 0;
  19766. }
  19767. var _options$allowedDurat = options.allowedDuration, allowedDuration = _options$allowedDurat === void 0 ? 3 : _options$allowedDurat;
  19768. var playableDuration = getPlayableDuration(node);
  19769. if (playableDuration <= allowedDuration && !node.hasAttribute('loop')) {
  19770. return true;
  19771. }
  19772. if (!node.hasAttribute('controls')) {
  19773. return false;
  19774. }
  19775. return true;
  19776. function getPlayableDuration(elm) {
  19777. if (!elm.currentSrc) {
  19778. return 0;
  19779. }
  19780. var playbackRange = getPlaybackRange(elm.currentSrc);
  19781. if (!playbackRange) {
  19782. return Math.abs(elm.duration - (elm.currentTime || 0));
  19783. }
  19784. if (playbackRange.length === 1) {
  19785. return Math.abs(elm.duration - playbackRange[0]);
  19786. }
  19787. return Math.abs(playbackRange[1] - playbackRange[0]);
  19788. }
  19789. function getPlaybackRange(src) {
  19790. var match = src.match(/#t=(.*)/);
  19791. if (!match) {
  19792. return;
  19793. }
  19794. var _match = _slicedToArray(match, 2), value = _match[1];
  19795. var ranges = value.split(',');
  19796. return ranges.map(function(range) {
  19797. if (/:/.test(range)) {
  19798. return convertHourMinSecToSeconds(range);
  19799. }
  19800. return parseFloat(range);
  19801. });
  19802. }
  19803. function convertHourMinSecToSeconds(hhMmSs) {
  19804. var parts = hhMmSs.split(':');
  19805. var secs = 0;
  19806. var mins = 1;
  19807. while (parts.length > 0) {
  19808. secs += mins * parseInt(parts.pop(), 10);
  19809. mins *= 60;
  19810. }
  19811. return parseFloat(secs);
  19812. }
  19813. }
  19814. var no_autoplay_audio_evaluate_default = noAutoplayAudioEvaluate;
  19815. function cssOrientationLockEvaluate(node, options, virtualNode, context) {
  19816. var _ref91 = context || {}, _ref91$cssom = _ref91.cssom, cssom = _ref91$cssom === void 0 ? void 0 : _ref91$cssom;
  19817. var _ref92 = options || {}, _ref92$degreeThreshol = _ref92.degreeThreshold, degreeThreshold = _ref92$degreeThreshol === void 0 ? 0 : _ref92$degreeThreshol;
  19818. if (!cssom || !cssom.length) {
  19819. return void 0;
  19820. }
  19821. var isLocked = false;
  19822. var relatedElements = [];
  19823. var rulesGroupByDocumentFragment = groupCssomByDocument(cssom);
  19824. var _loop7 = function _loop7() {
  19825. var key = _Object$keys2[_i27];
  19826. var _rulesGroupByDocument = rulesGroupByDocumentFragment[key], root = _rulesGroupByDocument.root, rules = _rulesGroupByDocument.rules;
  19827. var orientationRules = rules.filter(isMediaRuleWithOrientation);
  19828. if (!orientationRules.length) {
  19829. return 'continue';
  19830. }
  19831. orientationRules.forEach(function(_ref93) {
  19832. var cssRules = _ref93.cssRules;
  19833. Array.from(cssRules).forEach(function(cssRule) {
  19834. var locked = getIsOrientationLocked(cssRule);
  19835. if (locked && cssRule.selectorText.toUpperCase() !== 'HTML') {
  19836. var elms = Array.from(root.querySelectorAll(cssRule.selectorText)) || [];
  19837. relatedElements = relatedElements.concat(elms);
  19838. }
  19839. isLocked = isLocked || locked;
  19840. });
  19841. });
  19842. };
  19843. for (var _i27 = 0, _Object$keys2 = Object.keys(rulesGroupByDocumentFragment); _i27 < _Object$keys2.length; _i27++) {
  19844. var _ret4 = _loop7();
  19845. if (_ret4 === 'continue') {
  19846. continue;
  19847. }
  19848. }
  19849. if (!isLocked) {
  19850. return true;
  19851. }
  19852. if (relatedElements.length) {
  19853. this.relatedNodes(relatedElements);
  19854. }
  19855. return false;
  19856. function groupCssomByDocument(cssObjectModel) {
  19857. return cssObjectModel.reduce(function(out, _ref94) {
  19858. var sheet = _ref94.sheet, root = _ref94.root, shadowId = _ref94.shadowId;
  19859. var key = shadowId ? shadowId : 'topDocument';
  19860. if (!out[key]) {
  19861. out[key] = {
  19862. root: root,
  19863. rules: []
  19864. };
  19865. }
  19866. if (!sheet || !sheet.cssRules) {
  19867. return out;
  19868. }
  19869. var rules = Array.from(sheet.cssRules);
  19870. out[key].rules = out[key].rules.concat(rules);
  19871. return out;
  19872. }, {});
  19873. }
  19874. function isMediaRuleWithOrientation(_ref95) {
  19875. var type = _ref95.type, cssText = _ref95.cssText;
  19876. if (type !== 4) {
  19877. return false;
  19878. }
  19879. return /orientation:\s*landscape/i.test(cssText) || /orientation:\s*portrait/i.test(cssText);
  19880. }
  19881. function getIsOrientationLocked(_ref96) {
  19882. var selectorText = _ref96.selectorText, style = _ref96.style;
  19883. if (!selectorText || style.length <= 0) {
  19884. return false;
  19885. }
  19886. var transformStyle = style.transform || style.webkitTransform || style.msTransform || false;
  19887. if (!transformStyle && !style.rotate) {
  19888. return false;
  19889. }
  19890. var transformDegrees = getTransformDegrees(transformStyle);
  19891. var rotateDegrees = getRotationInDegrees('rotate', style.rotate);
  19892. var degrees = transformDegrees + rotateDegrees;
  19893. if (!degrees) {
  19894. return false;
  19895. }
  19896. degrees = Math.abs(degrees);
  19897. if (Math.abs(degrees - 180) % 180 <= degreeThreshold) {
  19898. return false;
  19899. }
  19900. return Math.abs(degrees - 90) % 90 <= degreeThreshold;
  19901. }
  19902. function getTransformDegrees(transformStyle) {
  19903. if (!transformStyle) {
  19904. return 0;
  19905. }
  19906. var matches4 = transformStyle.match(/(rotate|rotateZ|rotate3d|matrix|matrix3d)\(([^)]+)\)(?!.*(rotate|rotateZ|rotate3d|matrix|matrix3d))/);
  19907. if (!matches4) {
  19908. return 0;
  19909. }
  19910. var _matches = _slicedToArray(matches4, 3), transformFn = _matches[1], transformFnValue = _matches[2];
  19911. return getRotationInDegrees(transformFn, transformFnValue);
  19912. }
  19913. function getRotationInDegrees(transformFunction, transformFnValue) {
  19914. switch (transformFunction) {
  19915. case 'rotate':
  19916. case 'rotateZ':
  19917. return getAngleInDegrees(transformFnValue);
  19918. case 'rotate3d':
  19919. var _transformFnValue$spl = transformFnValue.split(',').map(function(value) {
  19920. return value.trim();
  19921. }), _transformFnValue$spl2 = _slicedToArray(_transformFnValue$spl, 4), z = _transformFnValue$spl2[2], angleWithUnit = _transformFnValue$spl2[3];
  19922. if (parseInt(z) === 0) {
  19923. return;
  19924. }
  19925. return getAngleInDegrees(angleWithUnit);
  19926. case 'matrix':
  19927. case 'matrix3d':
  19928. return getAngleInDegreesFromMatrixTransform(transformFnValue);
  19929. default:
  19930. return 0;
  19931. }
  19932. }
  19933. function getAngleInDegrees(angleWithUnit) {
  19934. var _ref97 = angleWithUnit.match(/(deg|grad|rad|turn)/) || [], _ref98 = _slicedToArray(_ref97, 1), unit = _ref98[0];
  19935. if (!unit) {
  19936. return 0;
  19937. }
  19938. var angle = parseFloat(angleWithUnit.replace(unit, ''));
  19939. switch (unit) {
  19940. case 'rad':
  19941. return convertRadToDeg(angle);
  19942. case 'grad':
  19943. return convertGradToDeg(angle);
  19944. case 'turn':
  19945. return convertTurnToDeg(angle);
  19946. case 'deg':
  19947. default:
  19948. return parseInt(angle);
  19949. }
  19950. }
  19951. function getAngleInDegreesFromMatrixTransform(transformFnValue) {
  19952. var values = transformFnValue.split(',');
  19953. if (values.length <= 6) {
  19954. var _values = _slicedToArray(values, 2), a = _values[0], b2 = _values[1];
  19955. var radians = Math.atan2(parseFloat(b2), parseFloat(a));
  19956. return convertRadToDeg(radians);
  19957. }
  19958. var sinB = parseFloat(values[8]);
  19959. var b = Math.asin(sinB);
  19960. var cosB = Math.cos(b);
  19961. var rotateZRadians = Math.acos(parseFloat(values[0]) / cosB);
  19962. return convertRadToDeg(rotateZRadians);
  19963. }
  19964. function convertRadToDeg(radians) {
  19965. return Math.round(radians * (180 / Math.PI));
  19966. }
  19967. function convertGradToDeg(grad) {
  19968. grad = grad % 400;
  19969. if (grad < 0) {
  19970. grad += 400;
  19971. }
  19972. return Math.round(grad / 400 * 360);
  19973. }
  19974. function convertTurnToDeg(turn) {
  19975. return Math.round(360 / (1 / turn));
  19976. }
  19977. }
  19978. var css_orientation_lock_evaluate_default = cssOrientationLockEvaluate;
  19979. function metaViewportScaleEvaluate(node, options, virtualNode) {
  19980. var _ref99 = options || {}, _ref99$scaleMinimum = _ref99.scaleMinimum, scaleMinimum = _ref99$scaleMinimum === void 0 ? 2 : _ref99$scaleMinimum, _ref99$lowerBound = _ref99.lowerBound, lowerBound = _ref99$lowerBound === void 0 ? false : _ref99$lowerBound;
  19981. var content = virtualNode.attr('content') || '';
  19982. if (!content) {
  19983. return true;
  19984. }
  19985. var result = content.split(/[;,]/).reduce(function(out, item) {
  19986. var contentValue = item.trim();
  19987. if (!contentValue) {
  19988. return out;
  19989. }
  19990. var _contentValue$split = contentValue.split('='), _contentValue$split2 = _slicedToArray(_contentValue$split, 2), key = _contentValue$split2[0], value = _contentValue$split2[1];
  19991. if (!key || !value) {
  19992. return out;
  19993. }
  19994. var curatedKey = key.toLowerCase().trim();
  19995. var curatedValue = value.toLowerCase().trim();
  19996. if (curatedKey === 'maximum-scale' && curatedValue === 'yes') {
  19997. curatedValue = 1;
  19998. }
  19999. if (curatedKey === 'maximum-scale' && parseFloat(curatedValue) < 0) {
  20000. return out;
  20001. }
  20002. out[curatedKey] = curatedValue;
  20003. return out;
  20004. }, {});
  20005. if (lowerBound && result['maximum-scale'] && parseFloat(result['maximum-scale']) < lowerBound) {
  20006. return true;
  20007. }
  20008. if (!lowerBound && result['user-scalable'] === 'no') {
  20009. this.data('user-scalable=no');
  20010. return false;
  20011. }
  20012. var userScalableAsFloat = parseFloat(result['user-scalable']);
  20013. if (!lowerBound && result['user-scalable'] && (userScalableAsFloat || userScalableAsFloat === 0) && userScalableAsFloat > -1 && userScalableAsFloat < 1) {
  20014. this.data('user-scalable');
  20015. return false;
  20016. }
  20017. if (result['maximum-scale'] && parseFloat(result['maximum-scale']) < scaleMinimum) {
  20018. this.data('maximum-scale');
  20019. return false;
  20020. }
  20021. return true;
  20022. }
  20023. var meta_viewport_scale_evaluate_default = metaViewportScaleEvaluate;
  20024. var roundingMargin = .05;
  20025. function targetOffsetEvaluate(node, options, vNode) {
  20026. var minOffset = (options === null || options === void 0 ? void 0 : options.minOffset) || 24;
  20027. var closeNeighbors = [];
  20028. var closestOffset = minOffset;
  20029. var _iterator9 = _createForOfIteratorHelper(_findNearbyElms(vNode, minOffset)), _step9;
  20030. try {
  20031. for (_iterator9.s(); !(_step9 = _iterator9.n()).done; ) {
  20032. var vNeighbor = _step9.value;
  20033. if (get_role_type_default(vNeighbor) !== 'widget' || !_isFocusable(vNeighbor)) {
  20034. continue;
  20035. }
  20036. var offset = roundToSingleDecimal(_getOffset(vNode, vNeighbor));
  20037. if (offset + roundingMargin >= minOffset) {
  20038. continue;
  20039. }
  20040. closestOffset = Math.min(closestOffset, offset);
  20041. closeNeighbors.push(vNeighbor);
  20042. }
  20043. } catch (err) {
  20044. _iterator9.e(err);
  20045. } finally {
  20046. _iterator9.f();
  20047. }
  20048. if (closeNeighbors.length === 0) {
  20049. this.data({
  20050. closestOffset: closestOffset,
  20051. minOffset: minOffset
  20052. });
  20053. return true;
  20054. }
  20055. this.relatedNodes(closeNeighbors.map(function(_ref100) {
  20056. var actualNode = _ref100.actualNode;
  20057. return actualNode;
  20058. }));
  20059. if (!closeNeighbors.some(_isInTabOrder)) {
  20060. this.data({
  20061. messageKey: 'nonTabbableNeighbor',
  20062. closestOffset: closestOffset,
  20063. minOffset: minOffset
  20064. });
  20065. return void 0;
  20066. }
  20067. this.data({
  20068. closestOffset: closestOffset,
  20069. minOffset: minOffset
  20070. });
  20071. return _isInTabOrder(vNode) ? false : void 0;
  20072. }
  20073. function roundToSingleDecimal(num) {
  20074. return Math.round(num * 10) / 10;
  20075. }
  20076. var roundingMargin2 = .05;
  20077. function targetSize(node, options, vNode) {
  20078. var minSize = (options === null || options === void 0 ? void 0 : options.minSize) || 24;
  20079. var nodeRect = vNode.boundingClientRect;
  20080. var hasMinimumSize = rectHasMinimumSize.bind(null, minSize);
  20081. var nearbyElms = _findNearbyElms(vNode);
  20082. var overflowingContent = filterOverflowingContent(vNode, nearbyElms);
  20083. var _filterByElmsOverlap = filterByElmsOverlap(vNode, nearbyElms), fullyObscuringElms = _filterByElmsOverlap.fullyObscuringElms, partialObscuringElms = _filterByElmsOverlap.partialObscuringElms;
  20084. if (fullyObscuringElms.length && !overflowingContent.length) {
  20085. this.relatedNodes(mapActualNodes(fullyObscuringElms));
  20086. this.data({
  20087. messageKey: 'obscured'
  20088. });
  20089. return true;
  20090. }
  20091. var negativeOutcome = _isInTabOrder(vNode) ? false : void 0;
  20092. if (!hasMinimumSize(nodeRect) && !overflowingContent.length) {
  20093. this.data(_extends({
  20094. minSize: minSize
  20095. }, toDecimalSize(nodeRect)));
  20096. return negativeOutcome;
  20097. }
  20098. var obscuredWidgets = filterFocusableWidgets(partialObscuringElms);
  20099. var largestInnerRect = getLargestUnobscuredArea(vNode, obscuredWidgets);
  20100. if (overflowingContent.length) {
  20101. if (fullyObscuringElms.length || !hasMinimumSize(largestInnerRect || nodeRect)) {
  20102. this.data({
  20103. minSize: minSize,
  20104. messageKey: 'contentOverflow'
  20105. });
  20106. this.relatedNodes(mapActualNodes(overflowingContent));
  20107. return void 0;
  20108. }
  20109. }
  20110. if (obscuredWidgets.length !== 0 && !hasMinimumSize(largestInnerRect)) {
  20111. var allTabbable = obscuredWidgets.every(_isInTabOrder);
  20112. var messageKey = 'partiallyObscured'.concat(allTabbable ? '' : 'NonTabbable');
  20113. this.data(_extends({
  20114. messageKey: messageKey,
  20115. minSize: minSize
  20116. }, toDecimalSize(largestInnerRect)));
  20117. this.relatedNodes(mapActualNodes(obscuredWidgets));
  20118. return allTabbable ? negativeOutcome : void 0;
  20119. }
  20120. this.data(_extends({
  20121. minSize: minSize
  20122. }, toDecimalSize(largestInnerRect || nodeRect)));
  20123. this.relatedNodes(mapActualNodes(obscuredWidgets));
  20124. return true;
  20125. }
  20126. function filterOverflowingContent(vNode, nearbyElms) {
  20127. return nearbyElms.filter(function(nearbyElm) {
  20128. return !isEnclosedRect(nearbyElm, vNode) && isDescendantNotInTabOrder(vNode, nearbyElm);
  20129. });
  20130. }
  20131. function filterByElmsOverlap(vNode, nearbyElms) {
  20132. var fullyObscuringElms = [];
  20133. var partialObscuringElms = [];
  20134. var _iterator10 = _createForOfIteratorHelper(nearbyElms), _step10;
  20135. try {
  20136. for (_iterator10.s(); !(_step10 = _iterator10.n()).done; ) {
  20137. var vNeighbor = _step10.value;
  20138. if (!isDescendantNotInTabOrder(vNode, vNeighbor) && _hasVisualOverlap(vNode, vNeighbor) && getCssPointerEvents(vNeighbor) !== 'none') {
  20139. if (isEnclosedRect(vNode, vNeighbor)) {
  20140. fullyObscuringElms.push(vNeighbor);
  20141. } else {
  20142. partialObscuringElms.push(vNeighbor);
  20143. }
  20144. }
  20145. }
  20146. } catch (err) {
  20147. _iterator10.e(err);
  20148. } finally {
  20149. _iterator10.f();
  20150. }
  20151. return {
  20152. fullyObscuringElms: fullyObscuringElms,
  20153. partialObscuringElms: partialObscuringElms
  20154. };
  20155. }
  20156. function getLargestUnobscuredArea(vNode, obscuredNodes) {
  20157. var nodeRect = vNode.boundingClientRect;
  20158. if (obscuredNodes.length === 0) {
  20159. return null;
  20160. }
  20161. var obscuringRects = obscuredNodes.map(function(_ref101) {
  20162. var rect = _ref101.boundingClientRect;
  20163. return rect;
  20164. });
  20165. var unobscuredRects = _splitRects(nodeRect, obscuringRects);
  20166. return getLargestRect(unobscuredRects);
  20167. }
  20168. function getLargestRect(rects, minSize) {
  20169. return rects.reduce(function(rectA, rectB) {
  20170. var rectAisMinimum = rectHasMinimumSize(minSize, rectA);
  20171. var rectBisMinimum = rectHasMinimumSize(minSize, rectB);
  20172. if (rectAisMinimum !== rectBisMinimum) {
  20173. return rectAisMinimum ? rectA : rectB;
  20174. }
  20175. var areaA = rectA.width * rectA.height;
  20176. var areaB = rectB.width * rectB.height;
  20177. return areaA > areaB ? rectA : rectB;
  20178. });
  20179. }
  20180. function filterFocusableWidgets(vNodes) {
  20181. return vNodes.filter(function(vNode) {
  20182. return get_role_type_default(vNode) === 'widget' && _isFocusable(vNode);
  20183. });
  20184. }
  20185. function isEnclosedRect(vNodeA, vNodeB) {
  20186. var rectA = vNodeA.boundingClientRect;
  20187. var rectB = vNodeB.boundingClientRect;
  20188. return rectA.top >= rectB.top && rectA.left >= rectB.left && rectA.bottom <= rectB.bottom && rectA.right <= rectB.right;
  20189. }
  20190. function getCssPointerEvents(vNode) {
  20191. return vNode.getComputedStylePropertyValue('pointer-events');
  20192. }
  20193. function toDecimalSize(rect) {
  20194. return {
  20195. width: Math.round(rect.width * 10) / 10,
  20196. height: Math.round(rect.height * 10) / 10
  20197. };
  20198. }
  20199. function isDescendantNotInTabOrder(vAncestor, vNode) {
  20200. return vAncestor.actualNode.contains(vNode.actualNode) && !_isInTabOrder(vNode);
  20201. }
  20202. function rectHasMinimumSize(minSize, _ref102) {
  20203. var width = _ref102.width, height = _ref102.height;
  20204. return width + roundingMargin2 >= minSize && height + roundingMargin2 >= minSize;
  20205. }
  20206. function mapActualNodes(vNodes) {
  20207. return vNodes.map(function(_ref103) {
  20208. var actualNode = _ref103.actualNode;
  20209. return actualNode;
  20210. });
  20211. }
  20212. function headingOrderAfter(results) {
  20213. var headingOrder = getHeadingOrder(results);
  20214. results.forEach(function(result) {
  20215. result.result = getHeadingOrderOutcome(result, headingOrder);
  20216. });
  20217. return results;
  20218. }
  20219. function getHeadingOrderOutcome(result, headingOrder) {
  20220. var _headingOrder$index$l, _headingOrder$index, _headingOrder$level, _headingOrder;
  20221. var index = findHeadingOrderIndex(headingOrder, result.node.ancestry);
  20222. var currLevel = (_headingOrder$index$l = (_headingOrder$index = headingOrder[index]) === null || _headingOrder$index === void 0 ? void 0 : _headingOrder$index.level) !== null && _headingOrder$index$l !== void 0 ? _headingOrder$index$l : -1;
  20223. var prevLevel = (_headingOrder$level = (_headingOrder = headingOrder[index - 1]) === null || _headingOrder === void 0 ? void 0 : _headingOrder.level) !== null && _headingOrder$level !== void 0 ? _headingOrder$level : -1;
  20224. if (index === 0) {
  20225. return true;
  20226. }
  20227. if (currLevel === -1) {
  20228. return void 0;
  20229. }
  20230. return currLevel - prevLevel <= 1;
  20231. }
  20232. function getHeadingOrder(results) {
  20233. results = _toConsumableArray(results);
  20234. results.sort(function(_ref104, _ref105) {
  20235. var nodeA = _ref104.node;
  20236. var nodeB = _ref105.node;
  20237. return nodeA.ancestry.length - nodeB.ancestry.length;
  20238. });
  20239. var headingOrder = results.reduce(mergeHeadingOrder, []);
  20240. return headingOrder.filter(function(_ref106) {
  20241. var level = _ref106.level;
  20242. return level !== -1;
  20243. });
  20244. }
  20245. function mergeHeadingOrder(mergedHeadingOrder, result) {
  20246. var _result$data;
  20247. var frameHeadingOrder = (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.headingOrder;
  20248. var frameAncestry = shortenArray(result.node.ancestry, 1);
  20249. if (!frameHeadingOrder) {
  20250. return mergedHeadingOrder;
  20251. }
  20252. var normalizedHeadingOrder = frameHeadingOrder.map(function(heading) {
  20253. return addFrameToHeadingAncestry(heading, frameAncestry);
  20254. });
  20255. var index = getFrameIndex(mergedHeadingOrder, frameAncestry);
  20256. if (index === -1) {
  20257. mergedHeadingOrder.push.apply(mergedHeadingOrder, _toConsumableArray(normalizedHeadingOrder));
  20258. } else {
  20259. mergedHeadingOrder.splice.apply(mergedHeadingOrder, [ index, 0 ].concat(_toConsumableArray(normalizedHeadingOrder)));
  20260. }
  20261. return mergedHeadingOrder;
  20262. }
  20263. function getFrameIndex(headingOrder, frameAncestry) {
  20264. while (frameAncestry.length) {
  20265. var index = findHeadingOrderIndex(headingOrder, frameAncestry);
  20266. if (index !== -1) {
  20267. return index;
  20268. }
  20269. frameAncestry = shortenArray(frameAncestry, 1);
  20270. }
  20271. return -1;
  20272. }
  20273. function findHeadingOrderIndex(headingOrder, ancestry) {
  20274. return headingOrder.findIndex(function(heading) {
  20275. return match_ancestry_default(heading.ancestry, ancestry);
  20276. });
  20277. }
  20278. function addFrameToHeadingAncestry(heading, frameAncestry) {
  20279. var ancestry = frameAncestry.concat(heading.ancestry);
  20280. return _extends({}, heading, {
  20281. ancestry: ancestry
  20282. });
  20283. }
  20284. function shortenArray(arr, spliceLength) {
  20285. return arr.slice(0, arr.length - spliceLength);
  20286. }
  20287. function getLevel(vNode) {
  20288. var role = get_role_default(vNode);
  20289. var headingRole = role && role.includes('heading');
  20290. var ariaHeadingLevel = vNode.attr('aria-level');
  20291. var ariaLevel = parseInt(ariaHeadingLevel, 10);
  20292. var _ref107 = vNode.props.nodeName.match(/h(\d)/) || [], _ref108 = _slicedToArray(_ref107, 2), headingLevel = _ref108[1];
  20293. if (!headingRole) {
  20294. return -1;
  20295. }
  20296. if (headingLevel && !ariaHeadingLevel) {
  20297. return parseInt(headingLevel, 10);
  20298. }
  20299. if (isNaN(ariaLevel) || ariaLevel < 1) {
  20300. if (headingLevel) {
  20301. return parseInt(headingLevel, 10);
  20302. }
  20303. return 2;
  20304. }
  20305. if (ariaLevel) {
  20306. return ariaLevel;
  20307. }
  20308. return -1;
  20309. }
  20310. function headingOrderEvaluate() {
  20311. var headingOrder = cache_default.get('headingOrder');
  20312. if (headingOrder) {
  20313. return true;
  20314. }
  20315. var selector = 'h1, h2, h3, h4, h5, h6, [role=heading], iframe, frame';
  20316. var vNodes = query_selector_all_filter_default(axe._tree[0], selector, _isVisibleToScreenReaders);
  20317. headingOrder = vNodes.map(function(vNode) {
  20318. return {
  20319. ancestry: [ _getAncestry(vNode.actualNode) ],
  20320. level: getLevel(vNode)
  20321. };
  20322. });
  20323. this.data({
  20324. headingOrder: headingOrder
  20325. });
  20326. cache_default.set('headingOrder', vNodes);
  20327. return true;
  20328. }
  20329. var heading_order_evaluate_default = headingOrderEvaluate;
  20330. function isIdenticalObject(a, b) {
  20331. if (!a || !b) {
  20332. return false;
  20333. }
  20334. var aProps = Object.getOwnPropertyNames(a);
  20335. var bProps = Object.getOwnPropertyNames(b);
  20336. if (aProps.length !== bProps.length) {
  20337. return false;
  20338. }
  20339. var result = aProps.every(function(propName) {
  20340. var aValue = a[propName];
  20341. var bValue = b[propName];
  20342. if (_typeof(aValue) !== _typeof(bValue)) {
  20343. return false;
  20344. }
  20345. if (_typeof(aValue) === 'object' || _typeof(bValue) === 'object') {
  20346. return isIdenticalObject(aValue, bValue);
  20347. }
  20348. return aValue === bValue;
  20349. });
  20350. return result;
  20351. }
  20352. function identicalLinksSamePurposeAfter(results) {
  20353. if (results.length < 2) {
  20354. return results;
  20355. }
  20356. var incompleteResults = results.filter(function(_ref109) {
  20357. var result = _ref109.result;
  20358. return result !== void 0;
  20359. });
  20360. var uniqueResults = [];
  20361. var nameMap = {};
  20362. var _loop8 = function _loop8(index) {
  20363. var _currentResult$relate;
  20364. var currentResult = incompleteResults[index];
  20365. var _currentResult$data = currentResult.data, name = _currentResult$data.name, urlProps = _currentResult$data.urlProps;
  20366. if (nameMap[name]) {
  20367. return 'continue';
  20368. }
  20369. var sameNameResults = incompleteResults.filter(function(_ref110, resultNum) {
  20370. var data2 = _ref110.data;
  20371. return data2.name === name && resultNum !== index;
  20372. });
  20373. var isSameUrl = sameNameResults.every(function(_ref111) {
  20374. var data2 = _ref111.data;
  20375. return isIdenticalObject(data2.urlProps, urlProps);
  20376. });
  20377. if (sameNameResults.length && !isSameUrl) {
  20378. currentResult.result = void 0;
  20379. }
  20380. currentResult.relatedNodes = [];
  20381. (_currentResult$relate = currentResult.relatedNodes).push.apply(_currentResult$relate, _toConsumableArray(sameNameResults.map(function(node) {
  20382. return node.relatedNodes[0];
  20383. })));
  20384. nameMap[name] = sameNameResults;
  20385. uniqueResults.push(currentResult);
  20386. };
  20387. for (var index = 0; index < incompleteResults.length; index++) {
  20388. var _ret5 = _loop8(index);
  20389. if (_ret5 === 'continue') {
  20390. continue;
  20391. }
  20392. }
  20393. return uniqueResults;
  20394. }
  20395. var identical_links_same_purpose_after_default = identicalLinksSamePurposeAfter;
  20396. var commons_exports = {};
  20397. __export(commons_exports, {
  20398. aria: function aria() {
  20399. return aria_exports;
  20400. },
  20401. color: function color() {
  20402. return color_exports;
  20403. },
  20404. dom: function dom() {
  20405. return dom_exports;
  20406. },
  20407. forms: function forms() {
  20408. return forms_exports;
  20409. },
  20410. matches: function matches() {
  20411. return matches_default3;
  20412. },
  20413. math: function math() {
  20414. return math_exports;
  20415. },
  20416. standards: function standards() {
  20417. return standards_exports;
  20418. },
  20419. table: function table() {
  20420. return table_exports;
  20421. },
  20422. text: function text() {
  20423. return text_exports;
  20424. },
  20425. utils: function utils() {
  20426. return utils_exports;
  20427. }
  20428. });
  20429. var forms_exports = {};
  20430. __export(forms_exports, {
  20431. isAriaCombobox: function isAriaCombobox() {
  20432. return is_aria_combobox_default;
  20433. },
  20434. isAriaListbox: function isAriaListbox() {
  20435. return is_aria_listbox_default;
  20436. },
  20437. isAriaRange: function isAriaRange() {
  20438. return is_aria_range_default;
  20439. },
  20440. isAriaTextbox: function isAriaTextbox() {
  20441. return is_aria_textbox_default;
  20442. },
  20443. isDisabled: function isDisabled() {
  20444. return is_disabled_default;
  20445. },
  20446. isNativeSelect: function isNativeSelect() {
  20447. return is_native_select_default;
  20448. },
  20449. isNativeTextbox: function isNativeTextbox() {
  20450. return is_native_textbox_default;
  20451. }
  20452. });
  20453. var disabledNodeNames = [ 'fieldset', 'button', 'select', 'input', 'textarea' ];
  20454. function isDisabled(virtualNode) {
  20455. var disabledState = virtualNode._isDisabled;
  20456. if (typeof disabledState === 'boolean') {
  20457. return disabledState;
  20458. }
  20459. var nodeName2 = virtualNode.props.nodeName;
  20460. var ariaDisabled = virtualNode.attr('aria-disabled');
  20461. if (disabledNodeNames.includes(nodeName2) && virtualNode.hasAttr('disabled')) {
  20462. disabledState = true;
  20463. } else if (ariaDisabled) {
  20464. disabledState = ariaDisabled.toLowerCase() === 'true';
  20465. } else if (virtualNode.parent) {
  20466. disabledState = isDisabled(virtualNode.parent);
  20467. } else {
  20468. disabledState = false;
  20469. }
  20470. virtualNode._isDisabled = disabledState;
  20471. return disabledState;
  20472. }
  20473. var is_disabled_default = isDisabled;
  20474. var table_exports = {};
  20475. __export(table_exports, {
  20476. getAllCells: function getAllCells() {
  20477. return get_all_cells_default;
  20478. },
  20479. getCellPosition: function getCellPosition() {
  20480. return get_cell_position_default;
  20481. },
  20482. getHeaders: function getHeaders() {
  20483. return get_headers_default;
  20484. },
  20485. getScope: function getScope() {
  20486. return get_scope_default;
  20487. },
  20488. isColumnHeader: function isColumnHeader() {
  20489. return is_column_header_default;
  20490. },
  20491. isDataCell: function isDataCell() {
  20492. return is_data_cell_default;
  20493. },
  20494. isDataTable: function isDataTable() {
  20495. return is_data_table_default;
  20496. },
  20497. isHeader: function isHeader() {
  20498. return is_header_default;
  20499. },
  20500. isRowHeader: function isRowHeader() {
  20501. return is_row_header_default;
  20502. },
  20503. toArray: function toArray() {
  20504. return to_grid_default;
  20505. },
  20506. toGrid: function toGrid() {
  20507. return to_grid_default;
  20508. },
  20509. traverse: function traverse() {
  20510. return traverse_default;
  20511. }
  20512. });
  20513. function getAllCells(tableElm) {
  20514. var rowIndex, cellIndex, rowLength, cellLength;
  20515. var cells = [];
  20516. for (rowIndex = 0, rowLength = tableElm.rows.length; rowIndex < rowLength; rowIndex++) {
  20517. for (cellIndex = 0, cellLength = tableElm.rows[rowIndex].cells.length; cellIndex < cellLength; cellIndex++) {
  20518. cells.push(tableElm.rows[rowIndex].cells[cellIndex]);
  20519. }
  20520. }
  20521. return cells;
  20522. }
  20523. var get_all_cells_default = getAllCells;
  20524. function traverseForHeaders(headerType, position, tableGrid) {
  20525. var property = headerType === 'row' ? '_rowHeaders' : '_colHeaders';
  20526. var predicate = headerType === 'row' ? is_row_header_default : is_column_header_default;
  20527. var startCell = tableGrid[position.y][position.x];
  20528. var colspan = startCell.colSpan - 1;
  20529. var rowspanAttr = startCell.getAttribute('rowspan');
  20530. var rowspanValue = parseInt(rowspanAttr) === 0 || startCell.rowspan === 0 ? tableGrid.length : startCell.rowSpan;
  20531. var rowspan = rowspanValue - 1;
  20532. var rowStart = position.y + rowspan;
  20533. var colStart = position.x + colspan;
  20534. var rowEnd = headerType === 'row' ? position.y : 0;
  20535. var colEnd = headerType === 'row' ? 0 : position.x;
  20536. var headers;
  20537. var cells = [];
  20538. for (var row = rowStart; row >= rowEnd && !headers; row--) {
  20539. for (var col = colStart; col >= colEnd; col--) {
  20540. var cell = tableGrid[row] ? tableGrid[row][col] : void 0;
  20541. if (!cell) {
  20542. continue;
  20543. }
  20544. var vNode = axe.utils.getNodeFromTree(cell);
  20545. if (vNode[property]) {
  20546. headers = vNode[property];
  20547. break;
  20548. }
  20549. cells.push(cell);
  20550. }
  20551. }
  20552. headers = (headers || []).concat(cells.filter(predicate));
  20553. cells.forEach(function(tableCell) {
  20554. var vNode = axe.utils.getNodeFromTree(tableCell);
  20555. vNode[property] = headers;
  20556. });
  20557. return headers;
  20558. }
  20559. function getHeaders(cell, tableGrid) {
  20560. if (cell.getAttribute('headers')) {
  20561. var headers = idrefs_default(cell, 'headers');
  20562. if (headers.filter(function(header) {
  20563. return header;
  20564. }).length) {
  20565. return headers;
  20566. }
  20567. }
  20568. if (!tableGrid) {
  20569. tableGrid = to_grid_default(find_up_default(cell, 'table'));
  20570. }
  20571. var position = get_cell_position_default(cell, tableGrid);
  20572. var rowHeaders = traverseForHeaders('row', position, tableGrid);
  20573. var colHeaders = traverseForHeaders('col', position, tableGrid);
  20574. return [].concat(rowHeaders, colHeaders).reverse();
  20575. }
  20576. var get_headers_default = getHeaders;
  20577. function isDataCell(cell) {
  20578. if (!cell.children.length && !cell.textContent.trim()) {
  20579. return false;
  20580. }
  20581. var role = cell.getAttribute('role');
  20582. if (is_valid_role_default(role)) {
  20583. return [ 'cell', 'gridcell' ].includes(role);
  20584. } else {
  20585. return cell.nodeName.toUpperCase() === 'TD';
  20586. }
  20587. }
  20588. var is_data_cell_default = isDataCell;
  20589. function isDataTable(node) {
  20590. var role = (node.getAttribute('role') || '').toLowerCase();
  20591. if ((role === 'presentation' || role === 'none') && !_isFocusable(node)) {
  20592. return false;
  20593. }
  20594. if (node.getAttribute('contenteditable') === 'true' || find_up_default(node, '[contenteditable="true"]')) {
  20595. return true;
  20596. }
  20597. if (role === 'grid' || role === 'treegrid' || role === 'table') {
  20598. return true;
  20599. }
  20600. if (get_role_type_default(role) === 'landmark') {
  20601. return true;
  20602. }
  20603. if (node.getAttribute('datatable') === '0') {
  20604. return false;
  20605. }
  20606. if (node.getAttribute('summary')) {
  20607. return true;
  20608. }
  20609. if (node.tHead || node.tFoot || node.caption) {
  20610. return true;
  20611. }
  20612. for (var childIndex = 0, childLength = node.children.length; childIndex < childLength; childIndex++) {
  20613. if (node.children[childIndex].nodeName.toUpperCase() === 'COLGROUP') {
  20614. return true;
  20615. }
  20616. }
  20617. var cells = 0;
  20618. var rowLength = node.rows.length;
  20619. var row, cell;
  20620. var hasBorder = false;
  20621. for (var rowIndex = 0; rowIndex < rowLength; rowIndex++) {
  20622. row = node.rows[rowIndex];
  20623. for (var cellIndex = 0, cellLength = row.cells.length; cellIndex < cellLength; cellIndex++) {
  20624. cell = row.cells[cellIndex];
  20625. if (cell.nodeName.toUpperCase() === 'TH') {
  20626. return true;
  20627. }
  20628. if (!hasBorder && (cell.offsetWidth !== cell.clientWidth || cell.offsetHeight !== cell.clientHeight)) {
  20629. hasBorder = true;
  20630. }
  20631. if (cell.getAttribute('scope') || cell.getAttribute('headers') || cell.getAttribute('abbr')) {
  20632. return true;
  20633. }
  20634. if ([ 'columnheader', 'rowheader' ].includes((cell.getAttribute('role') || '').toLowerCase())) {
  20635. return true;
  20636. }
  20637. if (cell.children.length === 1 && cell.children[0].nodeName.toUpperCase() === 'ABBR') {
  20638. return true;
  20639. }
  20640. cells++;
  20641. }
  20642. }
  20643. if (node.getElementsByTagName('table').length) {
  20644. return false;
  20645. }
  20646. if (rowLength < 2) {
  20647. return false;
  20648. }
  20649. var sampleRow = node.rows[Math.ceil(rowLength / 2)];
  20650. if (sampleRow.cells.length === 1 && sampleRow.cells[0].colSpan === 1) {
  20651. return false;
  20652. }
  20653. if (sampleRow.cells.length >= 5) {
  20654. return true;
  20655. }
  20656. if (hasBorder) {
  20657. return true;
  20658. }
  20659. var bgColor, bgImage;
  20660. for (rowIndex = 0; rowIndex < rowLength; rowIndex++) {
  20661. row = node.rows[rowIndex];
  20662. if (bgColor && bgColor !== window.getComputedStyle(row).getPropertyValue('background-color')) {
  20663. return true;
  20664. } else {
  20665. bgColor = window.getComputedStyle(row).getPropertyValue('background-color');
  20666. }
  20667. if (bgImage && bgImage !== window.getComputedStyle(row).getPropertyValue('background-image')) {
  20668. return true;
  20669. } else {
  20670. bgImage = window.getComputedStyle(row).getPropertyValue('background-image');
  20671. }
  20672. }
  20673. if (rowLength >= 20) {
  20674. return true;
  20675. }
  20676. if (get_element_coordinates_default(node).width > get_viewport_size_default(window).width * .95) {
  20677. return false;
  20678. }
  20679. if (cells < 10) {
  20680. return false;
  20681. }
  20682. if (node.querySelector('object, embed, iframe, applet')) {
  20683. return false;
  20684. }
  20685. return true;
  20686. }
  20687. var is_data_table_default = isDataTable;
  20688. function isHeader(cell) {
  20689. if (is_column_header_default(cell) || is_row_header_default(cell)) {
  20690. return true;
  20691. }
  20692. if (cell.getAttribute('id')) {
  20693. var id = escape_selector_default(cell.getAttribute('id'));
  20694. return !!document.querySelector('[headers~="'.concat(id, '"]'));
  20695. }
  20696. return false;
  20697. }
  20698. var is_header_default = isHeader;
  20699. function traverseTable(dir, position, tableGrid, callback) {
  20700. var result;
  20701. var cell = tableGrid[position.y] ? tableGrid[position.y][position.x] : void 0;
  20702. if (!cell) {
  20703. return [];
  20704. }
  20705. if (typeof callback === 'function') {
  20706. result = callback(cell, position, tableGrid);
  20707. if (result === true) {
  20708. return [ cell ];
  20709. }
  20710. }
  20711. result = traverseTable(dir, {
  20712. x: position.x + dir.x,
  20713. y: position.y + dir.y
  20714. }, tableGrid, callback);
  20715. result.unshift(cell);
  20716. return result;
  20717. }
  20718. function traverse(dir, startPos, tableGrid, callback) {
  20719. if (Array.isArray(startPos)) {
  20720. callback = tableGrid;
  20721. tableGrid = startPos;
  20722. startPos = {
  20723. x: 0,
  20724. y: 0
  20725. };
  20726. }
  20727. if (typeof dir === 'string') {
  20728. switch (dir) {
  20729. case 'left':
  20730. dir = {
  20731. x: -1,
  20732. y: 0
  20733. };
  20734. break;
  20735. case 'up':
  20736. dir = {
  20737. x: 0,
  20738. y: -1
  20739. };
  20740. break;
  20741. case 'right':
  20742. dir = {
  20743. x: 1,
  20744. y: 0
  20745. };
  20746. break;
  20747. case 'down':
  20748. dir = {
  20749. x: 0,
  20750. y: 1
  20751. };
  20752. break;
  20753. }
  20754. }
  20755. return traverseTable(dir, {
  20756. x: startPos.x + dir.x,
  20757. y: startPos.y + dir.y
  20758. }, tableGrid, callback);
  20759. }
  20760. var traverse_default = traverse;
  20761. function identicalLinksSamePurposeEvaluate(node, options, virtualNode) {
  20762. var accText = text_exports.accessibleTextVirtual(virtualNode);
  20763. var name = text_exports.sanitize(text_exports.removeUnicode(accText, {
  20764. emoji: true,
  20765. nonBmp: true,
  20766. punctuations: true
  20767. })).toLowerCase();
  20768. if (!name) {
  20769. return void 0;
  20770. }
  20771. var afterData = {
  20772. name: name,
  20773. urlProps: dom_exports.urlPropsFromAttribute(node, 'href')
  20774. };
  20775. this.data(afterData);
  20776. this.relatedNodes([ node ]);
  20777. return true;
  20778. }
  20779. var identical_links_same_purpose_evaluate_default = identicalLinksSamePurposeEvaluate;
  20780. function internalLinkPresentEvaluate(node, options, virtualNode) {
  20781. var links = query_selector_all_default(virtualNode, 'a[href]');
  20782. return links.some(function(vLink) {
  20783. return /^#[^/!]/.test(vLink.attr('href'));
  20784. });
  20785. }
  20786. var internal_link_present_evaluate_default = internalLinkPresentEvaluate;
  20787. var separatorRegex = /[;,\s]/;
  20788. var validRedirectNumRegex = /^[0-9.]+$/;
  20789. function metaRefreshEvaluate(node, options, virtualNode) {
  20790. var _ref112 = options || {}, minDelay = _ref112.minDelay, maxDelay = _ref112.maxDelay;
  20791. var content = (virtualNode.attr('content') || '').trim();
  20792. var _content$split = content.split(separatorRegex), _content$split2 = _slicedToArray(_content$split, 1), redirectStr = _content$split2[0];
  20793. if (!redirectStr.match(validRedirectNumRegex)) {
  20794. return true;
  20795. }
  20796. var redirectDelay = parseFloat(redirectStr);
  20797. this.data({
  20798. redirectDelay: redirectDelay
  20799. });
  20800. if (typeof minDelay === 'number' && redirectDelay <= options.minDelay) {
  20801. return true;
  20802. }
  20803. if (typeof maxDelay === 'number' && redirectDelay > options.maxDelay) {
  20804. return true;
  20805. }
  20806. return false;
  20807. }
  20808. function normalizeFontWeight(weight) {
  20809. switch (weight) {
  20810. case 'lighter':
  20811. return 100;
  20812. case 'normal':
  20813. return 400;
  20814. case 'bold':
  20815. return 700;
  20816. case 'bolder':
  20817. return 900;
  20818. }
  20819. weight = parseInt(weight);
  20820. return !isNaN(weight) ? weight : 400;
  20821. }
  20822. function getTextContainer(elm) {
  20823. var nextNode = elm;
  20824. var outerText = elm.textContent.trim();
  20825. var innerText = outerText;
  20826. while (innerText === outerText && nextNode !== void 0) {
  20827. var _i28 = -1;
  20828. elm = nextNode;
  20829. if (elm.children.length === 0) {
  20830. return elm;
  20831. }
  20832. do {
  20833. _i28++;
  20834. innerText = elm.children[_i28].textContent.trim();
  20835. } while (innerText === '' && _i28 + 1 < elm.children.length);
  20836. nextNode = elm.children[_i28];
  20837. }
  20838. return elm;
  20839. }
  20840. function getStyleValues(node) {
  20841. var style = window.getComputedStyle(getTextContainer(node));
  20842. return {
  20843. fontWeight: normalizeFontWeight(style.getPropertyValue('font-weight')),
  20844. fontSize: parseInt(style.getPropertyValue('font-size')),
  20845. isItalic: style.getPropertyValue('font-style') === 'italic'
  20846. };
  20847. }
  20848. function isHeaderStyle(styleA, styleB, margins) {
  20849. return margins.reduce(function(out, margin) {
  20850. return out || (!margin.size || styleA.fontSize / margin.size > styleB.fontSize) && (!margin.weight || styleA.fontWeight - margin.weight > styleB.fontWeight) && (!margin.italic || styleA.isItalic && !styleB.isItalic);
  20851. }, false);
  20852. }
  20853. function pAsHeadingEvaluate(node, options, virtualNode) {
  20854. var siblings = Array.from(node.parentNode.children);
  20855. var currentIndex = siblings.indexOf(node);
  20856. options = options || {};
  20857. var margins = options.margins || [];
  20858. var nextSibling = siblings.slice(currentIndex + 1).find(function(elm) {
  20859. return elm.nodeName.toUpperCase() === 'P';
  20860. });
  20861. var prevSibling = siblings.slice(0, currentIndex).reverse().find(function(elm) {
  20862. return elm.nodeName.toUpperCase() === 'P';
  20863. });
  20864. var currStyle = getStyleValues(node);
  20865. var nextStyle = nextSibling ? getStyleValues(nextSibling) : null;
  20866. var prevStyle = prevSibling ? getStyleValues(prevSibling) : null;
  20867. var optionsPassLength = options.passLength;
  20868. var optionsFailLength = options.failLength;
  20869. var headingLength = node.textContent.trim().length;
  20870. var paragraphLength = nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.textContent.trim().length;
  20871. if (headingLength > paragraphLength * optionsPassLength) {
  20872. return true;
  20873. }
  20874. if (!nextStyle || !isHeaderStyle(currStyle, nextStyle, margins)) {
  20875. return true;
  20876. }
  20877. var blockquote = find_up_virtual_default(virtualNode, 'blockquote');
  20878. if (blockquote && blockquote.nodeName.toUpperCase() === 'BLOCKQUOTE') {
  20879. return void 0;
  20880. }
  20881. if (prevStyle && !isHeaderStyle(currStyle, prevStyle, margins)) {
  20882. return void 0;
  20883. }
  20884. if (headingLength > paragraphLength * optionsFailLength) {
  20885. return void 0;
  20886. }
  20887. return false;
  20888. }
  20889. var p_as_heading_evaluate_default = pAsHeadingEvaluate;
  20890. function regionAfter(results) {
  20891. var iframeResults = results.filter(function(r) {
  20892. return r.data.isIframe;
  20893. });
  20894. results.forEach(function(r) {
  20895. if (r.result || r.node.ancestry.length === 1) {
  20896. return;
  20897. }
  20898. var frameAncestry = r.node.ancestry.slice(0, -1);
  20899. var _iterator11 = _createForOfIteratorHelper(iframeResults), _step11;
  20900. try {
  20901. for (_iterator11.s(); !(_step11 = _iterator11.n()).done; ) {
  20902. var iframeResult = _step11.value;
  20903. if (match_ancestry_default(frameAncestry, iframeResult.node.ancestry)) {
  20904. r.result = iframeResult.result;
  20905. break;
  20906. }
  20907. }
  20908. } catch (err) {
  20909. _iterator11.e(err);
  20910. } finally {
  20911. _iterator11.f();
  20912. }
  20913. });
  20914. iframeResults.forEach(function(r) {
  20915. if (!r.result) {
  20916. r.result = true;
  20917. }
  20918. });
  20919. return results;
  20920. }
  20921. var region_after_default = regionAfter;
  20922. var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
  20923. var implicitAriaLiveRoles = [ 'alert', 'log', 'status' ];
  20924. function regionEvaluate(node, options, virtualNode) {
  20925. this.data({
  20926. isIframe: [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName)
  20927. });
  20928. var regionlessNodes = cache_default.get('regionlessNodes', function() {
  20929. return getRegionlessNodes(options);
  20930. });
  20931. return !regionlessNodes.includes(virtualNode);
  20932. }
  20933. function getRegionlessNodes(options) {
  20934. var regionlessNodes = findRegionlessElms(axe._tree[0], options).map(function(vNode) {
  20935. while (vNode.parent && !vNode.parent._hasRegionDescendant && vNode.parent.actualNode !== document.body) {
  20936. vNode = vNode.parent;
  20937. }
  20938. return vNode;
  20939. }).filter(function(vNode, index, array) {
  20940. return array.indexOf(vNode) === index;
  20941. });
  20942. return regionlessNodes;
  20943. }
  20944. function findRegionlessElms(virtualNode, options) {
  20945. var node = virtualNode.actualNode;
  20946. if (get_role_default(virtualNode) === 'button' || isRegion(virtualNode, options) || [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) || _isSkipLink(virtualNode.actualNode) && get_element_by_reference_default(virtualNode.actualNode, 'href') || !_isVisibleToScreenReaders(node)) {
  20947. var vNode = virtualNode;
  20948. while (vNode) {
  20949. vNode._hasRegionDescendant = true;
  20950. vNode = vNode.parent;
  20951. }
  20952. if ([ 'iframe', 'frame' ].includes(virtualNode.props.nodeName)) {
  20953. return [ virtualNode ];
  20954. }
  20955. return [];
  20956. } else if (node !== document.body && has_content_default(node, true)) {
  20957. return [ virtualNode ];
  20958. } else {
  20959. return virtualNode.children.filter(function(_ref113) {
  20960. var actualNode = _ref113.actualNode;
  20961. return actualNode.nodeType === 1;
  20962. }).map(function(vNode) {
  20963. return findRegionlessElms(vNode, options);
  20964. }).reduce(function(a, b) {
  20965. return a.concat(b);
  20966. }, []);
  20967. }
  20968. }
  20969. function isRegion(virtualNode, options) {
  20970. var node = virtualNode.actualNode;
  20971. var role = get_role_default(virtualNode);
  20972. var ariaLive = (node.getAttribute('aria-live') || '').toLowerCase().trim();
  20973. if ([ 'assertive', 'polite' ].includes(ariaLive) || implicitAriaLiveRoles.includes(role)) {
  20974. return true;
  20975. }
  20976. if (landmarkRoles2.includes(role)) {
  20977. return true;
  20978. }
  20979. if (options.regionMatcher && matches_default3(virtualNode, options.regionMatcher)) {
  20980. return true;
  20981. }
  20982. return false;
  20983. }
  20984. function skipLinkEvaluate(node) {
  20985. var target = get_element_by_reference_default(node, 'href');
  20986. if (target) {
  20987. return _isVisibleToScreenReaders(target) || void 0;
  20988. }
  20989. return false;
  20990. }
  20991. var skip_link_evaluate_default = skipLinkEvaluate;
  20992. function uniqueFrameTitleAfter(results) {
  20993. var titles = {};
  20994. results.forEach(function(r) {
  20995. titles[r.data] = titles[r.data] !== void 0 ? ++titles[r.data] : 0;
  20996. });
  20997. results.forEach(function(r) {
  20998. r.result = !!titles[r.data];
  20999. });
  21000. return results;
  21001. }
  21002. var unique_frame_title_after_default = uniqueFrameTitleAfter;
  21003. function uniqueFrameTitleEvaluate(node, options, vNode) {
  21004. var title = sanitize_default(vNode.attr('title')).toLowerCase();
  21005. this.data(title);
  21006. return true;
  21007. }
  21008. var unique_frame_title_evaluate_default = uniqueFrameTitleEvaluate;
  21009. function duplicateIdAfter(results) {
  21010. var uniqueIds = [];
  21011. return results.filter(function(r) {
  21012. if (uniqueIds.indexOf(r.data) === -1) {
  21013. uniqueIds.push(r.data);
  21014. return true;
  21015. }
  21016. return false;
  21017. });
  21018. }
  21019. var duplicate_id_after_default = duplicateIdAfter;
  21020. function duplicateIdEvaluate(node) {
  21021. var id = node.getAttribute('id').trim();
  21022. if (!id) {
  21023. return true;
  21024. }
  21025. var root = get_root_node_default2(node);
  21026. var matchingNodes = Array.from(root.querySelectorAll('[id="'.concat(escape_selector_default(id), '"]'))).filter(function(foundNode) {
  21027. return foundNode !== node;
  21028. });
  21029. if (matchingNodes.length) {
  21030. this.relatedNodes(matchingNodes);
  21031. }
  21032. this.data(id);
  21033. return matchingNodes.length === 0;
  21034. }
  21035. var duplicate_id_evaluate_default = duplicateIdEvaluate;
  21036. function ariaLabelEvaluate(node, options, virtualNode) {
  21037. return !!sanitize_default(arialabel_text_default(virtualNode));
  21038. }
  21039. var aria_label_evaluate_default = ariaLabelEvaluate;
  21040. function ariaLabelledbyEvaluate(node, options, virtualNode) {
  21041. try {
  21042. return !!sanitize_default(arialabelledby_text_default(virtualNode));
  21043. } catch (e) {
  21044. return void 0;
  21045. }
  21046. }
  21047. var aria_labelledby_evaluate_default = ariaLabelledbyEvaluate;
  21048. function avoidInlineSpacingEvaluate(node, options) {
  21049. var overriddenProperties = options.cssProperties.filter(function(property) {
  21050. if (node.style.getPropertyPriority(property) === 'important') {
  21051. return property;
  21052. }
  21053. });
  21054. if (overriddenProperties.length > 0) {
  21055. this.data(overriddenProperties);
  21056. return false;
  21057. }
  21058. return true;
  21059. }
  21060. var avoid_inline_spacing_evaluate_default = avoidInlineSpacingEvaluate;
  21061. function docHasTitleEvaluate() {
  21062. var title = document.title;
  21063. return !!sanitize_default(title);
  21064. }
  21065. var doc_has_title_evaluate_default = docHasTitleEvaluate;
  21066. function existsEvaluate() {
  21067. return void 0;
  21068. }
  21069. var exists_evaluate_default = existsEvaluate;
  21070. function hasAltEvaluate(node, options, virtualNode) {
  21071. var nodeName2 = virtualNode.props.nodeName;
  21072. if (![ 'img', 'input', 'area' ].includes(nodeName2)) {
  21073. return false;
  21074. }
  21075. return virtualNode.hasAttr('alt');
  21076. }
  21077. var has_alt_evaluate_default = hasAltEvaluate;
  21078. function inlineStyleProperty(node, options) {
  21079. var cssProperty = options.cssProperty, absoluteValues = options.absoluteValues, minValue = options.minValue, maxValue = options.maxValue, _options$normalValue = options.normalValue, normalValue = _options$normalValue === void 0 ? 0 : _options$normalValue, noImportant = options.noImportant, multiLineOnly = options.multiLineOnly;
  21080. if (!noImportant && node.style.getPropertyPriority(cssProperty) !== 'important' || multiLineOnly && !_isMultiline(node)) {
  21081. return true;
  21082. }
  21083. var data2 = {};
  21084. if (typeof minValue === 'number') {
  21085. data2.minValue = minValue;
  21086. }
  21087. if (typeof maxValue === 'number') {
  21088. data2.maxValue = maxValue;
  21089. }
  21090. var declaredPropValue = node.style.getPropertyValue(cssProperty);
  21091. if ([ 'inherit', 'unset', 'revert', 'revert-layer' ].includes(declaredPropValue)) {
  21092. this.data(_extends({
  21093. value: declaredPropValue
  21094. }, data2));
  21095. return true;
  21096. }
  21097. var value = getNumberValue(node, {
  21098. absoluteValues: absoluteValues,
  21099. cssProperty: cssProperty,
  21100. normalValue: normalValue
  21101. });
  21102. this.data(_extends({
  21103. value: value
  21104. }, data2));
  21105. if (typeof value !== 'number') {
  21106. return void 0;
  21107. }
  21108. if ((typeof minValue !== 'number' || value >= minValue) && (typeof maxValue !== 'number' || value <= maxValue)) {
  21109. return true;
  21110. }
  21111. return false;
  21112. }
  21113. function getNumberValue(domNode, _ref114) {
  21114. var cssProperty = _ref114.cssProperty, absoluteValues = _ref114.absoluteValues, normalValue = _ref114.normalValue;
  21115. var computedStyle = window.getComputedStyle(domNode);
  21116. var cssPropValue = computedStyle.getPropertyValue(cssProperty);
  21117. if (cssPropValue === 'normal') {
  21118. return normalValue;
  21119. }
  21120. var parsedValue = parseFloat(cssPropValue);
  21121. if (absoluteValues) {
  21122. return parsedValue;
  21123. }
  21124. var fontSize = parseFloat(computedStyle.getPropertyValue('font-size'));
  21125. var value = Math.round(parsedValue / fontSize * 100) / 100;
  21126. if (isNaN(value)) {
  21127. return cssPropValue;
  21128. }
  21129. return value;
  21130. }
  21131. function isOnScreenEvaluate(node) {
  21132. return _isVisibleOnScreen(node);
  21133. }
  21134. var is_on_screen_evaluate_default = isOnScreenEvaluate;
  21135. function nonEmptyIfPresentEvaluate(node, options, virtualNode) {
  21136. var nodeName2 = virtualNode.props.nodeName;
  21137. var type = (virtualNode.attr('type') || '').toLowerCase();
  21138. var label3 = virtualNode.attr('value');
  21139. if (label3) {
  21140. this.data({
  21141. messageKey: 'has-label'
  21142. });
  21143. }
  21144. if (nodeName2 === 'input' && [ 'submit', 'reset' ].includes(type)) {
  21145. return label3 === null;
  21146. }
  21147. return false;
  21148. }
  21149. var non_empty_if_present_evaluate_default = nonEmptyIfPresentEvaluate;
  21150. function presentationalRoleEvaluate(node, options, virtualNode) {
  21151. var explicitRole2 = get_explicit_role_default(virtualNode);
  21152. if ([ 'presentation', 'none' ].includes(explicitRole2) && [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) && virtualNode.hasAttr('title')) {
  21153. this.data({
  21154. messageKey: 'iframe',
  21155. nodeName: virtualNode.props.nodeName
  21156. });
  21157. return false;
  21158. }
  21159. var role = get_role_default(virtualNode);
  21160. if ([ 'presentation', 'none' ].includes(role)) {
  21161. this.data({
  21162. role: role
  21163. });
  21164. return true;
  21165. }
  21166. if (![ 'presentation', 'none' ].includes(explicitRole2)) {
  21167. return false;
  21168. }
  21169. var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) {
  21170. return virtualNode.hasAttr(attr);
  21171. });
  21172. var focusable = _isFocusable(virtualNode);
  21173. var messageKey;
  21174. if (hasGlobalAria && !focusable) {
  21175. messageKey = 'globalAria';
  21176. } else if (!hasGlobalAria && focusable) {
  21177. messageKey = 'focusable';
  21178. } else {
  21179. messageKey = 'both';
  21180. }
  21181. this.data({
  21182. messageKey: messageKey,
  21183. role: role
  21184. });
  21185. return false;
  21186. }
  21187. function svgNonEmptyTitleEvaluate(node, options, virtualNode) {
  21188. if (!virtualNode.children) {
  21189. return void 0;
  21190. }
  21191. var titleNode = virtualNode.children.find(function(_ref115) {
  21192. var props = _ref115.props;
  21193. return props.nodeName === 'title';
  21194. });
  21195. if (!titleNode) {
  21196. this.data({
  21197. messageKey: 'noTitle'
  21198. });
  21199. return false;
  21200. }
  21201. try {
  21202. var titleText2 = subtree_text_default(titleNode, {
  21203. includeHidden: true
  21204. }).trim();
  21205. if (titleText2 === '') {
  21206. this.data({
  21207. messageKey: 'emptyTitle'
  21208. });
  21209. return false;
  21210. }
  21211. } catch (e) {
  21212. return void 0;
  21213. }
  21214. return true;
  21215. }
  21216. var svg_non_empty_title_evaluate_default = svgNonEmptyTitleEvaluate;
  21217. function captionFakedEvaluate(node) {
  21218. var table = to_grid_default(node);
  21219. var firstRow = table[0];
  21220. if (table.length <= 1 || firstRow.length <= 1 || node.rows.length <= 1) {
  21221. return true;
  21222. }
  21223. return firstRow.reduce(function(out, curr, i) {
  21224. return out || curr !== firstRow[i + 1] && firstRow[i + 1] !== void 0;
  21225. }, false);
  21226. }
  21227. var caption_faked_evaluate_default = captionFakedEvaluate;
  21228. function html5ScopeEvaluate(node) {
  21229. if (!is_html5_default(document)) {
  21230. return true;
  21231. }
  21232. return node.nodeName.toUpperCase() === 'TH';
  21233. }
  21234. var html5_scope_evaluate_default = html5ScopeEvaluate;
  21235. var same_caption_summary_evaluate_default = sameCaptionSummaryEvaluate;
  21236. function sameCaptionSummaryEvaluate(node, options, virtualNode) {
  21237. if (virtualNode.children === void 0) {
  21238. return void 0;
  21239. }
  21240. var summary = virtualNode.attr('summary');
  21241. var captionNode = virtualNode.children.find(isCaptionNode);
  21242. var caption = captionNode ? sanitize_default(subtree_text_default(captionNode)) : false;
  21243. if (!caption || !summary) {
  21244. return false;
  21245. }
  21246. return sanitize_default(summary).toLowerCase() === sanitize_default(caption).toLowerCase();
  21247. }
  21248. function isCaptionNode(virtualNode) {
  21249. return virtualNode.props.nodeName === 'caption';
  21250. }
  21251. function scopeValueEvaluate(node, options) {
  21252. var value = node.getAttribute('scope').toLowerCase();
  21253. return options.values.indexOf(value) !== -1;
  21254. }
  21255. var scope_value_evaluate_default = scopeValueEvaluate;
  21256. function tdHasHeaderEvaluate(node) {
  21257. var badCells = [];
  21258. var cells = get_all_cells_default(node);
  21259. var tableGrid = to_grid_default(node);
  21260. cells.forEach(function(cell) {
  21261. if (has_content_default(cell) && is_data_cell_default(cell) && !label_default2(cell)) {
  21262. var hasHeaders = get_headers_default(cell, tableGrid).some(function(header) {
  21263. return header !== null && !!has_content_default(header);
  21264. });
  21265. if (!hasHeaders) {
  21266. badCells.push(cell);
  21267. }
  21268. }
  21269. });
  21270. if (badCells.length) {
  21271. this.relatedNodes(badCells);
  21272. return false;
  21273. }
  21274. return true;
  21275. }
  21276. var td_has_header_evaluate_default = tdHasHeaderEvaluate;
  21277. function tdHeadersAttrEvaluate(node) {
  21278. var cells = [];
  21279. var reviewCells = [];
  21280. var badCells = [];
  21281. for (var rowIndex = 0; rowIndex < node.rows.length; rowIndex++) {
  21282. var row = node.rows[rowIndex];
  21283. for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) {
  21284. cells.push(row.cells[cellIndex]);
  21285. }
  21286. }
  21287. var ids = cells.reduce(function(ids2, cell) {
  21288. if (cell.getAttribute('id')) {
  21289. ids2.push(cell.getAttribute('id'));
  21290. }
  21291. return ids2;
  21292. }, []);
  21293. cells.forEach(function(cell) {
  21294. var isSelf = false;
  21295. var notOfTable = false;
  21296. if (!cell.hasAttribute('headers') || !_isVisibleToScreenReaders(cell)) {
  21297. return;
  21298. }
  21299. var headersAttr = cell.getAttribute('headers').trim();
  21300. if (!headersAttr) {
  21301. return reviewCells.push(cell);
  21302. }
  21303. var headers = token_list_default(headersAttr);
  21304. if (headers.length !== 0) {
  21305. if (cell.getAttribute('id')) {
  21306. isSelf = headers.indexOf(cell.getAttribute('id').trim()) !== -1;
  21307. }
  21308. notOfTable = headers.some(function(header) {
  21309. return !ids.includes(header);
  21310. });
  21311. if (isSelf || notOfTable) {
  21312. badCells.push(cell);
  21313. }
  21314. }
  21315. });
  21316. if (badCells.length > 0) {
  21317. this.relatedNodes(badCells);
  21318. return false;
  21319. }
  21320. if (reviewCells.length) {
  21321. this.relatedNodes(reviewCells);
  21322. return void 0;
  21323. }
  21324. return true;
  21325. }
  21326. var td_headers_attr_evaluate_default = tdHeadersAttrEvaluate;
  21327. function thHasDataCellsEvaluate(node) {
  21328. var cells = get_all_cells_default(node);
  21329. var checkResult = this;
  21330. var reffedHeaders = [];
  21331. cells.forEach(function(cell) {
  21332. var headers2 = cell.getAttribute('headers');
  21333. if (headers2) {
  21334. reffedHeaders = reffedHeaders.concat(headers2.split(/\s+/));
  21335. }
  21336. var ariaLabel = cell.getAttribute('aria-labelledby');
  21337. if (ariaLabel) {
  21338. reffedHeaders = reffedHeaders.concat(ariaLabel.split(/\s+/));
  21339. }
  21340. });
  21341. var headers = cells.filter(function(cell) {
  21342. if (sanitize_default(cell.textContent) === '') {
  21343. return false;
  21344. }
  21345. return cell.nodeName.toUpperCase() === 'TH' || [ 'rowheader', 'columnheader' ].indexOf(cell.getAttribute('role')) !== -1;
  21346. });
  21347. var tableGrid = to_grid_default(node);
  21348. var out = true;
  21349. headers.forEach(function(header) {
  21350. if (header.getAttribute('id') && reffedHeaders.includes(header.getAttribute('id'))) {
  21351. return;
  21352. }
  21353. var pos = get_cell_position_default(header, tableGrid);
  21354. var hasCell = false;
  21355. if (is_column_header_default(header)) {
  21356. hasCell = traverse_default('down', pos, tableGrid).find(function(cell) {
  21357. return !is_column_header_default(cell) && get_headers_default(cell, tableGrid).includes(header);
  21358. });
  21359. }
  21360. if (!hasCell && is_row_header_default(header)) {
  21361. hasCell = traverse_default('right', pos, tableGrid).find(function(cell) {
  21362. return !is_row_header_default(cell) && get_headers_default(cell, tableGrid).includes(header);
  21363. });
  21364. }
  21365. if (!hasCell) {
  21366. checkResult.relatedNodes(header);
  21367. }
  21368. out = out && hasCell;
  21369. });
  21370. return out ? true : void 0;
  21371. }
  21372. var th_has_data_cells_evaluate_default = thHasDataCellsEvaluate;
  21373. function hiddenContentEvaluate(node, options, virtualNode) {
  21374. var allowlist = [ 'SCRIPT', 'HEAD', 'TITLE', 'NOSCRIPT', 'STYLE', 'TEMPLATE' ];
  21375. if (!allowlist.includes(node.nodeName.toUpperCase()) && has_content_virtual_default(virtualNode)) {
  21376. var styles = window.getComputedStyle(node);
  21377. if (styles.getPropertyValue('display') === 'none') {
  21378. return void 0;
  21379. } else if (styles.getPropertyValue('visibility') === 'hidden') {
  21380. var parent = get_composed_parent_default(node);
  21381. var parentStyle = parent && window.getComputedStyle(parent);
  21382. if (!parentStyle || parentStyle.getPropertyValue('visibility') !== 'hidden') {
  21383. return void 0;
  21384. }
  21385. }
  21386. }
  21387. return true;
  21388. }
  21389. var hidden_content_evaluate_default = hiddenContentEvaluate;
  21390. function ariaAllowedAttrMatches(node, virtualNode) {
  21391. var aria = /^aria-/;
  21392. var attrs = virtualNode.attrNames;
  21393. if (attrs.length) {
  21394. for (var _i29 = 0, l = attrs.length; _i29 < l; _i29++) {
  21395. if (aria.test(attrs[_i29])) {
  21396. return true;
  21397. }
  21398. }
  21399. }
  21400. return false;
  21401. }
  21402. var aria_allowed_attr_matches_default = ariaAllowedAttrMatches;
  21403. function ariaAllowedRoleMatches(node, virtualNode) {
  21404. return get_explicit_role_default(virtualNode, {
  21405. dpub: true,
  21406. fallback: true
  21407. }) !== null;
  21408. }
  21409. var aria_allowed_role_matches_default = ariaAllowedRoleMatches;
  21410. function ariaHasAttrMatches(node, virtualNode) {
  21411. var aria = /^aria-/;
  21412. return virtualNode.attrNames.some(function(attr) {
  21413. return aria.test(attr);
  21414. });
  21415. }
  21416. var aria_has_attr_matches_default = ariaHasAttrMatches;
  21417. function shouldMatchElement(el) {
  21418. if (!el) {
  21419. return true;
  21420. }
  21421. if (el.getAttribute('aria-hidden') === 'true') {
  21422. return false;
  21423. }
  21424. return shouldMatchElement(get_composed_parent_default(el));
  21425. }
  21426. function ariaHiddenFocusMatches(node) {
  21427. return shouldMatchElement(get_composed_parent_default(node));
  21428. }
  21429. var aria_hidden_focus_matches_default = ariaHiddenFocusMatches;
  21430. function ariaRequiredChildrenMatches(node, virtualNode) {
  21431. var role = get_explicit_role_default(virtualNode, {
  21432. dpub: true
  21433. });
  21434. return !!required_owned_default(role);
  21435. }
  21436. var aria_required_children_matches_default = ariaRequiredChildrenMatches;
  21437. function ariaRequiredParentMatches(node, virtualNode) {
  21438. var role = get_explicit_role_default(virtualNode);
  21439. return !!required_context_default(role);
  21440. }
  21441. var aria_required_parent_matches_default = ariaRequiredParentMatches;
  21442. function autocompleteMatches(node, virtualNode) {
  21443. var autocomplete2 = virtualNode.attr('autocomplete');
  21444. if (!autocomplete2 || sanitize_default(autocomplete2) === '') {
  21445. return false;
  21446. }
  21447. var nodeName2 = virtualNode.props.nodeName;
  21448. if ([ 'textarea', 'input', 'select' ].includes(nodeName2) === false) {
  21449. return false;
  21450. }
  21451. var excludedInputTypes = [ 'submit', 'reset', 'button', 'hidden' ];
  21452. if (nodeName2 === 'input' && excludedInputTypes.includes(virtualNode.props.type)) {
  21453. return false;
  21454. }
  21455. var ariaDisabled = virtualNode.attr('aria-disabled') || 'false';
  21456. if (virtualNode.hasAttr('disabled') || ariaDisabled.toLowerCase() === 'true') {
  21457. return false;
  21458. }
  21459. var role = virtualNode.attr('role');
  21460. var tabIndex = virtualNode.attr('tabindex');
  21461. if (tabIndex === '-1' && role) {
  21462. var roleDef = standards_default.ariaRoles[role];
  21463. if (roleDef === void 0 || roleDef.type !== 'widget') {
  21464. return false;
  21465. }
  21466. }
  21467. if (tabIndex === '-1' && virtualNode.actualNode && !_isVisibleOnScreen(virtualNode) && !_isVisibleToScreenReaders(virtualNode)) {
  21468. return false;
  21469. }
  21470. return true;
  21471. }
  21472. var autocomplete_matches_default = autocompleteMatches;
  21473. function isInitiatorMatches(node, virtualNode, context) {
  21474. return context.initiator;
  21475. }
  21476. var is_initiator_matches_default = isInitiatorMatches;
  21477. function bypassMatches(node, virtualNode, context) {
  21478. if (is_initiator_matches_default(node, virtualNode, context)) {
  21479. return !!node.querySelector('a[href]');
  21480. }
  21481. return true;
  21482. }
  21483. var bypass_matches_default = bypassMatches;
  21484. function colorContrastMatches(node, virtualNode) {
  21485. var _virtualNode$props = virtualNode.props, nodeName2 = _virtualNode$props.nodeName, inputType = _virtualNode$props.type;
  21486. if (nodeName2 === 'option') {
  21487. return false;
  21488. }
  21489. if (nodeName2 === 'select' && !node.options.length) {
  21490. return false;
  21491. }
  21492. var nonTextInput = [ 'hidden', 'range', 'color', 'checkbox', 'radio', 'image' ];
  21493. if (nodeName2 === 'input' && nonTextInput.includes(inputType)) {
  21494. return false;
  21495. }
  21496. if (is_disabled_default(virtualNode) || _isInert(virtualNode)) {
  21497. return false;
  21498. }
  21499. var formElements = [ 'input', 'select', 'textarea' ];
  21500. if (formElements.includes(nodeName2)) {
  21501. var style = window.getComputedStyle(node);
  21502. var textIndent = parseInt(style.getPropertyValue('text-indent'), 10);
  21503. if (textIndent) {
  21504. var rect = node.getBoundingClientRect();
  21505. rect = {
  21506. top: rect.top,
  21507. bottom: rect.bottom,
  21508. left: rect.left + textIndent,
  21509. right: rect.right + textIndent
  21510. };
  21511. if (!visually_overlaps_default(rect, node)) {
  21512. return false;
  21513. }
  21514. }
  21515. return true;
  21516. }
  21517. var nodeParentLabel = find_up_virtual_default(virtualNode, 'label');
  21518. if (nodeName2 === 'label' || nodeParentLabel) {
  21519. var labelNode = nodeParentLabel || node;
  21520. var labelVirtual3 = nodeParentLabel ? get_node_from_tree_default(nodeParentLabel) : virtualNode;
  21521. if (labelNode.htmlFor) {
  21522. var doc = get_root_node_default2(labelNode);
  21523. var explicitControl = doc.getElementById(labelNode.htmlFor);
  21524. var explicitControlVirtual = explicitControl && get_node_from_tree_default(explicitControl);
  21525. if (explicitControlVirtual && is_disabled_default(explicitControlVirtual)) {
  21526. return false;
  21527. }
  21528. }
  21529. var query = 'input:not([type="hidden"],[type="image"],[type="button"],[type="submit"],[type="reset"]), select, textarea';
  21530. var implicitControl = query_selector_all_default(labelVirtual3, query)[0];
  21531. if (implicitControl && is_disabled_default(implicitControl)) {
  21532. return false;
  21533. }
  21534. }
  21535. var ariaLabelledbyControls = [];
  21536. var ancestorNode = virtualNode;
  21537. while (ancestorNode) {
  21538. if (ancestorNode.props.id) {
  21539. var virtualControls = get_accessible_refs_default(ancestorNode).filter(function(control) {
  21540. return token_list_default(control.getAttribute('aria-labelledby') || '').includes(ancestorNode.props.id);
  21541. }).map(function(control) {
  21542. return get_node_from_tree_default(control);
  21543. });
  21544. ariaLabelledbyControls.push.apply(ariaLabelledbyControls, _toConsumableArray(virtualControls));
  21545. }
  21546. ancestorNode = ancestorNode.parent;
  21547. }
  21548. if (ariaLabelledbyControls.length > 0 && ariaLabelledbyControls.every(is_disabled_default)) {
  21549. return false;
  21550. }
  21551. if (!hasRealTextChildren(virtualNode)) {
  21552. return false;
  21553. }
  21554. var range = document.createRange();
  21555. var childNodes = virtualNode.children;
  21556. for (var index = 0; index < childNodes.length; index++) {
  21557. var child = childNodes[index];
  21558. if (child.actualNode.nodeType === 3 && sanitize_default(child.actualNode.nodeValue) !== '') {
  21559. range.selectNodeContents(child.actualNode);
  21560. }
  21561. }
  21562. var rects = range.getClientRects();
  21563. for (var _index2 = 0; _index2 < rects.length; _index2++) {
  21564. if (visually_overlaps_default(rects[_index2], node)) {
  21565. return true;
  21566. }
  21567. }
  21568. return false;
  21569. }
  21570. var color_contrast_matches_default = colorContrastMatches;
  21571. var removeUnicodeOptions = {
  21572. emoji: true,
  21573. nonBmp: false,
  21574. punctuations: true
  21575. };
  21576. function hasRealTextChildren(virtualNode) {
  21577. var visibleText = visible_virtual_default(virtualNode, false, true);
  21578. if (visibleText === '' || remove_unicode_default(visibleText, removeUnicodeOptions) === '') {
  21579. return false;
  21580. }
  21581. return virtualNode.children.some(function(vChild) {
  21582. return vChild.props.nodeName === '#text' && !is_icon_ligature_default(vChild);
  21583. });
  21584. }
  21585. function dataTableLargeMatches(node) {
  21586. if (is_data_table_default(node)) {
  21587. var tableArray = to_grid_default(node);
  21588. return tableArray.length >= 3 && tableArray[0].length >= 3 && tableArray[1].length >= 3 && tableArray[2].length >= 3;
  21589. }
  21590. return false;
  21591. }
  21592. var data_table_large_matches_default = dataTableLargeMatches;
  21593. function dataTableMatches(node) {
  21594. return is_data_table_default(node);
  21595. }
  21596. var data_table_matches_default = dataTableMatches;
  21597. function duplicateIdActiveMatches(node) {
  21598. var id = node.getAttribute('id').trim();
  21599. var idSelector = '*[id="'.concat(escape_selector_default(id), '"]');
  21600. var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector));
  21601. return !is_accessible_ref_default(node) && idMatchingElms.some(_isFocusable);
  21602. }
  21603. var duplicate_id_active_matches_default = duplicateIdActiveMatches;
  21604. function duplicateIdAriaMatches(node) {
  21605. return is_accessible_ref_default(node);
  21606. }
  21607. var duplicate_id_aria_matches_default = duplicateIdAriaMatches;
  21608. function duplicateIdMiscMatches(node) {
  21609. var id = node.getAttribute('id').trim();
  21610. var idSelector = '*[id="'.concat(escape_selector_default(id), '"]');
  21611. var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector));
  21612. return !is_accessible_ref_default(node) && idMatchingElms.every(function(elm) {
  21613. return !_isFocusable(elm);
  21614. });
  21615. }
  21616. var duplicate_id_misc_matches_default = duplicateIdMiscMatches;
  21617. function frameFocusableContentMatches(node, virtualNode, context) {
  21618. var _context$size, _context$size2;
  21619. return !context.initiator && !context.focusable && ((_context$size = context.size) === null || _context$size === void 0 ? void 0 : _context$size.width) * ((_context$size2 = context.size) === null || _context$size2 === void 0 ? void 0 : _context$size2.height) > 1;
  21620. }
  21621. var frame_focusable_content_matches_default = frameFocusableContentMatches;
  21622. function frameTitleHasTextMatches(node) {
  21623. var title = node.getAttribute('title');
  21624. return !!sanitize_default(title);
  21625. }
  21626. var frame_title_has_text_matches_default = frameTitleHasTextMatches;
  21627. function hasImplicitChromiumRoleMatches(node, virtualNode) {
  21628. return implicit_role_default(virtualNode, {
  21629. chromium: true
  21630. }) !== null;
  21631. }
  21632. var has_implicit_chromium_role_matches_default = hasImplicitChromiumRoleMatches;
  21633. function headingMatches(node, virtualNode) {
  21634. return get_role_default(virtualNode) === 'heading';
  21635. }
  21636. function svgNamespaceMatches(node, virtualNode) {
  21637. try {
  21638. var nodeName2 = virtualNode.props.nodeName;
  21639. if (nodeName2 === 'svg') {
  21640. return true;
  21641. }
  21642. return !!closest_default(virtualNode, 'svg');
  21643. } catch (e) {
  21644. return false;
  21645. }
  21646. }
  21647. var svg_namespace_matches_default = svgNamespaceMatches;
  21648. function htmlNamespaceMatches(node, virtualNode) {
  21649. return !svg_namespace_matches_default(node, virtualNode);
  21650. }
  21651. var html_namespace_matches_default = htmlNamespaceMatches;
  21652. function identicalLinksSamePurposeMatches(node, virtualNode) {
  21653. var hasAccName = !!accessible_text_virtual_default(virtualNode);
  21654. if (!hasAccName) {
  21655. return false;
  21656. }
  21657. var role = get_role_default(node);
  21658. if (role && role !== 'link') {
  21659. return false;
  21660. }
  21661. return true;
  21662. }
  21663. var identical_links_same_purpose_matches_default = identicalLinksSamePurposeMatches;
  21664. function insertedIntoFocusOrderMatches(node) {
  21665. return inserted_into_focus_order_default(node);
  21666. }
  21667. var inserted_into_focus_order_matches_default = insertedIntoFocusOrderMatches;
  21668. function hasVisibleTextMatches(node) {
  21669. return _isVisibleOnScreen(node);
  21670. }
  21671. function isVisibleOnScreenMatches(node, virtualNode) {
  21672. return _isVisibleOnScreen(virtualNode);
  21673. }
  21674. function labelContentNameMismatchMatches(node, virtualNode) {
  21675. var role = get_role_default(node);
  21676. if (!role) {
  21677. return false;
  21678. }
  21679. var widgetRoles = get_aria_roles_by_type_default('widget');
  21680. var isWidgetType2 = widgetRoles.includes(role);
  21681. if (!isWidgetType2) {
  21682. return false;
  21683. }
  21684. var rolesWithNameFromContents = get_aria_roles_supporting_name_from_content_default();
  21685. if (!rolesWithNameFromContents.includes(role)) {
  21686. return false;
  21687. }
  21688. if (!sanitize_default(arialabel_text_default(virtualNode)) && !sanitize_default(arialabelledby_text_default(node))) {
  21689. return false;
  21690. }
  21691. if (!sanitize_default(visible_virtual_default(virtualNode))) {
  21692. return false;
  21693. }
  21694. return true;
  21695. }
  21696. var label_content_name_mismatch_matches_default = labelContentNameMismatchMatches;
  21697. function labelMatches(node, virtualNode) {
  21698. if (virtualNode.props.nodeName !== 'input' || virtualNode.hasAttr('type') === false) {
  21699. return true;
  21700. }
  21701. var type = virtualNode.attr('type').toLowerCase();
  21702. return [ 'hidden', 'image', 'button', 'submit', 'reset' ].includes(type) === false;
  21703. }
  21704. var label_matches_default = labelMatches;
  21705. function landmarkHasBodyContextMatches(node, virtualNode) {
  21706. var nativeScopeFilter = 'article, aside, main, nav, section';
  21707. return node.hasAttribute('role') || !find_up_virtual_default(virtualNode, nativeScopeFilter);
  21708. }
  21709. var landmark_has_body_context_matches_default = landmarkHasBodyContextMatches;
  21710. function landmarkUniqueMatches(node, virtualNode) {
  21711. var excludedParentsForHeaderFooterLandmarks = [ 'article', 'aside', 'main', 'nav', 'section' ].join(',');
  21712. function isHeaderFooterLandmark(headerFooterElement) {
  21713. return !closest_default(headerFooterElement, excludedParentsForHeaderFooterLandmarks);
  21714. }
  21715. function isLandmarkVirtual(virtualNode2) {
  21716. var actualNode = virtualNode2.actualNode;
  21717. var landmarkRoles3 = get_aria_roles_by_type_default('landmark');
  21718. var role = get_role_default(actualNode);
  21719. if (!role) {
  21720. return false;
  21721. }
  21722. var nodeName2 = actualNode.nodeName.toUpperCase();
  21723. if (nodeName2 === 'HEADER' || nodeName2 === 'FOOTER') {
  21724. return isHeaderFooterLandmark(virtualNode2);
  21725. }
  21726. if (nodeName2 === 'SECTION' || nodeName2 === 'FORM') {
  21727. var accessibleText2 = accessible_text_virtual_default(virtualNode2);
  21728. return !!accessibleText2;
  21729. }
  21730. return landmarkRoles3.indexOf(role) >= 0 || role === 'region';
  21731. }
  21732. return isLandmarkVirtual(virtualNode) && _isVisibleToScreenReaders(node);
  21733. }
  21734. var landmark_unique_matches_default = landmarkUniqueMatches;
  21735. function dataTableMatches2(node) {
  21736. return !is_data_table_default(node) && !_isFocusable(node);
  21737. }
  21738. var layout_table_matches_default = dataTableMatches2;
  21739. function linkInTextBlockMatches(node) {
  21740. var text = sanitize_default(node.innerText);
  21741. var role = node.getAttribute('role');
  21742. if (role && role !== 'link') {
  21743. return false;
  21744. }
  21745. if (!text) {
  21746. return false;
  21747. }
  21748. if (!_isVisibleOnScreen(node)) {
  21749. return false;
  21750. }
  21751. return is_in_text_block_default(node);
  21752. }
  21753. var link_in_text_block_matches_default = linkInTextBlockMatches;
  21754. function nestedInteractiveMatches(node, virtualNode) {
  21755. var role = get_role_default(virtualNode);
  21756. if (!role) {
  21757. return false;
  21758. }
  21759. return !!standards_default.ariaRoles[role].childrenPresentational;
  21760. }
  21761. var nested_interactive_matches_default = nestedInteractiveMatches;
  21762. function noAutoplayAudioMatches(node) {
  21763. if (!node.currentSrc) {
  21764. return false;
  21765. }
  21766. if (node.hasAttribute('paused') || node.hasAttribute('muted')) {
  21767. return false;
  21768. }
  21769. return true;
  21770. }
  21771. var no_autoplay_audio_matches_default = noAutoplayAudioMatches;
  21772. function noEmptyRoleMatches(node, virtualNode) {
  21773. if (!virtualNode.hasAttr('role')) {
  21774. return false;
  21775. }
  21776. if (!virtualNode.attr('role').trim()) {
  21777. return false;
  21778. }
  21779. return true;
  21780. }
  21781. var no_empty_role_matches_default = noEmptyRoleMatches;
  21782. function noExplicitNameRequired(node, virtualNode) {
  21783. var role = get_explicit_role_default(virtualNode);
  21784. if (!role || [ 'none', 'presentation' ].includes(role)) {
  21785. return true;
  21786. }
  21787. var _ref116 = aria_roles_default[role] || {}, accessibleNameRequired = _ref116.accessibleNameRequired;
  21788. if (accessibleNameRequired || _isFocusable(virtualNode)) {
  21789. return true;
  21790. }
  21791. return false;
  21792. }
  21793. var no_explicit_name_required_matches_default = noExplicitNameRequired;
  21794. function noNamingMethodMatches(node, virtualNode) {
  21795. var _get_element_spec_def3 = get_element_spec_default(virtualNode), namingMethods = _get_element_spec_def3.namingMethods;
  21796. if (namingMethods && namingMethods.length !== 0) {
  21797. return false;
  21798. }
  21799. if (get_explicit_role_default(virtualNode) === 'combobox' && query_selector_all_default(virtualNode, 'input:not([type="hidden"])').length) {
  21800. return false;
  21801. }
  21802. if (_isComboboxPopup(virtualNode, {
  21803. popupRoles: [ 'listbox' ]
  21804. })) {
  21805. return false;
  21806. }
  21807. return true;
  21808. }
  21809. var no_naming_method_matches_default = noNamingMethodMatches;
  21810. function noNegativeTabindexMatches(node, virtualNode) {
  21811. var tabindex = parseInt(virtualNode.attr('tabindex'), 10);
  21812. return isNaN(tabindex) || tabindex >= 0;
  21813. }
  21814. var no_negative_tabindex_matches_default = noNegativeTabindexMatches;
  21815. function noRoleMatches(node, vNode) {
  21816. return !vNode.attr('role');
  21817. }
  21818. var no_role_matches_default = noRoleMatches;
  21819. function notHtmlMatches(node, virtualNode) {
  21820. return virtualNode.props.nodeName !== 'html';
  21821. }
  21822. var not_html_matches_default = notHtmlMatches;
  21823. var object_is_loaded_matches_default = function object_is_loaded_matches_default(node, vNode) {
  21824. return [ no_explicit_name_required_matches_default, objectHasLoaded ].every(function(fn) {
  21825. return fn(node, vNode);
  21826. });
  21827. };
  21828. function objectHasLoaded(node) {
  21829. var _node$ownerDocument;
  21830. if (!(node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.createRange)) {
  21831. return true;
  21832. }
  21833. var range = node.ownerDocument.createRange();
  21834. range.setStart(node, 0);
  21835. range.setEnd(node, node.childNodes.length);
  21836. return range.getClientRects().length === 0;
  21837. }
  21838. function pAsHeadingMatches(node) {
  21839. var children = Array.from(node.parentNode.childNodes);
  21840. var nodeText = node.textContent.trim();
  21841. var isSentence = /[.!?:;](?![.!?:;])/g;
  21842. if (nodeText.length === 0 || (nodeText.match(isSentence) || []).length >= 2) {
  21843. return false;
  21844. }
  21845. var siblingsAfter = children.slice(children.indexOf(node) + 1).filter(function(elm) {
  21846. return elm.nodeName.toUpperCase() === 'P' && elm.textContent.trim() !== '';
  21847. });
  21848. return siblingsAfter.length !== 0;
  21849. }
  21850. var p_as_heading_matches_default = pAsHeadingMatches;
  21851. function presentationRoleConflictMatches(node, virtualNode) {
  21852. return implicit_role_default(virtualNode, {
  21853. chromiumRoles: true
  21854. }) !== null;
  21855. }
  21856. var presentation_role_conflict_matches_default = presentationRoleConflictMatches;
  21857. function scrollableRegionFocusableMatches(node, virtualNode) {
  21858. return _getScroll(node, 13) !== void 0 && _isComboboxPopup(virtualNode) === false && isNoneEmptyElement(virtualNode);
  21859. }
  21860. function isNoneEmptyElement(vNode) {
  21861. return query_selector_all_default(vNode, '*').some(function(elm) {
  21862. return has_content_virtual_default(elm, true, true);
  21863. });
  21864. }
  21865. function skipLinkMatches(node) {
  21866. return _isSkipLink(node) && is_offscreen_default(node);
  21867. }
  21868. var skip_link_matches_default = skipLinkMatches;
  21869. function tableOrGridRoleMatches(_, vNode) {
  21870. var role = get_role_default(vNode);
  21871. return [ 'treegrid', 'grid', 'table' ].includes(role);
  21872. }
  21873. function widgetNotInline(node, vNode) {
  21874. return matchesFns.every(function(fn) {
  21875. return fn(node, vNode);
  21876. });
  21877. }
  21878. var matchesFns = [ function(node, vNode) {
  21879. return isWidgetType(vNode);
  21880. }, function(node, vNode) {
  21881. return isNotAreaElement(vNode);
  21882. }, function(node, vNode) {
  21883. return !svg_namespace_matches_default(node, vNode);
  21884. }, function(node, vNode) {
  21885. return _isFocusable(vNode);
  21886. }, function(node, vNode) {
  21887. return _isInTabOrder(vNode) || !hasWidgetAncestorInTabOrder(vNode);
  21888. }, function(node) {
  21889. return !is_in_text_block_default(node, {
  21890. noLengthCompare: true
  21891. });
  21892. } ];
  21893. function isWidgetType(vNode) {
  21894. return get_role_type_default(vNode) === 'widget';
  21895. }
  21896. function isNotAreaElement(vNode) {
  21897. return vNode.props.nodeName !== 'area';
  21898. }
  21899. var hasWidgetAncestorInTabOrder = memoize_default(function hasWidgetAncestorInTabOrderMemoized(vNode) {
  21900. if (!(vNode !== null && vNode !== void 0 && vNode.parent)) {
  21901. return false;
  21902. }
  21903. if (isWidgetType(vNode.parent) && _isInTabOrder(vNode.parent)) {
  21904. return true;
  21905. }
  21906. return hasWidgetAncestorInTabOrderMemoized(vNode.parent);
  21907. });
  21908. function windowIsTopMatches(node) {
  21909. return node.ownerDocument.defaultView.self === node.ownerDocument.defaultView.top;
  21910. }
  21911. var window_is_top_matches_default = windowIsTopMatches;
  21912. function xmlLangMismatchMatches(node) {
  21913. var primaryLangValue = get_base_lang_default(node.getAttribute('lang'));
  21914. var primaryXmlLangValue = get_base_lang_default(node.getAttribute('xml:lang'));
  21915. return valid_langs_default(primaryLangValue) && valid_langs_default(primaryXmlLangValue);
  21916. }
  21917. var xml_lang_mismatch_matches_default = xmlLangMismatchMatches;
  21918. var metadataFunctionMap = {
  21919. 'abstractrole-evaluate': abstractrole_evaluate_default,
  21920. 'accesskeys-after': accesskeys_after_default,
  21921. 'accesskeys-evaluate': accesskeys_evaluate_default,
  21922. 'alt-space-value-evaluate': alt_space_value_evaluate_default,
  21923. 'aria-allowed-attr-evaluate': ariaAllowedAttrEvaluate,
  21924. 'aria-allowed-attr-matches': aria_allowed_attr_matches_default,
  21925. 'aria-allowed-role-evaluate': aria_allowed_role_evaluate_default,
  21926. 'aria-allowed-role-matches': aria_allowed_role_matches_default,
  21927. 'aria-busy-evaluate': ariaBusyEvaluate,
  21928. 'aria-errormessage-evaluate': aria_errormessage_evaluate_default,
  21929. 'aria-has-attr-matches': aria_has_attr_matches_default,
  21930. 'aria-hidden-body-evaluate': aria_hidden_body_evaluate_default,
  21931. 'aria-hidden-focus-matches': aria_hidden_focus_matches_default,
  21932. 'aria-label-evaluate': aria_label_evaluate_default,
  21933. 'aria-labelledby-evaluate': aria_labelledby_evaluate_default,
  21934. 'aria-level-evaluate': aria_level_evaluate_default,
  21935. 'aria-prohibited-attr-evaluate': ariaProhibitedAttrEvaluate,
  21936. 'aria-required-attr-evaluate': ariaRequiredAttrEvaluate,
  21937. 'aria-required-children-evaluate': ariaRequiredChildrenEvaluate,
  21938. 'aria-required-children-matches': aria_required_children_matches_default,
  21939. 'aria-required-parent-evaluate': aria_required_parent_evaluate_default,
  21940. 'aria-required-parent-matches': aria_required_parent_matches_default,
  21941. 'aria-roledescription-evaluate': aria_roledescription_evaluate_default,
  21942. 'aria-unsupported-attr-evaluate': aria_unsupported_attr_evaluate_default,
  21943. 'aria-valid-attr-evaluate': aria_valid_attr_evaluate_default,
  21944. 'aria-valid-attr-value-evaluate': ariaValidAttrValueEvaluate,
  21945. 'attr-non-space-content-evaluate': attr_non_space_content_evaluate_default,
  21946. 'autocomplete-appropriate-evaluate': autocomplete_appropriate_evaluate_default,
  21947. 'autocomplete-matches': autocomplete_matches_default,
  21948. 'autocomplete-valid-evaluate': autocomplete_valid_evaluate_default,
  21949. 'avoid-inline-spacing-evaluate': avoid_inline_spacing_evaluate_default,
  21950. 'bypass-matches': bypass_matches_default,
  21951. 'caption-evaluate': caption_evaluate_default,
  21952. 'caption-faked-evaluate': caption_faked_evaluate_default,
  21953. 'color-contrast-evaluate': colorContrastEvaluate,
  21954. 'color-contrast-matches': color_contrast_matches_default,
  21955. 'css-orientation-lock-evaluate': css_orientation_lock_evaluate_default,
  21956. 'data-table-large-matches': data_table_large_matches_default,
  21957. 'data-table-matches': data_table_matches_default,
  21958. 'deprecatedrole-evaluate': deprecatedroleEvaluate,
  21959. 'dlitem-evaluate': dlitem_evaluate_default,
  21960. 'doc-has-title-evaluate': doc_has_title_evaluate_default,
  21961. 'duplicate-id-active-matches': duplicate_id_active_matches_default,
  21962. 'duplicate-id-after': duplicate_id_after_default,
  21963. 'duplicate-id-aria-matches': duplicate_id_aria_matches_default,
  21964. 'duplicate-id-evaluate': duplicate_id_evaluate_default,
  21965. 'duplicate-id-misc-matches': duplicate_id_misc_matches_default,
  21966. 'duplicate-img-label-evaluate': duplicate_img_label_evaluate_default,
  21967. 'exists-evaluate': exists_evaluate_default,
  21968. 'explicit-evaluate': explicit_evaluate_default,
  21969. 'fallbackrole-evaluate': fallbackrole_evaluate_default,
  21970. 'focusable-content-evaluate': focusable_content_evaluate_default,
  21971. 'focusable-disabled-evaluate': focusable_disabled_evaluate_default,
  21972. 'focusable-element-evaluate': focusable_element_evaluate_default,
  21973. 'focusable-modal-open-evaluate': focusable_modal_open_evaluate_default,
  21974. 'focusable-no-name-evaluate': focusable_no_name_evaluate_default,
  21975. 'focusable-not-tabbable-evaluate': focusable_not_tabbable_evaluate_default,
  21976. 'frame-focusable-content-evaluate': frameFocusableContentEvaluate,
  21977. 'frame-focusable-content-matches': frame_focusable_content_matches_default,
  21978. 'frame-tested-after': frame_tested_after_default,
  21979. 'frame-tested-evaluate': frame_tested_evaluate_default,
  21980. 'frame-title-has-text-matches': frame_title_has_text_matches_default,
  21981. 'has-alt-evaluate': has_alt_evaluate_default,
  21982. 'has-descendant-after': has_descendant_after_default,
  21983. 'has-descendant-evaluate': has_descendant_evaluate_default,
  21984. 'has-global-aria-attribute-evaluate': has_global_aria_attribute_evaluate_default,
  21985. 'has-implicit-chromium-role-matches': has_implicit_chromium_role_matches_default,
  21986. 'has-lang-evaluate': has_lang_evaluate_default,
  21987. 'has-text-content-evaluate': hasTextContentEvaluate,
  21988. 'has-widget-role-evaluate': has_widget_role_evaluate_default,
  21989. 'heading-matches': headingMatches,
  21990. 'heading-order-after': headingOrderAfter,
  21991. 'heading-order-evaluate': heading_order_evaluate_default,
  21992. 'help-same-as-label-evaluate': help_same_as_label_evaluate_default,
  21993. 'hidden-content-evaluate': hidden_content_evaluate_default,
  21994. 'hidden-explicit-label-evaluate': hidden_explicit_label_evaluate_default,
  21995. 'html-namespace-matches': html_namespace_matches_default,
  21996. 'html5-scope-evaluate': html5_scope_evaluate_default,
  21997. 'identical-links-same-purpose-after': identical_links_same_purpose_after_default,
  21998. 'identical-links-same-purpose-evaluate': identical_links_same_purpose_evaluate_default,
  21999. 'identical-links-same-purpose-matches': identical_links_same_purpose_matches_default,
  22000. 'implicit-evaluate': implicit_evaluate_default,
  22001. 'inline-style-property-evaluate': inlineStyleProperty,
  22002. 'inserted-into-focus-order-matches': inserted_into_focus_order_matches_default,
  22003. 'internal-link-present-evaluate': internal_link_present_evaluate_default,
  22004. 'invalid-children-evaluate': invalidChildrenEvaluate,
  22005. 'invalidrole-evaluate': invalidrole_evaluate_default,
  22006. 'is-element-focusable-evaluate': is_element_focusable_evaluate_default,
  22007. 'is-initiator-matches': is_initiator_matches_default,
  22008. 'is-on-screen-evaluate': is_on_screen_evaluate_default,
  22009. 'is-visible-matches': hasVisibleTextMatches,
  22010. 'is-visible-on-screen-matches': isVisibleOnScreenMatches,
  22011. 'label-content-name-mismatch-evaluate': label_content_name_mismatch_evaluate_default,
  22012. 'label-content-name-mismatch-matches': label_content_name_mismatch_matches_default,
  22013. 'label-matches': label_matches_default,
  22014. 'landmark-has-body-context-matches': landmark_has_body_context_matches_default,
  22015. 'landmark-is-top-level-evaluate': landmark_is_top_level_evaluate_default,
  22016. 'landmark-is-unique-after': landmark_is_unique_after_default,
  22017. 'landmark-is-unique-evaluate': landmark_is_unique_evaluate_default,
  22018. 'landmark-unique-matches': landmark_unique_matches_default,
  22019. 'layout-table-matches': layout_table_matches_default,
  22020. 'link-in-text-block-evaluate': link_in_text_block_evaluate_default,
  22021. 'link-in-text-block-matches': link_in_text_block_matches_default,
  22022. 'link-in-text-block-style-evaluate': link_in_text_block_style_evaluate_default,
  22023. 'listitem-evaluate': listitemEvaluate,
  22024. 'matches-definition-evaluate': matches_definition_evaluate_default,
  22025. 'meta-refresh-evaluate': metaRefreshEvaluate,
  22026. 'meta-viewport-scale-evaluate': meta_viewport_scale_evaluate_default,
  22027. 'multiple-label-evaluate': multiple_label_evaluate_default,
  22028. 'nested-interactive-matches': nested_interactive_matches_default,
  22029. 'no-autoplay-audio-evaluate': no_autoplay_audio_evaluate_default,
  22030. 'no-autoplay-audio-matches': no_autoplay_audio_matches_default,
  22031. 'no-empty-role-matches': no_empty_role_matches_default,
  22032. 'no-explicit-name-required-matches': no_explicit_name_required_matches_default,
  22033. 'no-focusable-content-evaluate': noFocusableContentEvaluate,
  22034. 'no-implicit-explicit-label-evaluate': no_implicit_explicit_label_evaluate_default,
  22035. 'no-naming-method-matches': no_naming_method_matches_default,
  22036. 'no-negative-tabindex-matches': no_negative_tabindex_matches_default,
  22037. 'no-role-matches': no_role_matches_default,
  22038. 'non-empty-if-present-evaluate': non_empty_if_present_evaluate_default,
  22039. 'not-html-matches': not_html_matches_default,
  22040. 'object-is-loaded-matches': object_is_loaded_matches_default,
  22041. 'only-dlitems-evaluate': only_dlitems_evaluate_default,
  22042. 'only-listitems-evaluate': only_listitems_evaluate_default,
  22043. 'p-as-heading-evaluate': p_as_heading_evaluate_default,
  22044. 'p-as-heading-matches': p_as_heading_matches_default,
  22045. 'page-no-duplicate-after': page_no_duplicate_after_default,
  22046. 'page-no-duplicate-evaluate': page_no_duplicate_evaluate_default,
  22047. 'presentation-role-conflict-matches': presentation_role_conflict_matches_default,
  22048. 'presentational-role-evaluate': presentationalRoleEvaluate,
  22049. 'region-after': region_after_default,
  22050. 'region-evaluate': regionEvaluate,
  22051. 'same-caption-summary-evaluate': same_caption_summary_evaluate_default,
  22052. 'scope-value-evaluate': scope_value_evaluate_default,
  22053. 'scrollable-region-focusable-matches': scrollableRegionFocusableMatches,
  22054. 'skip-link-evaluate': skip_link_evaluate_default,
  22055. 'skip-link-matches': skip_link_matches_default,
  22056. 'structured-dlitems-evaluate': structured_dlitems_evaluate_default,
  22057. 'svg-namespace-matches': svg_namespace_matches_default,
  22058. 'svg-non-empty-title-evaluate': svg_non_empty_title_evaluate_default,
  22059. 'tabindex-evaluate': tabindex_evaluate_default,
  22060. 'table-or-grid-role-matches': tableOrGridRoleMatches,
  22061. 'target-offset-evaluate': targetOffsetEvaluate,
  22062. 'target-size-evaluate': targetSize,
  22063. 'td-has-header-evaluate': td_has_header_evaluate_default,
  22064. 'td-headers-attr-evaluate': td_headers_attr_evaluate_default,
  22065. 'th-has-data-cells-evaluate': th_has_data_cells_evaluate_default,
  22066. 'title-only-evaluate': title_only_evaluate_default,
  22067. 'unique-frame-title-after': unique_frame_title_after_default,
  22068. 'unique-frame-title-evaluate': unique_frame_title_evaluate_default,
  22069. 'unsupportedrole-evaluate': unsupportedrole_evaluate_default,
  22070. 'valid-lang-evaluate': valid_lang_evaluate_default,
  22071. 'valid-scrollable-semantics-evaluate': valid_scrollable_semantics_evaluate_default,
  22072. 'widget-not-inline-matches': widgetNotInline,
  22073. 'window-is-top-matches': window_is_top_matches_default,
  22074. 'xml-lang-mismatch-evaluate': xml_lang_mismatch_evaluate_default,
  22075. 'xml-lang-mismatch-matches': xml_lang_mismatch_matches_default
  22076. };
  22077. var metadata_function_map_default = metadataFunctionMap;
  22078. function CheckResult(check) {
  22079. this.id = check.id;
  22080. this.data = null;
  22081. this.relatedNodes = [];
  22082. this.result = null;
  22083. }
  22084. var check_result_default = CheckResult;
  22085. function createExecutionContext(spec) {
  22086. if (typeof spec === 'string') {
  22087. if (metadata_function_map_default[spec]) {
  22088. return metadata_function_map_default[spec];
  22089. }
  22090. if (/^\s*function[\s\w]*\(/.test(spec)) {
  22091. return new Function('return ' + spec + ';')();
  22092. }
  22093. throw new ReferenceError('Function ID does not exist in the metadata-function-map: '.concat(spec));
  22094. }
  22095. return spec;
  22096. }
  22097. function normalizeOptions() {
  22098. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  22099. if (Array.isArray(options) || _typeof(options) !== 'object') {
  22100. options = {
  22101. value: options
  22102. };
  22103. }
  22104. return options;
  22105. }
  22106. function Check(spec) {
  22107. if (spec) {
  22108. this.id = spec.id;
  22109. this.configure(spec);
  22110. }
  22111. }
  22112. Check.prototype.enabled = true;
  22113. Check.prototype.run = function run(node, options, context, resolve, reject) {
  22114. options = options || {};
  22115. var enabled = options.hasOwnProperty('enabled') ? options.enabled : this.enabled;
  22116. var checkOptions = this.getOptions(options.options);
  22117. if (enabled) {
  22118. var checkResult = new check_result_default(this);
  22119. var helper = check_helper_default(checkResult, options, resolve, reject);
  22120. var result;
  22121. try {
  22122. result = this.evaluate.call(helper, node.actualNode, checkOptions, node, context);
  22123. } catch (e) {
  22124. if (node && node.actualNode) {
  22125. e.errorNode = new dq_element_default(node).toJSON();
  22126. }
  22127. reject(e);
  22128. return;
  22129. }
  22130. if (!helper.isAsync) {
  22131. checkResult.result = result;
  22132. resolve(checkResult);
  22133. }
  22134. } else {
  22135. resolve(null);
  22136. }
  22137. };
  22138. Check.prototype.runSync = function runSync(node, options, context) {
  22139. options = options || {};
  22140. var _options = options, _options$enabled = _options.enabled, enabled = _options$enabled === void 0 ? this.enabled : _options$enabled;
  22141. if (!enabled) {
  22142. return null;
  22143. }
  22144. var checkOptions = this.getOptions(options.options);
  22145. var checkResult = new check_result_default(this);
  22146. var helper = check_helper_default(checkResult, options);
  22147. helper.async = function async() {
  22148. throw new Error('Cannot run async check while in a synchronous run');
  22149. };
  22150. var result;
  22151. try {
  22152. result = this.evaluate.call(helper, node.actualNode, checkOptions, node, context);
  22153. } catch (e) {
  22154. if (node && node.actualNode) {
  22155. e.errorNode = new dq_element_default(node).toJSON();
  22156. }
  22157. throw e;
  22158. }
  22159. checkResult.result = result;
  22160. return checkResult;
  22161. };
  22162. Check.prototype.configure = function configure2(spec) {
  22163. var _this5 = this;
  22164. if (!spec.evaluate || metadata_function_map_default[spec.evaluate]) {
  22165. this._internalCheck = true;
  22166. }
  22167. if (spec.hasOwnProperty('enabled')) {
  22168. this.enabled = spec.enabled;
  22169. }
  22170. if (spec.hasOwnProperty('options')) {
  22171. if (this._internalCheck) {
  22172. this.options = normalizeOptions(spec.options);
  22173. } else {
  22174. this.options = spec.options;
  22175. }
  22176. }
  22177. [ 'evaluate', 'after' ].filter(function(prop) {
  22178. return spec.hasOwnProperty(prop);
  22179. }).forEach(function(prop) {
  22180. return _this5[prop] = createExecutionContext(spec[prop]);
  22181. });
  22182. };
  22183. Check.prototype.getOptions = function getOptions(options) {
  22184. if (this._internalCheck) {
  22185. return deep_merge_default(this.options, normalizeOptions(options || {}));
  22186. } else {
  22187. return options || this.options;
  22188. }
  22189. };
  22190. var check_default = Check;
  22191. function RuleResult(rule) {
  22192. this.id = rule.id;
  22193. this.result = constants_default.NA;
  22194. this.pageLevel = rule.pageLevel;
  22195. this.impact = null;
  22196. this.nodes = [];
  22197. }
  22198. var rule_result_default = RuleResult;
  22199. function Rule(spec, parentAudit) {
  22200. this._audit = parentAudit;
  22201. this.id = spec.id;
  22202. this.selector = spec.selector || '*';
  22203. if (spec.impact) {
  22204. assert_default(constants_default.impact.includes(spec.impact), 'Impact '.concat(spec.impact, ' is not a valid impact'));
  22205. this.impact = spec.impact;
  22206. }
  22207. this.excludeHidden = typeof spec.excludeHidden === 'boolean' ? spec.excludeHidden : true;
  22208. this.enabled = typeof spec.enabled === 'boolean' ? spec.enabled : true;
  22209. this.pageLevel = typeof spec.pageLevel === 'boolean' ? spec.pageLevel : false;
  22210. this.reviewOnFail = typeof spec.reviewOnFail === 'boolean' ? spec.reviewOnFail : false;
  22211. this.any = spec.any || [];
  22212. this.all = spec.all || [];
  22213. this.none = spec.none || [];
  22214. this.tags = spec.tags || [];
  22215. this.preload = spec.preload ? true : false;
  22216. this.actIds = spec.actIds;
  22217. if (spec.matches) {
  22218. this.matches = createExecutionContext(spec.matches);
  22219. }
  22220. }
  22221. Rule.prototype.matches = function matches3() {
  22222. return true;
  22223. };
  22224. Rule.prototype.gather = function gather(context) {
  22225. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22226. var markStart = 'mark_gather_start_' + this.id;
  22227. var markEnd = 'mark_gather_end_' + this.id;
  22228. var markHiddenStart = 'mark_isVisibleToScreenReaders_start_' + this.id;
  22229. var markHiddenEnd = 'mark_isVisibleToScreenReaders_end_' + this.id;
  22230. if (options.performanceTimer) {
  22231. performance_timer_default.mark(markStart);
  22232. }
  22233. var elements = _select(this.selector, context);
  22234. if (this.excludeHidden) {
  22235. if (options.performanceTimer) {
  22236. performance_timer_default.mark(markHiddenStart);
  22237. }
  22238. elements = elements.filter(function(element) {
  22239. return _isVisibleToScreenReaders(element);
  22240. });
  22241. if (options.performanceTimer) {
  22242. performance_timer_default.mark(markHiddenEnd);
  22243. performance_timer_default.measure('rule_' + this.id + '#gather_axe.utils.isVisibleToScreenReaders', markHiddenStart, markHiddenEnd);
  22244. }
  22245. }
  22246. if (options.performanceTimer) {
  22247. performance_timer_default.mark(markEnd);
  22248. performance_timer_default.measure('rule_' + this.id + '#gather', markStart, markEnd);
  22249. }
  22250. return elements;
  22251. };
  22252. Rule.prototype.runChecks = function runChecks(type, node, options, context, resolve, reject) {
  22253. var self2 = this;
  22254. var checkQueue = queue_default();
  22255. this[type].forEach(function(c) {
  22256. var check = self2._audit.checks[c.id || c];
  22257. var option = get_check_option_default(check, self2.id, options);
  22258. checkQueue.defer(function(res, rej) {
  22259. check.run(node, option, context, res, rej);
  22260. });
  22261. });
  22262. checkQueue.then(function(results) {
  22263. results = results.filter(function(check) {
  22264. return check;
  22265. });
  22266. resolve({
  22267. type: type,
  22268. results: results
  22269. });
  22270. })['catch'](reject);
  22271. };
  22272. Rule.prototype.runChecksSync = function runChecksSync(type, node, options, context) {
  22273. var self2 = this;
  22274. var results = [];
  22275. this[type].forEach(function(c) {
  22276. var check = self2._audit.checks[c.id || c];
  22277. var option = get_check_option_default(check, self2.id, options);
  22278. results.push(check.runSync(node, option, context));
  22279. });
  22280. results = results.filter(function(check) {
  22281. return check;
  22282. });
  22283. return {
  22284. type: type,
  22285. results: results
  22286. };
  22287. };
  22288. Rule.prototype.run = function run2(context) {
  22289. var _this6 = this;
  22290. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22291. var resolve = arguments.length > 2 ? arguments[2] : undefined;
  22292. var reject = arguments.length > 3 ? arguments[3] : undefined;
  22293. if (options.performanceTimer) {
  22294. this._trackPerformance();
  22295. }
  22296. var q = queue_default();
  22297. var ruleResult = new rule_result_default(this);
  22298. var nodes;
  22299. try {
  22300. nodes = this.gatherAndMatchNodes(context, options);
  22301. } catch (error) {
  22302. reject(new SupportError({
  22303. cause: error,
  22304. ruleId: this.id
  22305. }));
  22306. return;
  22307. }
  22308. if (options.performanceTimer) {
  22309. this._logGatherPerformance(nodes);
  22310. }
  22311. nodes.forEach(function(node) {
  22312. q.defer(function(resolveNode, rejectNode) {
  22313. var checkQueue = queue_default();
  22314. [ 'any', 'all', 'none' ].forEach(function(type) {
  22315. checkQueue.defer(function(res, rej) {
  22316. _this6.runChecks(type, node, options, context, res, rej);
  22317. });
  22318. });
  22319. checkQueue.then(function(results) {
  22320. var result = getResult(results);
  22321. if (result) {
  22322. result.node = new dq_element_default(node, options);
  22323. ruleResult.nodes.push(result);
  22324. if (_this6.reviewOnFail) {
  22325. [ 'any', 'all' ].forEach(function(type) {
  22326. result[type].forEach(function(checkResult) {
  22327. if (checkResult.result === false) {
  22328. checkResult.result = void 0;
  22329. }
  22330. });
  22331. });
  22332. result.none.forEach(function(checkResult) {
  22333. if (checkResult.result === true) {
  22334. checkResult.result = void 0;
  22335. }
  22336. });
  22337. }
  22338. }
  22339. resolveNode();
  22340. })['catch'](function(err2) {
  22341. return rejectNode(err2);
  22342. });
  22343. });
  22344. });
  22345. q.defer(function(resolve2) {
  22346. return setTimeout(resolve2, 0);
  22347. });
  22348. if (options.performanceTimer) {
  22349. this._logRulePerformance();
  22350. }
  22351. q.then(function() {
  22352. return resolve(ruleResult);
  22353. })['catch'](function(error) {
  22354. return reject(error);
  22355. });
  22356. };
  22357. Rule.prototype.runSync = function runSync2(context) {
  22358. var _this7 = this;
  22359. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22360. if (options.performanceTimer) {
  22361. this._trackPerformance();
  22362. }
  22363. var ruleResult = new rule_result_default(this);
  22364. var nodes;
  22365. try {
  22366. nodes = this.gatherAndMatchNodes(context, options);
  22367. } catch (error) {
  22368. throw new SupportError({
  22369. cause: error,
  22370. ruleId: this.id
  22371. });
  22372. }
  22373. if (options.performanceTimer) {
  22374. this._logGatherPerformance(nodes);
  22375. }
  22376. nodes.forEach(function(node) {
  22377. var results = [];
  22378. [ 'any', 'all', 'none' ].forEach(function(type) {
  22379. results.push(_this7.runChecksSync(type, node, options, context));
  22380. });
  22381. var result = getResult(results);
  22382. if (result) {
  22383. result.node = node.actualNode ? new dq_element_default(node, options) : null;
  22384. ruleResult.nodes.push(result);
  22385. if (_this7.reviewOnFail) {
  22386. [ 'any', 'all' ].forEach(function(type) {
  22387. result[type].forEach(function(checkResult) {
  22388. if (checkResult.result === false) {
  22389. checkResult.result = void 0;
  22390. }
  22391. });
  22392. });
  22393. result.none.forEach(function(checkResult) {
  22394. if (checkResult.result === true) {
  22395. checkResult.result = void 0;
  22396. }
  22397. });
  22398. }
  22399. }
  22400. });
  22401. if (options.performanceTimer) {
  22402. this._logRulePerformance();
  22403. }
  22404. return ruleResult;
  22405. };
  22406. Rule.prototype._trackPerformance = function _trackPerformance() {
  22407. this._markStart = 'mark_rule_start_' + this.id;
  22408. this._markEnd = 'mark_rule_end_' + this.id;
  22409. this._markChecksStart = 'mark_runchecks_start_' + this.id;
  22410. this._markChecksEnd = 'mark_runchecks_end_' + this.id;
  22411. };
  22412. Rule.prototype._logGatherPerformance = function _logGatherPerformance(nodes) {
  22413. log_default('gather (', nodes.length, '):', performance_timer_default.timeElapsed() + 'ms');
  22414. performance_timer_default.mark(this._markChecksStart);
  22415. };
  22416. Rule.prototype._logRulePerformance = function _logRulePerformance() {
  22417. performance_timer_default.mark(this._markChecksEnd);
  22418. performance_timer_default.mark(this._markEnd);
  22419. performance_timer_default.measure('runchecks_' + this.id, this._markChecksStart, this._markChecksEnd);
  22420. performance_timer_default.measure('rule_' + this.id, this._markStart, this._markEnd);
  22421. };
  22422. function getResult(results) {
  22423. if (results.length) {
  22424. var hasResults = false;
  22425. var result = {};
  22426. results.forEach(function(r) {
  22427. var res = r.results.filter(function(result2) {
  22428. return result2;
  22429. });
  22430. result[r.type] = res;
  22431. if (res.length) {
  22432. hasResults = true;
  22433. }
  22434. });
  22435. if (hasResults) {
  22436. return result;
  22437. }
  22438. return null;
  22439. }
  22440. }
  22441. Rule.prototype.gatherAndMatchNodes = function gatherAndMatchNodes(context, options) {
  22442. var _this8 = this;
  22443. var markMatchesStart = 'mark_matches_start_' + this.id;
  22444. var markMatchesEnd = 'mark_matches_end_' + this.id;
  22445. var nodes = this.gather(context, options);
  22446. if (options.performanceTimer) {
  22447. performance_timer_default.mark(markMatchesStart);
  22448. }
  22449. nodes = nodes.filter(function(node) {
  22450. return _this8.matches(node.actualNode, node, context);
  22451. });
  22452. if (options.performanceTimer) {
  22453. performance_timer_default.mark(markMatchesEnd);
  22454. performance_timer_default.measure('rule_' + this.id + '#matches', markMatchesStart, markMatchesEnd);
  22455. }
  22456. return nodes;
  22457. };
  22458. function findAfterChecks(rule) {
  22459. return get_all_checks_default(rule).map(function(c) {
  22460. var check = rule._audit.checks[c.id || c];
  22461. return check && typeof check.after === 'function' ? check : null;
  22462. }).filter(Boolean);
  22463. }
  22464. function findCheckResults(nodes, checkID) {
  22465. var checkResults = [];
  22466. nodes.forEach(function(nodeResult) {
  22467. var checks = get_all_checks_default(nodeResult);
  22468. checks.forEach(function(checkResult) {
  22469. if (checkResult.id === checkID) {
  22470. checkResult.node = nodeResult.node;
  22471. checkResults.push(checkResult);
  22472. }
  22473. });
  22474. });
  22475. return checkResults;
  22476. }
  22477. function filterChecks(checks) {
  22478. return checks.filter(function(check) {
  22479. return check.filtered !== true;
  22480. });
  22481. }
  22482. function sanitizeNodes(result) {
  22483. var checkTypes2 = [ 'any', 'all', 'none' ];
  22484. var nodes = result.nodes.filter(function(detail) {
  22485. var length = 0;
  22486. checkTypes2.forEach(function(type) {
  22487. detail[type] = filterChecks(detail[type]);
  22488. length += detail[type].length;
  22489. });
  22490. return length > 0;
  22491. });
  22492. if (result.pageLevel && nodes.length) {
  22493. nodes = [ nodes.reduce(function(a, b) {
  22494. if (a) {
  22495. checkTypes2.forEach(function(type) {
  22496. a[type].push.apply(a[type], b[type]);
  22497. });
  22498. return a;
  22499. }
  22500. }) ];
  22501. }
  22502. return nodes;
  22503. }
  22504. Rule.prototype.after = function after(result, options) {
  22505. var _this9 = this;
  22506. var afterChecks = findAfterChecks(this);
  22507. var ruleID = this.id;
  22508. afterChecks.forEach(function(check) {
  22509. var beforeResults = findCheckResults(result.nodes, check.id);
  22510. var option = get_check_option_default(check, ruleID, options);
  22511. var afterResults = check.after(beforeResults, option);
  22512. if (_this9.reviewOnFail) {
  22513. afterResults.forEach(function(checkResult) {
  22514. var changeAnyAllResults = (_this9.any.includes(checkResult.id) || _this9.all.includes(checkResult.id)) && checkResult.result === false;
  22515. var changeNoneResult = _this9.none.includes(checkResult.id) && checkResult.result === true;
  22516. if (changeAnyAllResults || changeNoneResult) {
  22517. checkResult.result = void 0;
  22518. }
  22519. });
  22520. }
  22521. beforeResults.forEach(function(item) {
  22522. delete item.node;
  22523. if (afterResults.indexOf(item) === -1) {
  22524. item.filtered = true;
  22525. }
  22526. });
  22527. });
  22528. result.nodes = sanitizeNodes(result);
  22529. return result;
  22530. };
  22531. Rule.prototype.configure = function configure3(spec) {
  22532. if (spec.hasOwnProperty('selector')) {
  22533. this.selector = spec.selector;
  22534. }
  22535. if (spec.hasOwnProperty('excludeHidden')) {
  22536. this.excludeHidden = typeof spec.excludeHidden === 'boolean' ? spec.excludeHidden : true;
  22537. }
  22538. if (spec.hasOwnProperty('enabled')) {
  22539. this.enabled = typeof spec.enabled === 'boolean' ? spec.enabled : true;
  22540. }
  22541. if (spec.hasOwnProperty('pageLevel')) {
  22542. this.pageLevel = typeof spec.pageLevel === 'boolean' ? spec.pageLevel : false;
  22543. }
  22544. if (spec.hasOwnProperty('reviewOnFail')) {
  22545. this.reviewOnFail = typeof spec.reviewOnFail === 'boolean' ? spec.reviewOnFail : false;
  22546. }
  22547. if (spec.hasOwnProperty('any')) {
  22548. this.any = spec.any;
  22549. }
  22550. if (spec.hasOwnProperty('all')) {
  22551. this.all = spec.all;
  22552. }
  22553. if (spec.hasOwnProperty('none')) {
  22554. this.none = spec.none;
  22555. }
  22556. if (spec.hasOwnProperty('tags')) {
  22557. this.tags = spec.tags;
  22558. }
  22559. if (spec.hasOwnProperty('actIds')) {
  22560. this.actIds = spec.actIds;
  22561. }
  22562. if (spec.hasOwnProperty('matches')) {
  22563. this.matches = createExecutionContext(spec.matches);
  22564. }
  22565. if (spec.impact) {
  22566. assert_default(constants_default.impact.includes(spec.impact), 'Impact '.concat(spec.impact, ' is not a valid impact'));
  22567. this.impact = spec.impact;
  22568. }
  22569. };
  22570. var rule_default = Rule;
  22571. var import_dot2 = __toModule(require_doT());
  22572. var dotRegex = /\{\{.+?\}\}/g;
  22573. function getDefaultOrigin() {
  22574. if (window.origin && window.origin !== 'null') {
  22575. return window.origin;
  22576. }
  22577. if (window.location && window.location.origin && window.location.origin !== 'null') {
  22578. return window.location.origin;
  22579. }
  22580. }
  22581. function getDefaultConfiguration(audit) {
  22582. var config;
  22583. if (audit) {
  22584. config = clone_default(audit);
  22585. config.commons = audit.commons;
  22586. } else {
  22587. config = {};
  22588. }
  22589. config.reporter = config.reporter || null;
  22590. config.noHtml = config.noHtml || false;
  22591. if (!config.allowedOrigins) {
  22592. var defaultOrigin = getDefaultOrigin();
  22593. config.allowedOrigins = defaultOrigin ? [ defaultOrigin ] : [];
  22594. }
  22595. config.rules = config.rules || [];
  22596. config.checks = config.checks || [];
  22597. config.data = _extends({
  22598. checks: {},
  22599. rules: {}
  22600. }, config.data);
  22601. return config;
  22602. }
  22603. function unpackToObject(collection, audit, method) {
  22604. var i, l;
  22605. for (i = 0, l = collection.length; i < l; i++) {
  22606. audit[method](collection[i]);
  22607. }
  22608. }
  22609. var mergeCheckLocale = function mergeCheckLocale(a, b) {
  22610. var pass = b.pass, fail = b.fail;
  22611. if (typeof pass === 'string' && dotRegex.test(pass)) {
  22612. pass = import_dot2['default'].compile(pass);
  22613. }
  22614. if (typeof fail === 'string' && dotRegex.test(fail)) {
  22615. fail = import_dot2['default'].compile(fail);
  22616. }
  22617. return _extends({}, a, {
  22618. messages: {
  22619. pass: pass || a.messages.pass,
  22620. fail: fail || a.messages.fail,
  22621. incomplete: _typeof(a.messages.incomplete) === 'object' ? _extends({}, a.messages.incomplete, b.incomplete) : b.incomplete
  22622. }
  22623. });
  22624. };
  22625. var mergeRuleLocale = function mergeRuleLocale(a, b) {
  22626. var help = b.help, description = b.description;
  22627. if (typeof help === 'string' && dotRegex.test(help)) {
  22628. help = import_dot2['default'].compile(help);
  22629. }
  22630. if (typeof description === 'string' && dotRegex.test(description)) {
  22631. description = import_dot2['default'].compile(description);
  22632. }
  22633. return _extends({}, a, {
  22634. help: help || a.help,
  22635. description: description || a.description
  22636. });
  22637. };
  22638. var mergeFailureMessage = function mergeFailureMessage(a, b) {
  22639. var failureMessage = b.failureMessage;
  22640. if (typeof failureMessage === 'string' && dotRegex.test(failureMessage)) {
  22641. failureMessage = import_dot2['default'].compile(failureMessage);
  22642. }
  22643. return _extends({}, a, {
  22644. failureMessage: failureMessage || a.failureMessage
  22645. });
  22646. };
  22647. var mergeFallbackMessage = function mergeFallbackMessage(a, b) {
  22648. if (typeof b === 'string' && dotRegex.test(b)) {
  22649. b = import_dot2['default'].compile(b);
  22650. }
  22651. return b || a;
  22652. };
  22653. var Audit = function() {
  22654. function Audit(audit) {
  22655. _classCallCheck(this, Audit);
  22656. this.lang = 'en';
  22657. this.defaultConfig = audit;
  22658. this.standards = standards_default;
  22659. this._init();
  22660. this._defaultLocale = null;
  22661. }
  22662. _createClass(Audit, [ {
  22663. key: '_setDefaultLocale',
  22664. value: function _setDefaultLocale() {
  22665. if (this._defaultLocale) {
  22666. return;
  22667. }
  22668. var locale = {
  22669. checks: {},
  22670. rules: {},
  22671. failureSummaries: {},
  22672. incompleteFallbackMessage: '',
  22673. lang: this.lang
  22674. };
  22675. var checkIDs = Object.keys(this.data.checks);
  22676. for (var _i30 = 0; _i30 < checkIDs.length; _i30++) {
  22677. var id = checkIDs[_i30];
  22678. var check = this.data.checks[id];
  22679. var _check$messages = check.messages, pass = _check$messages.pass, fail = _check$messages.fail, incomplete = _check$messages.incomplete;
  22680. locale.checks[id] = {
  22681. pass: pass,
  22682. fail: fail,
  22683. incomplete: incomplete
  22684. };
  22685. }
  22686. var ruleIDs = Object.keys(this.data.rules);
  22687. for (var _i31 = 0; _i31 < ruleIDs.length; _i31++) {
  22688. var _id = ruleIDs[_i31];
  22689. var rule = this.data.rules[_id];
  22690. var description = rule.description, help = rule.help;
  22691. locale.rules[_id] = {
  22692. description: description,
  22693. help: help
  22694. };
  22695. }
  22696. var failureSummaries = Object.keys(this.data.failureSummaries);
  22697. for (var _i32 = 0; _i32 < failureSummaries.length; _i32++) {
  22698. var type = failureSummaries[_i32];
  22699. var failureSummary2 = this.data.failureSummaries[type];
  22700. var failureMessage = failureSummary2.failureMessage;
  22701. locale.failureSummaries[type] = {
  22702. failureMessage: failureMessage
  22703. };
  22704. }
  22705. locale.incompleteFallbackMessage = this.data.incompleteFallbackMessage;
  22706. this._defaultLocale = locale;
  22707. }
  22708. }, {
  22709. key: '_resetLocale',
  22710. value: function _resetLocale() {
  22711. var defaultLocale = this._defaultLocale;
  22712. if (!defaultLocale) {
  22713. return;
  22714. }
  22715. this.applyLocale(defaultLocale);
  22716. }
  22717. }, {
  22718. key: '_applyCheckLocale',
  22719. value: function _applyCheckLocale(checks) {
  22720. var keys = Object.keys(checks);
  22721. for (var _i33 = 0; _i33 < keys.length; _i33++) {
  22722. var id = keys[_i33];
  22723. if (!this.data.checks[id]) {
  22724. throw new Error('Locale provided for unknown check: "'.concat(id, '"'));
  22725. }
  22726. this.data.checks[id] = mergeCheckLocale(this.data.checks[id], checks[id]);
  22727. }
  22728. }
  22729. }, {
  22730. key: '_applyRuleLocale',
  22731. value: function _applyRuleLocale(rules) {
  22732. var keys = Object.keys(rules);
  22733. for (var _i34 = 0; _i34 < keys.length; _i34++) {
  22734. var id = keys[_i34];
  22735. if (!this.data.rules[id]) {
  22736. throw new Error('Locale provided for unknown rule: "'.concat(id, '"'));
  22737. }
  22738. this.data.rules[id] = mergeRuleLocale(this.data.rules[id], rules[id]);
  22739. }
  22740. }
  22741. }, {
  22742. key: '_applyFailureSummaries',
  22743. value: function _applyFailureSummaries(messages) {
  22744. var keys = Object.keys(messages);
  22745. for (var _i35 = 0; _i35 < keys.length; _i35++) {
  22746. var key = keys[_i35];
  22747. if (!this.data.failureSummaries[key]) {
  22748. throw new Error('Locale provided for unknown failureMessage: "'.concat(key, '"'));
  22749. }
  22750. this.data.failureSummaries[key] = mergeFailureMessage(this.data.failureSummaries[key], messages[key]);
  22751. }
  22752. }
  22753. }, {
  22754. key: 'applyLocale',
  22755. value: function applyLocale(locale) {
  22756. this._setDefaultLocale();
  22757. if (locale.checks) {
  22758. this._applyCheckLocale(locale.checks);
  22759. }
  22760. if (locale.rules) {
  22761. this._applyRuleLocale(locale.rules);
  22762. }
  22763. if (locale.failureSummaries) {
  22764. this._applyFailureSummaries(locale.failureSummaries, 'failureSummaries');
  22765. }
  22766. if (locale.incompleteFallbackMessage) {
  22767. this.data.incompleteFallbackMessage = mergeFallbackMessage(this.data.incompleteFallbackMessage, locale.incompleteFallbackMessage);
  22768. }
  22769. if (locale.lang) {
  22770. this.lang = locale.lang;
  22771. }
  22772. }
  22773. }, {
  22774. key: 'setAllowedOrigins',
  22775. value: function setAllowedOrigins(allowedOrigins) {
  22776. var defaultOrigin = getDefaultOrigin();
  22777. this.allowedOrigins = [];
  22778. var _iterator12 = _createForOfIteratorHelper(allowedOrigins), _step12;
  22779. try {
  22780. for (_iterator12.s(); !(_step12 = _iterator12.n()).done; ) {
  22781. var origin = _step12.value;
  22782. if (origin === constants_default.allOrigins) {
  22783. this.allowedOrigins = [ '*' ];
  22784. return;
  22785. } else if (origin !== constants_default.sameOrigin) {
  22786. this.allowedOrigins.push(origin);
  22787. } else if (defaultOrigin) {
  22788. this.allowedOrigins.push(defaultOrigin);
  22789. }
  22790. }
  22791. } catch (err) {
  22792. _iterator12.e(err);
  22793. } finally {
  22794. _iterator12.f();
  22795. }
  22796. }
  22797. }, {
  22798. key: '_init',
  22799. value: function _init() {
  22800. var audit = getDefaultConfiguration(this.defaultConfig);
  22801. this.lang = audit.lang || 'en';
  22802. this.reporter = audit.reporter;
  22803. this.commands = {};
  22804. this.rules = [];
  22805. this.checks = {};
  22806. this.brand = 'axe';
  22807. this.application = 'axeAPI';
  22808. this.tagExclude = [ 'experimental' ];
  22809. this.noHtml = audit.noHtml;
  22810. this.allowedOrigins = audit.allowedOrigins;
  22811. unpackToObject(audit.rules, this, 'addRule');
  22812. unpackToObject(audit.checks, this, 'addCheck');
  22813. this.data = {};
  22814. this.data.checks = audit.data && audit.data.checks || {};
  22815. this.data.rules = audit.data && audit.data.rules || {};
  22816. this.data.failureSummaries = audit.data && audit.data.failureSummaries || {};
  22817. this.data.incompleteFallbackMessage = audit.data && audit.data.incompleteFallbackMessage || '';
  22818. this._constructHelpUrls();
  22819. }
  22820. }, {
  22821. key: 'registerCommand',
  22822. value: function registerCommand(command) {
  22823. this.commands[command.id] = command.callback;
  22824. }
  22825. }, {
  22826. key: 'addRule',
  22827. value: function addRule(spec) {
  22828. if (spec.metadata) {
  22829. this.data.rules[spec.id] = spec.metadata;
  22830. }
  22831. var rule = this.getRule(spec.id);
  22832. if (rule) {
  22833. rule.configure(spec);
  22834. } else {
  22835. this.rules.push(new rule_default(spec, this));
  22836. }
  22837. }
  22838. }, {
  22839. key: 'addCheck',
  22840. value: function addCheck(spec) {
  22841. var metadata = spec.metadata;
  22842. if (_typeof(metadata) === 'object') {
  22843. this.data.checks[spec.id] = metadata;
  22844. if (_typeof(metadata.messages) === 'object') {
  22845. Object.keys(metadata.messages).filter(function(prop) {
  22846. return metadata.messages.hasOwnProperty(prop) && typeof metadata.messages[prop] === 'string';
  22847. }).forEach(function(prop) {
  22848. if (metadata.messages[prop].indexOf('function') === 0) {
  22849. metadata.messages[prop] = new Function('return ' + metadata.messages[prop] + ';')();
  22850. }
  22851. });
  22852. }
  22853. }
  22854. if (this.checks[spec.id]) {
  22855. this.checks[spec.id].configure(spec);
  22856. } else {
  22857. this.checks[spec.id] = new check_default(spec);
  22858. }
  22859. }
  22860. }, {
  22861. key: 'run',
  22862. value: function run(context, options, resolve, reject) {
  22863. this.normalizeOptions(options);
  22864. axe._selectCache = [];
  22865. var allRulesToRun = getRulesToRun(this.rules, context, options);
  22866. var runNowRules = allRulesToRun.now;
  22867. var runLaterRules = allRulesToRun.later;
  22868. var nowRulesQueue = queue_default();
  22869. runNowRules.forEach(function(rule) {
  22870. nowRulesQueue.defer(getDefferedRule(rule, context, options));
  22871. });
  22872. var preloaderQueue = queue_default();
  22873. if (runLaterRules.length) {
  22874. preloaderQueue.defer(function(resolve2) {
  22875. preload_default(options).then(function(assets) {
  22876. return resolve2(assets);
  22877. })['catch'](function(err2) {
  22878. console.warn('Couldn\'t load preload assets: ', err2);
  22879. resolve2(void 0);
  22880. });
  22881. });
  22882. }
  22883. var queueForNowRulesAndPreloader = queue_default();
  22884. queueForNowRulesAndPreloader.defer(nowRulesQueue);
  22885. queueForNowRulesAndPreloader.defer(preloaderQueue);
  22886. queueForNowRulesAndPreloader.then(function(nowRulesAndPreloaderResults) {
  22887. var assetsFromQueue = nowRulesAndPreloaderResults.pop();
  22888. if (assetsFromQueue && assetsFromQueue.length) {
  22889. var assets = assetsFromQueue[0];
  22890. if (assets) {
  22891. context = _extends({}, context, assets);
  22892. }
  22893. }
  22894. var nowRulesResults = nowRulesAndPreloaderResults[0];
  22895. if (!runLaterRules.length) {
  22896. axe._selectCache = void 0;
  22897. resolve(nowRulesResults.filter(function(result) {
  22898. return !!result;
  22899. }));
  22900. return;
  22901. }
  22902. var laterRulesQueue = queue_default();
  22903. runLaterRules.forEach(function(rule) {
  22904. var deferredRule = getDefferedRule(rule, context, options);
  22905. laterRulesQueue.defer(deferredRule);
  22906. });
  22907. laterRulesQueue.then(function(laterRuleResults) {
  22908. axe._selectCache = void 0;
  22909. resolve(nowRulesResults.concat(laterRuleResults).filter(function(result) {
  22910. return !!result;
  22911. }));
  22912. })['catch'](reject);
  22913. })['catch'](reject);
  22914. }
  22915. }, {
  22916. key: 'after',
  22917. value: function after(results, options) {
  22918. var rules = this.rules;
  22919. return results.map(function(ruleResult) {
  22920. var rule = find_by_default(rules, 'id', ruleResult.id);
  22921. if (!rule) {
  22922. throw new Error('Result for unknown rule. You may be running mismatch axe-core versions');
  22923. }
  22924. return rule.after(ruleResult, options);
  22925. });
  22926. }
  22927. }, {
  22928. key: 'getRule',
  22929. value: function getRule(ruleId) {
  22930. return this.rules.find(function(rule) {
  22931. return rule.id === ruleId;
  22932. });
  22933. }
  22934. }, {
  22935. key: 'normalizeOptions',
  22936. value: function normalizeOptions(options) {
  22937. var audit = this;
  22938. var tags = [];
  22939. var ruleIds = [];
  22940. audit.rules.forEach(function(rule) {
  22941. ruleIds.push(rule.id);
  22942. rule.tags.forEach(function(tag) {
  22943. if (!tags.includes(tag)) {
  22944. tags.push(tag);
  22945. }
  22946. });
  22947. });
  22948. if ([ 'object', 'string' ].includes(_typeof(options.runOnly))) {
  22949. if (typeof options.runOnly === 'string') {
  22950. options.runOnly = [ options.runOnly ];
  22951. }
  22952. if (Array.isArray(options.runOnly)) {
  22953. var hasTag = options.runOnly.find(function(value) {
  22954. return tags.includes(value);
  22955. });
  22956. var hasRule = options.runOnly.find(function(value) {
  22957. return ruleIds.includes(value);
  22958. });
  22959. if (hasTag && hasRule) {
  22960. throw new Error('runOnly cannot be both rules and tags');
  22961. }
  22962. if (hasRule) {
  22963. options.runOnly = {
  22964. type: 'rule',
  22965. values: options.runOnly
  22966. };
  22967. } else {
  22968. options.runOnly = {
  22969. type: 'tag',
  22970. values: options.runOnly
  22971. };
  22972. }
  22973. }
  22974. var only = options.runOnly;
  22975. if (only.value && !only.values) {
  22976. only.values = only.value;
  22977. delete only.value;
  22978. }
  22979. if (!Array.isArray(only.values) || only.values.length === 0) {
  22980. throw new Error('runOnly.values must be a non-empty array');
  22981. }
  22982. if ([ 'rule', 'rules' ].includes(only.type)) {
  22983. only.type = 'rule';
  22984. only.values.forEach(function(ruleId) {
  22985. if (!ruleIds.includes(ruleId)) {
  22986. throw new Error('unknown rule `' + ruleId + '` in options.runOnly');
  22987. }
  22988. });
  22989. } else if ([ 'tag', 'tags', void 0 ].includes(only.type)) {
  22990. only.type = 'tag';
  22991. var unmatchedTags = only.values.filter(function(tag) {
  22992. return !tags.includes(tag) && !/wcag2[1-3]a{1,3}/.test(tag);
  22993. });
  22994. if (unmatchedTags.length !== 0) {
  22995. axe.log('Could not find tags `' + unmatchedTags.join('`, `') + '`');
  22996. }
  22997. } else {
  22998. throw new Error('Unknown runOnly type \''.concat(only.type, '\''));
  22999. }
  23000. }
  23001. if (_typeof(options.rules) === 'object') {
  23002. Object.keys(options.rules).forEach(function(ruleId) {
  23003. if (!ruleIds.includes(ruleId)) {
  23004. throw new Error('unknown rule `' + ruleId + '` in options.rules');
  23005. }
  23006. });
  23007. }
  23008. return options;
  23009. }
  23010. }, {
  23011. key: 'setBranding',
  23012. value: function setBranding(branding) {
  23013. var previous = {
  23014. brand: this.brand,
  23015. application: this.application
  23016. };
  23017. if (typeof branding === 'string') {
  23018. this.application = branding;
  23019. }
  23020. if (branding && branding.hasOwnProperty('brand') && branding.brand && typeof branding.brand === 'string') {
  23021. this.brand = branding.brand;
  23022. }
  23023. if (branding && branding.hasOwnProperty('application') && branding.application && typeof branding.application === 'string') {
  23024. this.application = branding.application;
  23025. }
  23026. this._constructHelpUrls(previous);
  23027. }
  23028. }, {
  23029. key: '_constructHelpUrls',
  23030. value: function _constructHelpUrls() {
  23031. var _this10 = this;
  23032. var previous = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  23033. var version = (axe.version.match(/^[1-9][0-9]*\.[0-9]+/) || [ 'x.y' ])[0];
  23034. this.rules.forEach(function(rule) {
  23035. if (!_this10.data.rules[rule.id]) {
  23036. _this10.data.rules[rule.id] = {};
  23037. }
  23038. var metaData = _this10.data.rules[rule.id];
  23039. if (typeof metaData.helpUrl !== 'string' || previous && metaData.helpUrl === getHelpUrl(previous, rule.id, version)) {
  23040. metaData.helpUrl = getHelpUrl(_this10, rule.id, version);
  23041. }
  23042. });
  23043. }
  23044. }, {
  23045. key: 'resetRulesAndChecks',
  23046. value: function resetRulesAndChecks() {
  23047. this._init();
  23048. this._resetLocale();
  23049. }
  23050. } ]);
  23051. return Audit;
  23052. }();
  23053. function getRulesToRun(rules, context, options) {
  23054. var base = {
  23055. now: [],
  23056. later: []
  23057. };
  23058. var splitRules = rules.reduce(function(out, rule) {
  23059. if (!rule_should_run_default(rule, context, options)) {
  23060. return out;
  23061. }
  23062. if (rule.preload) {
  23063. out.later.push(rule);
  23064. return out;
  23065. }
  23066. out.now.push(rule);
  23067. return out;
  23068. }, base);
  23069. return splitRules;
  23070. }
  23071. function getDefferedRule(rule, context, options) {
  23072. if (options.performanceTimer) {
  23073. performance_timer_default.mark('mark_rule_start_' + rule.id);
  23074. }
  23075. return function(resolve, reject) {
  23076. rule.run(context, options, function(ruleResult) {
  23077. resolve(ruleResult);
  23078. }, function(err2) {
  23079. if (!options.debug) {
  23080. var errResult = Object.assign(new rule_result_default(rule), {
  23081. result: constants_default.CANTTELL,
  23082. description: 'An error occured while running this rule',
  23083. message: err2.message,
  23084. stack: err2.stack,
  23085. error: err2,
  23086. errorNode: err2.errorNode
  23087. });
  23088. resolve(errResult);
  23089. } else {
  23090. reject(err2);
  23091. }
  23092. });
  23093. };
  23094. }
  23095. function getHelpUrl(_ref117, ruleId, version) {
  23096. var brand = _ref117.brand, application = _ref117.application, lang = _ref117.lang;
  23097. return constants_default.helpUrlBase + brand + '/' + (version || axe.version.substring(0, axe.version.lastIndexOf('.'))) + '/' + ruleId + '?application=' + encodeURIComponent(application) + (lang && lang !== 'en' ? '&lang=' + encodeURIComponent(lang) : '');
  23098. }
  23099. var audit_default = Audit;
  23100. function setupGlobals(context) {
  23101. var hasWindow = window && 'Node' in window && 'NodeList' in window;
  23102. var hasDoc = !!document;
  23103. if (hasWindow && hasDoc) {
  23104. return;
  23105. }
  23106. if (!context || !context.ownerDocument) {
  23107. throw new Error('Required "window" or "document" globals not defined and cannot be deduced from the context. Either set the globals before running or pass in a valid Element.');
  23108. }
  23109. if (!hasDoc) {
  23110. cache_default.set('globalDocumentSet', true);
  23111. document = context.ownerDocument;
  23112. }
  23113. if (!hasWindow) {
  23114. cache_default.set('globalWindowSet', true);
  23115. window = document.defaultView;
  23116. }
  23117. }
  23118. function resetGlobals() {
  23119. if (cache_default.get('globalDocumentSet')) {
  23120. cache_default.set('globalDocumentSet', false);
  23121. document = null;
  23122. }
  23123. if (cache_default.get('globalWindowSet')) {
  23124. cache_default.set('globalWindowSet', false);
  23125. window = null;
  23126. }
  23127. }
  23128. function teardown() {
  23129. resetGlobals();
  23130. axe._memoizedFns.forEach(function(fn) {
  23131. return fn.clear();
  23132. });
  23133. cache_default.clear();
  23134. axe._tree = void 0;
  23135. axe._selectorData = void 0;
  23136. axe._selectCache = void 0;
  23137. }
  23138. var teardown_default = teardown;
  23139. function runRules(context, options, resolve, reject) {
  23140. try {
  23141. context = new Context(context);
  23142. axe._tree = context.flatTree;
  23143. axe._selectorData = _getSelectorData(context.flatTree);
  23144. } catch (e) {
  23145. teardown_default();
  23146. return reject(e);
  23147. }
  23148. var q = queue_default();
  23149. var audit = axe._audit;
  23150. if (options.performanceTimer) {
  23151. performance_timer_default.auditStart();
  23152. }
  23153. if (context.frames.length && options.iframes !== false) {
  23154. q.defer(function(res, rej) {
  23155. _collectResultsFromFrames(context, options, 'rules', null, res, rej);
  23156. });
  23157. }
  23158. q.defer(function(res, rej) {
  23159. audit.run(context, options, res, rej);
  23160. });
  23161. q.then(function(data2) {
  23162. try {
  23163. if (options.performanceTimer) {
  23164. performance_timer_default.auditEnd();
  23165. }
  23166. var results = merge_results_default(data2.map(function(results2) {
  23167. return {
  23168. results: results2
  23169. };
  23170. }));
  23171. if (context.initiator) {
  23172. results = audit.after(results, options);
  23173. results.forEach(publish_metadata_default);
  23174. results = results.map(finalize_result_default);
  23175. }
  23176. try {
  23177. resolve(results, teardown_default);
  23178. } catch (e) {
  23179. teardown_default();
  23180. log_default(e);
  23181. }
  23182. } catch (e) {
  23183. teardown_default();
  23184. reject(e);
  23185. }
  23186. })['catch'](function(e) {
  23187. teardown_default();
  23188. reject(e);
  23189. });
  23190. }
  23191. var run_rules_default = runRules;
  23192. function runCommand(data2, keepalive, callback) {
  23193. var resolve = callback;
  23194. var reject = function reject2(err2) {
  23195. if (err2 instanceof Error === false) {
  23196. err2 = new Error(err2);
  23197. }
  23198. callback(err2);
  23199. };
  23200. var context = data2 && data2.context || {};
  23201. if (context.hasOwnProperty('include') && !context.include.length) {
  23202. context.include = [ document ];
  23203. }
  23204. var options = data2 && data2.options || {};
  23205. switch (data2.command) {
  23206. case 'rules':
  23207. return run_rules_default(context, options, function(results, cleanup3) {
  23208. resolve(results);
  23209. cleanup3();
  23210. }, reject);
  23211. case 'cleanup-plugin':
  23212. return cleanup_default(resolve, reject);
  23213. default:
  23214. if (axe._audit && axe._audit.commands && axe._audit.commands[data2.command]) {
  23215. return axe._audit.commands[data2.command](data2, callback);
  23216. }
  23217. }
  23218. }
  23219. if (window.top !== window) {
  23220. _respondable.subscribe('axe.start', runCommand);
  23221. _respondable.subscribe('axe.ping', function(data2, keepalive, respond) {
  23222. respond({
  23223. axe: true
  23224. });
  23225. });
  23226. }
  23227. function load(audit) {
  23228. axe._audit = new audit_default(audit);
  23229. }
  23230. var load_default = load;
  23231. function Plugin(spec) {
  23232. this._run = spec.run;
  23233. this._collect = spec.collect;
  23234. this._registry = {};
  23235. spec.commands.forEach(function(command) {
  23236. axe._audit.registerCommand(command);
  23237. });
  23238. }
  23239. Plugin.prototype.run = function run3() {
  23240. return this._run.apply(this, arguments);
  23241. };
  23242. Plugin.prototype.collect = function collect() {
  23243. return this._collect.apply(this, arguments);
  23244. };
  23245. Plugin.prototype.cleanup = function cleanup2(done) {
  23246. var q = axe.utils.queue();
  23247. var that = this;
  23248. Object.keys(this._registry).forEach(function(key) {
  23249. q.defer(function(_done) {
  23250. that._registry[key].cleanup(_done);
  23251. });
  23252. });
  23253. q.then(done);
  23254. };
  23255. Plugin.prototype.add = function add(impl) {
  23256. this._registry[impl.id] = impl;
  23257. };
  23258. function registerPlugin(plugin) {
  23259. axe.plugins[plugin.id] = new Plugin(plugin);
  23260. }
  23261. var plugins_default = registerPlugin;
  23262. function reset() {
  23263. var audit = axe._audit;
  23264. if (!audit) {
  23265. throw new Error('No audit configured');
  23266. }
  23267. audit.resetRulesAndChecks();
  23268. resetStandards();
  23269. }
  23270. var reset_default = reset;
  23271. function runVirtualRule(ruleId, vNode) {
  23272. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  23273. options.reporter = options.reporter || axe._audit.reporter || 'v1';
  23274. axe._selectorData = {};
  23275. if (!(vNode instanceof abstract_virtual_node_default)) {
  23276. vNode = new serial_virtual_node_default(vNode);
  23277. }
  23278. var rule = get_rule_default(ruleId);
  23279. if (!rule) {
  23280. throw new Error('unknown rule `' + ruleId + '`');
  23281. }
  23282. rule = Object.create(rule, {
  23283. excludeHidden: {
  23284. value: false
  23285. }
  23286. });
  23287. var context = {
  23288. initiator: true,
  23289. include: [ vNode ],
  23290. exclude: [],
  23291. frames: [],
  23292. page: false,
  23293. focusable: true,
  23294. size: {},
  23295. flatTree: []
  23296. };
  23297. var rawResults = rule.runSync(context, options);
  23298. publish_metadata_default(rawResults);
  23299. finalize_result_default(rawResults);
  23300. var results = aggregate_result_default([ rawResults ]);
  23301. results.violations.forEach(function(result) {
  23302. return result.nodes.forEach(function(nodeResult) {
  23303. nodeResult.failureSummary = failure_summary_default(nodeResult);
  23304. });
  23305. });
  23306. return _extends({}, _getEnvironmentData(), results, {
  23307. toolOptions: options
  23308. });
  23309. }
  23310. function normalizeRunParams(_ref118) {
  23311. var _ref120, _options$reporter, _axe$_audit;
  23312. var _ref119 = _slicedToArray(_ref118, 3), context = _ref119[0], options = _ref119[1], callback = _ref119[2];
  23313. var typeErr = new TypeError('axe.run arguments are invalid');
  23314. if (!isContextSpec(context)) {
  23315. if (callback !== void 0) {
  23316. throw typeErr;
  23317. }
  23318. callback = options;
  23319. options = context;
  23320. context = document;
  23321. }
  23322. if (_typeof(options) !== 'object') {
  23323. if (callback !== void 0) {
  23324. throw typeErr;
  23325. }
  23326. callback = options;
  23327. options = {};
  23328. }
  23329. if (typeof callback !== 'function' && callback !== void 0) {
  23330. throw typeErr;
  23331. }
  23332. options = clone_default(options);
  23333. options.reporter = (_ref120 = (_options$reporter = options.reporter) !== null && _options$reporter !== void 0 ? _options$reporter : (_axe$_audit = axe._audit) === null || _axe$_audit === void 0 ? void 0 : _axe$_audit.reporter) !== null && _ref120 !== void 0 ? _ref120 : 'v1';
  23334. return {
  23335. context: context,
  23336. options: options,
  23337. callback: callback
  23338. };
  23339. }
  23340. var noop2 = function noop2() {};
  23341. function run4() {
  23342. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  23343. args[_key2] = arguments[_key2];
  23344. }
  23345. setupGlobals(args[0]);
  23346. var _normalizeRunParams = normalizeRunParams(args), context = _normalizeRunParams.context, options = _normalizeRunParams.options, _normalizeRunParams$c = _normalizeRunParams.callback, callback = _normalizeRunParams$c === void 0 ? noop2 : _normalizeRunParams$c;
  23347. var _getPromiseHandlers = getPromiseHandlers(callback), thenable = _getPromiseHandlers.thenable, resolve = _getPromiseHandlers.resolve, reject = _getPromiseHandlers.reject;
  23348. try {
  23349. assert_default(axe._audit, 'No audit configured');
  23350. assert_default(!axe._running, 'Axe is already running. Use `await axe.run()` to wait for the previous run to finish before starting a new run.');
  23351. } catch (e) {
  23352. return handleError(e, callback);
  23353. }
  23354. axe._running = true;
  23355. if (options.performanceTimer) {
  23356. axe.utils.performanceTimer.start();
  23357. }
  23358. function handleRunRules(rawResults, cleanup3) {
  23359. var respond = function respond(results) {
  23360. axe._running = false;
  23361. cleanup3();
  23362. try {
  23363. callback(null, results);
  23364. } catch (e) {
  23365. axe.log(e);
  23366. }
  23367. resolve(results);
  23368. };
  23369. if (options.performanceTimer) {
  23370. axe.utils.performanceTimer.end();
  23371. }
  23372. try {
  23373. createReport(rawResults, options, respond);
  23374. } catch (err2) {
  23375. axe._running = false;
  23376. cleanup3();
  23377. callback(err2);
  23378. reject(err2);
  23379. }
  23380. }
  23381. function errorRunRules(err2) {
  23382. if (options.performanceTimer) {
  23383. axe.utils.performanceTimer.end();
  23384. }
  23385. axe._running = false;
  23386. resetGlobals();
  23387. callback(err2);
  23388. reject(err2);
  23389. }
  23390. axe._runRules(context, options, handleRunRules, errorRunRules);
  23391. return thenable;
  23392. }
  23393. function getPromiseHandlers(callback) {
  23394. var thenable, reject, resolve;
  23395. if (typeof Promise === 'function' && callback === noop2) {
  23396. thenable = new Promise(function(_resolve, _reject) {
  23397. reject = _reject;
  23398. resolve = _resolve;
  23399. });
  23400. } else {
  23401. resolve = reject = noop2;
  23402. }
  23403. return {
  23404. thenable: thenable,
  23405. reject: reject,
  23406. resolve: resolve
  23407. };
  23408. }
  23409. function createReport(rawResults, options, respond) {
  23410. var reporter = getReporter(options.reporter);
  23411. var results = reporter(rawResults, options, respond);
  23412. if (results !== void 0) {
  23413. respond(results);
  23414. }
  23415. }
  23416. function handleError(err2, callback) {
  23417. resetGlobals();
  23418. if (typeof callback === 'function' && callback !== noop2) {
  23419. callback(err2.message);
  23420. return;
  23421. }
  23422. throw err2;
  23423. }
  23424. function runPartial() {
  23425. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  23426. args[_key3] = arguments[_key3];
  23427. }
  23428. var _normalizeRunParams2 = normalizeRunParams(args), options = _normalizeRunParams2.options, context = _normalizeRunParams2.context;
  23429. assert_default(axe._audit, 'Axe is not configured. Audit is missing.');
  23430. assert_default(!axe._running, 'Axe is already running. Use `await axe.run()` to wait for the previous run to finish before starting a new run.');
  23431. var contextObj = new Context(context, axe._tree);
  23432. axe._tree = contextObj.flatTree;
  23433. axe._selectorData = _getSelectorData(contextObj.flatTree);
  23434. axe._running = true;
  23435. return new Promise(function(res, rej) {
  23436. axe._audit.run(contextObj, options, res, rej);
  23437. }).then(function(results) {
  23438. results = results.map(function(_ref121) {
  23439. var nodes = _ref121.nodes, result = _objectWithoutProperties(_ref121, _excluded8);
  23440. return _extends({
  23441. nodes: nodes.map(serializeNode)
  23442. }, result);
  23443. });
  23444. var frames = contextObj.frames.map(function(_ref122) {
  23445. var node = _ref122.node;
  23446. return new dq_element_default(node, options).toJSON();
  23447. });
  23448. var environmentData;
  23449. if (contextObj.initiator) {
  23450. environmentData = _getEnvironmentData();
  23451. }
  23452. axe._running = false;
  23453. teardown_default();
  23454. return {
  23455. results: results,
  23456. frames: frames,
  23457. environmentData: environmentData
  23458. };
  23459. })['catch'](function(err2) {
  23460. axe._running = false;
  23461. teardown_default();
  23462. return Promise.reject(err2);
  23463. });
  23464. }
  23465. function serializeNode(_ref123) {
  23466. var node = _ref123.node, nodeResult = _objectWithoutProperties(_ref123, _excluded9);
  23467. nodeResult.node = node.toJSON();
  23468. for (var _i36 = 0, _arr2 = [ 'any', 'all', 'none' ]; _i36 < _arr2.length; _i36++) {
  23469. var type = _arr2[_i36];
  23470. nodeResult[type] = nodeResult[type].map(function(_ref124) {
  23471. var relatedNodes = _ref124.relatedNodes, checkResult = _objectWithoutProperties(_ref124, _excluded10);
  23472. return _extends({}, checkResult, {
  23473. relatedNodes: relatedNodes.map(function(node2) {
  23474. return node2.toJSON();
  23475. })
  23476. });
  23477. });
  23478. }
  23479. return nodeResult;
  23480. }
  23481. function finishRun(partialResults) {
  23482. var _ref126, _options$reporter2, _axe$_audit2;
  23483. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  23484. options = clone_default(options);
  23485. var _ref125 = partialResults.find(function(r) {
  23486. return r.environmentData;
  23487. }) || {}, environmentData = _ref125.environmentData;
  23488. axe._audit.normalizeOptions(options);
  23489. options.reporter = (_ref126 = (_options$reporter2 = options.reporter) !== null && _options$reporter2 !== void 0 ? _options$reporter2 : (_axe$_audit2 = axe._audit) === null || _axe$_audit2 === void 0 ? void 0 : _axe$_audit2.reporter) !== null && _ref126 !== void 0 ? _ref126 : 'v1';
  23490. setFrameSpec(partialResults);
  23491. var results = merge_results_default(partialResults);
  23492. results = axe._audit.after(results, options);
  23493. results.forEach(publish_metadata_default);
  23494. results = results.map(finalize_result_default);
  23495. return createReport2(results, _extends({
  23496. environmentData: environmentData
  23497. }, options));
  23498. }
  23499. function setFrameSpec(partialResults) {
  23500. var frameStack = [];
  23501. var _iterator13 = _createForOfIteratorHelper(partialResults), _step13;
  23502. try {
  23503. for (_iterator13.s(); !(_step13 = _iterator13.n()).done; ) {
  23504. var partialResult = _step13.value;
  23505. var frameSpec = frameStack.shift();
  23506. if (!partialResult) {
  23507. continue;
  23508. }
  23509. partialResult.frameSpec = frameSpec !== null && frameSpec !== void 0 ? frameSpec : null;
  23510. var frameSpecs = getMergedFrameSpecs(partialResult);
  23511. frameStack.unshift.apply(frameStack, _toConsumableArray(frameSpecs));
  23512. }
  23513. } catch (err) {
  23514. _iterator13.e(err);
  23515. } finally {
  23516. _iterator13.f();
  23517. }
  23518. }
  23519. function getMergedFrameSpecs(_ref127) {
  23520. var childFrameSpecs = _ref127.frames, parentFrameSpec = _ref127.frameSpec;
  23521. if (!parentFrameSpec) {
  23522. return childFrameSpecs;
  23523. }
  23524. return childFrameSpecs.map(function(childFrameSpec) {
  23525. return dq_element_default.mergeSpecs(childFrameSpec, parentFrameSpec);
  23526. });
  23527. }
  23528. function createReport2(results, options) {
  23529. return new Promise(function(resolve) {
  23530. var reporter = getReporter(options.reporter);
  23531. reporter(results, options, resolve);
  23532. });
  23533. }
  23534. function setup(node) {
  23535. if (axe._tree) {
  23536. throw new Error('Axe is already setup. Call `axe.teardown()` before calling `axe.setup` again.');
  23537. }
  23538. axe._tree = get_flattened_tree_default(node);
  23539. axe._selectorData = _getSelectorData(axe._tree);
  23540. return axe._tree[0];
  23541. }
  23542. var setup_default = setup;
  23543. var naReporter = function naReporter(results, options, callback) {
  23544. console.warn('"na" reporter will be deprecated in axe v4.0. Use the "v2" reporter instead.');
  23545. if (typeof options === 'function') {
  23546. callback = options;
  23547. options = {};
  23548. }
  23549. var _options2 = options, environmentData = _options2.environmentData, toolOptions = _objectWithoutProperties(_options2, _excluded11);
  23550. callback(_extends({}, _getEnvironmentData(environmentData), {
  23551. toolOptions: toolOptions
  23552. }, process_aggregate_default(results, options)));
  23553. };
  23554. var na_default = naReporter;
  23555. var noPassesReporter = function noPassesReporter(results, options, callback) {
  23556. if (typeof options === 'function') {
  23557. callback = options;
  23558. options = {};
  23559. }
  23560. var _options3 = options, environmentData = _options3.environmentData, toolOptions = _objectWithoutProperties(_options3, _excluded12);
  23561. options.resultTypes = [ 'violations' ];
  23562. var _process_aggregate_de = process_aggregate_default(results, options), violations = _process_aggregate_de.violations;
  23563. callback(_extends({}, _getEnvironmentData(environmentData), {
  23564. toolOptions: toolOptions,
  23565. violations: violations
  23566. }));
  23567. };
  23568. var no_passes_default = noPassesReporter;
  23569. var rawReporter = function rawReporter(results, options, callback) {
  23570. if (typeof options === 'function') {
  23571. callback = options;
  23572. options = {};
  23573. }
  23574. if (!results || !Array.isArray(results)) {
  23575. return callback(results);
  23576. }
  23577. var transformedResults = results.map(function(result) {
  23578. var transformedResult = _extends({}, result);
  23579. var types = [ 'passes', 'violations', 'incomplete', 'inapplicable' ];
  23580. for (var _i37 = 0, _types = types; _i37 < _types.length; _i37++) {
  23581. var type = _types[_i37];
  23582. if (transformedResult[type] && Array.isArray(transformedResult[type])) {
  23583. transformedResult[type] = transformedResult[type].map(function(_ref128) {
  23584. var _node;
  23585. var node = _ref128.node, typeResult = _objectWithoutProperties(_ref128, _excluded13);
  23586. node = typeof ((_node = node) === null || _node === void 0 ? void 0 : _node.toJSON) === 'function' ? node.toJSON() : node;
  23587. return _extends({
  23588. node: node
  23589. }, typeResult);
  23590. });
  23591. }
  23592. }
  23593. return transformedResult;
  23594. });
  23595. callback(transformedResults);
  23596. };
  23597. var raw_default = rawReporter;
  23598. var rawEnvReporter = function rawEnvReporter(results, options, callback) {
  23599. if (typeof options === 'function') {
  23600. callback = options;
  23601. options = {};
  23602. }
  23603. var _options4 = options, environmentData = _options4.environmentData, toolOptions = _objectWithoutProperties(_options4, _excluded14);
  23604. raw_default(results, toolOptions, function(raw) {
  23605. var env = _getEnvironmentData(environmentData);
  23606. callback({
  23607. raw: raw,
  23608. env: env
  23609. });
  23610. });
  23611. };
  23612. var raw_env_default = rawEnvReporter;
  23613. var v1Reporter = function v1Reporter(results, options, callback) {
  23614. if (typeof options === 'function') {
  23615. callback = options;
  23616. options = {};
  23617. }
  23618. var _options5 = options, environmentData = _options5.environmentData, toolOptions = _objectWithoutProperties(_options5, _excluded15);
  23619. var out = process_aggregate_default(results, options);
  23620. var addFailureSummaries = function addFailureSummaries(result) {
  23621. result.nodes.forEach(function(nodeResult) {
  23622. nodeResult.failureSummary = failure_summary_default(nodeResult);
  23623. });
  23624. };
  23625. out.incomplete.forEach(addFailureSummaries);
  23626. out.violations.forEach(addFailureSummaries);
  23627. callback(_extends({}, _getEnvironmentData(environmentData), {
  23628. toolOptions: toolOptions
  23629. }, out));
  23630. };
  23631. var v1_default = v1Reporter;
  23632. var v2Reporter = function v2Reporter(results, options, callback) {
  23633. if (typeof options === 'function') {
  23634. callback = options;
  23635. options = {};
  23636. }
  23637. var _options6 = options, environmentData = _options6.environmentData, toolOptions = _objectWithoutProperties(_options6, _excluded16);
  23638. var out = process_aggregate_default(results, options);
  23639. callback(_extends({}, _getEnvironmentData(environmentData), {
  23640. toolOptions: toolOptions
  23641. }, out));
  23642. };
  23643. var v2_default = v2Reporter;
  23644. var _thisWillBeDeletedDoNotUse = {
  23645. base: {
  23646. Audit: audit_default,
  23647. CheckResult: check_result_default,
  23648. Check: check_default,
  23649. Context: Context,
  23650. RuleResult: rule_result_default,
  23651. Rule: rule_default,
  23652. metadataFunctionMap: metadata_function_map_default
  23653. },
  23654. public: {
  23655. reporters: reporters
  23656. },
  23657. helpers: {
  23658. failureSummary: failure_summary_default,
  23659. incompleteFallbackMessage: incompleteFallbackMessage,
  23660. processAggregate: process_aggregate_default
  23661. },
  23662. utils: {
  23663. setDefaultFrameMessenger: setDefaultFrameMessenger,
  23664. cacheNodeSelectors: cacheNodeSelectors,
  23665. getNodesMatchingExpression: getNodesMatchingExpression,
  23666. convertSelector: _convertSelector
  23667. },
  23668. commons: {
  23669. dom: {
  23670. nativelyHidden: nativelyHidden,
  23671. displayHidden: displayHidden,
  23672. visibilityHidden: visibilityHidden,
  23673. contentVisibiltyHidden: contentVisibiltyHidden,
  23674. ariaHidden: ariaHidden,
  23675. opacityHidden: opacityHidden,
  23676. scrollHidden: scrollHidden,
  23677. overflowHidden: overflowHidden,
  23678. clipHidden: clipHidden,
  23679. areaHidden: areaHidden,
  23680. detailsHidden: detailsHidden
  23681. }
  23682. }
  23683. };
  23684. var exposed_for_testing_default = _thisWillBeDeletedDoNotUse;
  23685. axe._thisWillBeDeletedDoNotUse = exposed_for_testing_default;
  23686. axe.constants = constants_default;
  23687. axe.log = log_default;
  23688. axe.AbstractVirtualNode = abstract_virtual_node_default;
  23689. axe.SerialVirtualNode = serial_virtual_node_default;
  23690. axe.VirtualNode = virtual_node_default;
  23691. axe._cache = cache_default;
  23692. axe.imports = imports_exports;
  23693. axe.cleanup = cleanup_default;
  23694. axe.configure = configure_default;
  23695. axe.frameMessenger = frameMessenger2;
  23696. axe.getRules = get_rules_default;
  23697. axe._load = load_default;
  23698. axe.plugins = {};
  23699. axe.registerPlugin = plugins_default;
  23700. axe.hasReporter = hasReporter;
  23701. axe.getReporter = getReporter;
  23702. axe.addReporter = addReporter;
  23703. axe.reset = reset_default;
  23704. axe._runRules = run_rules_default;
  23705. axe.runVirtualRule = runVirtualRule;
  23706. axe.run = run4;
  23707. axe.setup = setup_default;
  23708. axe.teardown = teardown_default;
  23709. axe.runPartial = runPartial;
  23710. axe.finishRun = finishRun;
  23711. axe.commons = commons_exports;
  23712. axe.utils = utils_exports;
  23713. axe.addReporter('na', na_default);
  23714. axe.addReporter('no-passes', no_passes_default);
  23715. axe.addReporter('rawEnv', raw_env_default);
  23716. axe.addReporter('raw', raw_default);
  23717. axe.addReporter('v1', v1_default);
  23718. axe.addReporter('v2', v2_default, true);
  23719. })();
  23720. 'use strict';
  23721. axe._load({
  23722. lang: 'en',
  23723. data: {
  23724. rules: {
  23725. accesskeys: {
  23726. description: 'Ensures every accesskey attribute value is unique',
  23727. help: 'accesskey attribute value should be unique'
  23728. },
  23729. 'area-alt': {
  23730. description: 'Ensures <area> elements of image maps have alternate text',
  23731. help: 'Active <area> elements must have alternate text'
  23732. },
  23733. 'aria-allowed-attr': {
  23734. description: 'Ensures ARIA attributes are allowed for an element\'s role',
  23735. help: 'Elements must only use allowed ARIA attributes'
  23736. },
  23737. 'aria-allowed-role': {
  23738. description: 'Ensures role attribute has an appropriate value for the element',
  23739. help: 'ARIA role should be appropriate for the element'
  23740. },
  23741. 'aria-command-name': {
  23742. description: 'Ensures every ARIA button, link and menuitem has an accessible name',
  23743. help: 'ARIA commands must have an accessible name'
  23744. },
  23745. 'aria-dialog-name': {
  23746. description: 'Ensures every ARIA dialog and alertdialog node has an accessible name',
  23747. help: 'ARIA dialog and alertdialog nodes should have an accessible name'
  23748. },
  23749. 'aria-hidden-body': {
  23750. description: 'Ensures aria-hidden=\'true\' is not present on the document body.',
  23751. help: 'aria-hidden=\'true\' must not be present on the document body'
  23752. },
  23753. 'aria-hidden-focus': {
  23754. description: 'Ensures aria-hidden elements are not focusable nor contain focusable elements',
  23755. help: 'ARIA hidden element must not be focusable or contain focusable elements'
  23756. },
  23757. 'aria-input-field-name': {
  23758. description: 'Ensures every ARIA input field has an accessible name',
  23759. help: 'ARIA input fields must have an accessible name'
  23760. },
  23761. 'aria-meter-name': {
  23762. description: 'Ensures every ARIA meter node has an accessible name',
  23763. help: 'ARIA meter nodes must have an accessible name'
  23764. },
  23765. 'aria-progressbar-name': {
  23766. description: 'Ensures every ARIA progressbar node has an accessible name',
  23767. help: 'ARIA progressbar nodes must have an accessible name'
  23768. },
  23769. 'aria-required-attr': {
  23770. description: 'Ensures elements with ARIA roles have all required ARIA attributes',
  23771. help: 'Required ARIA attributes must be provided'
  23772. },
  23773. 'aria-required-children': {
  23774. description: 'Ensures elements with an ARIA role that require child roles contain them',
  23775. help: 'Certain ARIA roles must contain particular children'
  23776. },
  23777. 'aria-required-parent': {
  23778. description: 'Ensures elements with an ARIA role that require parent roles are contained by them',
  23779. help: 'Certain ARIA roles must be contained by particular parents'
  23780. },
  23781. 'aria-roledescription': {
  23782. description: 'Ensure aria-roledescription is only used on elements with an implicit or explicit role',
  23783. help: 'aria-roledescription must be on elements with a semantic role'
  23784. },
  23785. 'aria-roles': {
  23786. description: 'Ensures all elements with a role attribute use a valid value',
  23787. help: 'ARIA roles used must conform to valid values'
  23788. },
  23789. 'aria-text': {
  23790. description: 'Ensures "role=text" is used on elements with no focusable descendants',
  23791. help: '"role=text" should have no focusable descendants'
  23792. },
  23793. 'aria-toggle-field-name': {
  23794. description: 'Ensures every ARIA toggle field has an accessible name',
  23795. help: 'ARIA toggle fields must have an accessible name'
  23796. },
  23797. 'aria-tooltip-name': {
  23798. description: 'Ensures every ARIA tooltip node has an accessible name',
  23799. help: 'ARIA tooltip nodes must have an accessible name'
  23800. },
  23801. 'aria-treeitem-name': {
  23802. description: 'Ensures every ARIA treeitem node has an accessible name',
  23803. help: 'ARIA treeitem nodes should have an accessible name'
  23804. },
  23805. 'aria-valid-attr-value': {
  23806. description: 'Ensures all ARIA attributes have valid values',
  23807. help: 'ARIA attributes must conform to valid values'
  23808. },
  23809. 'aria-valid-attr': {
  23810. description: 'Ensures attributes that begin with aria- are valid ARIA attributes',
  23811. help: 'ARIA attributes must conform to valid names'
  23812. },
  23813. 'audio-caption': {
  23814. description: 'Ensures <audio> elements have captions',
  23815. help: '<audio> elements must have a captions track'
  23816. },
  23817. 'autocomplete-valid': {
  23818. description: 'Ensure the autocomplete attribute is correct and suitable for the form field',
  23819. help: 'autocomplete attribute must be used correctly'
  23820. },
  23821. 'avoid-inline-spacing': {
  23822. description: 'Ensure that text spacing set through style attributes can be adjusted with custom stylesheets',
  23823. help: 'Inline text spacing must be adjustable with custom stylesheets'
  23824. },
  23825. blink: {
  23826. description: 'Ensures <blink> elements are not used',
  23827. help: '<blink> elements are deprecated and must not be used'
  23828. },
  23829. 'button-name': {
  23830. description: 'Ensures buttons have discernible text',
  23831. help: 'Buttons must have discernible text'
  23832. },
  23833. bypass: {
  23834. description: 'Ensures each page has at least one mechanism for a user to bypass navigation and jump straight to the content',
  23835. help: 'Page must have means to bypass repeated blocks'
  23836. },
  23837. 'color-contrast-enhanced': {
  23838. description: 'Ensures the contrast between foreground and background colors meets WCAG 2 AAA enhanced contrast ratio thresholds',
  23839. help: 'Elements must meet enhanced color contrast ratio thresholds'
  23840. },
  23841. 'color-contrast': {
  23842. description: 'Ensures the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds',
  23843. help: 'Elements must meet minimum color contrast ratio thresholds'
  23844. },
  23845. 'css-orientation-lock': {
  23846. description: 'Ensures content is not locked to any specific display orientation, and the content is operable in all display orientations',
  23847. help: 'CSS Media queries must not lock display orientation'
  23848. },
  23849. 'definition-list': {
  23850. description: 'Ensures <dl> elements are structured correctly',
  23851. help: '<dl> elements must only directly contain properly-ordered <dt> and <dd> groups, <script>, <template> or <div> elements'
  23852. },
  23853. dlitem: {
  23854. description: 'Ensures <dt> and <dd> elements are contained by a <dl>',
  23855. help: '<dt> and <dd> elements must be contained by a <dl>'
  23856. },
  23857. 'document-title': {
  23858. description: 'Ensures each HTML document contains a non-empty <title> element',
  23859. help: 'Documents must have <title> element to aid in navigation'
  23860. },
  23861. 'duplicate-id-active': {
  23862. description: 'Ensures every id attribute value of active elements is unique',
  23863. help: 'IDs of active elements must be unique'
  23864. },
  23865. 'duplicate-id-aria': {
  23866. description: 'Ensures every id attribute value used in ARIA and in labels is unique',
  23867. help: 'IDs used in ARIA and labels must be unique'
  23868. },
  23869. 'duplicate-id': {
  23870. description: 'Ensures every id attribute value is unique',
  23871. help: 'id attribute value must be unique'
  23872. },
  23873. 'empty-heading': {
  23874. description: 'Ensures headings have discernible text',
  23875. help: 'Headings should not be empty'
  23876. },
  23877. 'empty-table-header': {
  23878. description: 'Ensures table headers have discernible text',
  23879. help: 'Table header text should not be empty'
  23880. },
  23881. 'focus-order-semantics': {
  23882. description: 'Ensures elements in the focus order have a role appropriate for interactive content',
  23883. help: 'Elements in the focus order should have an appropriate role'
  23884. },
  23885. 'form-field-multiple-labels': {
  23886. description: 'Ensures form field does not have multiple label elements',
  23887. help: 'Form field must not have multiple label elements'
  23888. },
  23889. 'frame-focusable-content': {
  23890. description: 'Ensures <frame> and <iframe> elements with focusable content do not have tabindex=-1',
  23891. help: 'Frames with focusable content must not have tabindex=-1'
  23892. },
  23893. 'frame-tested': {
  23894. description: 'Ensures <iframe> and <frame> elements contain the axe-core script',
  23895. help: 'Frames should be tested with axe-core'
  23896. },
  23897. 'frame-title-unique': {
  23898. description: 'Ensures <iframe> and <frame> elements contain a unique title attribute',
  23899. help: 'Frames must have a unique title attribute'
  23900. },
  23901. 'frame-title': {
  23902. description: 'Ensures <iframe> and <frame> elements have an accessible name',
  23903. help: 'Frames must have an accessible name'
  23904. },
  23905. 'heading-order': {
  23906. description: 'Ensures the order of headings is semantically correct',
  23907. help: 'Heading levels should only increase by one'
  23908. },
  23909. 'hidden-content': {
  23910. description: 'Informs users about hidden content.',
  23911. help: 'Hidden content on the page should be analyzed'
  23912. },
  23913. 'html-has-lang': {
  23914. description: 'Ensures every HTML document has a lang attribute',
  23915. help: '<html> element must have a lang attribute'
  23916. },
  23917. 'html-lang-valid': {
  23918. description: 'Ensures the lang attribute of the <html> element has a valid value',
  23919. help: '<html> element must have a valid value for the lang attribute'
  23920. },
  23921. 'html-xml-lang-mismatch': {
  23922. description: 'Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page',
  23923. help: 'HTML elements with lang and xml:lang must have the same base language'
  23924. },
  23925. 'identical-links-same-purpose': {
  23926. description: 'Ensure that links with the same accessible name serve a similar purpose',
  23927. help: 'Links with the same name must have a similar purpose'
  23928. },
  23929. 'image-alt': {
  23930. description: 'Ensures <img> elements have alternate text or a role of none or presentation',
  23931. help: 'Images must have alternate text'
  23932. },
  23933. 'image-redundant-alt': {
  23934. description: 'Ensure image alternative is not repeated as text',
  23935. help: 'Alternative text of images should not be repeated as text'
  23936. },
  23937. 'input-button-name': {
  23938. description: 'Ensures input buttons have discernible text',
  23939. help: 'Input buttons must have discernible text'
  23940. },
  23941. 'input-image-alt': {
  23942. description: 'Ensures <input type="image"> elements have alternate text',
  23943. help: 'Image buttons must have alternate text'
  23944. },
  23945. 'label-content-name-mismatch': {
  23946. description: 'Ensures that elements labelled through their content must have their visible text as part of their accessible name',
  23947. help: 'Elements must have their visible text as part of their accessible name'
  23948. },
  23949. 'label-title-only': {
  23950. description: 'Ensures that every form element has a visible label and is not solely labeled using hidden labels, or the title or aria-describedby attributes',
  23951. help: 'Form elements should have a visible label'
  23952. },
  23953. label: {
  23954. description: 'Ensures every form element has a label',
  23955. help: 'Form elements must have labels'
  23956. },
  23957. 'landmark-banner-is-top-level': {
  23958. description: 'Ensures the banner landmark is at top level',
  23959. help: 'Banner landmark should not be contained in another landmark'
  23960. },
  23961. 'landmark-complementary-is-top-level': {
  23962. description: 'Ensures the complementary landmark or aside is at top level',
  23963. help: 'Aside should not be contained in another landmark'
  23964. },
  23965. 'landmark-contentinfo-is-top-level': {
  23966. description: 'Ensures the contentinfo landmark is at top level',
  23967. help: 'Contentinfo landmark should not be contained in another landmark'
  23968. },
  23969. 'landmark-main-is-top-level': {
  23970. description: 'Ensures the main landmark is at top level',
  23971. help: 'Main landmark should not be contained in another landmark'
  23972. },
  23973. 'landmark-no-duplicate-banner': {
  23974. description: 'Ensures the document has at most one banner landmark',
  23975. help: 'Document should not have more than one banner landmark'
  23976. },
  23977. 'landmark-no-duplicate-contentinfo': {
  23978. description: 'Ensures the document has at most one contentinfo landmark',
  23979. help: 'Document should not have more than one contentinfo landmark'
  23980. },
  23981. 'landmark-no-duplicate-main': {
  23982. description: 'Ensures the document has at most one main landmark',
  23983. help: 'Document should not have more than one main landmark'
  23984. },
  23985. 'landmark-one-main': {
  23986. description: 'Ensures the document has a main landmark',
  23987. help: 'Document should have one main landmark'
  23988. },
  23989. 'landmark-unique': {
  23990. help: 'Ensures landmarks are unique',
  23991. description: 'Landmarks should have a unique role or role/label/title (i.e. accessible name) combination'
  23992. },
  23993. 'link-in-text-block': {
  23994. description: 'Ensure links are distinguished from surrounding text in a way that does not rely on color',
  23995. help: 'Links must be distinguishable without relying on color'
  23996. },
  23997. 'link-name': {
  23998. description: 'Ensures links have discernible text',
  23999. help: 'Links must have discernible text'
  24000. },
  24001. list: {
  24002. description: 'Ensures that lists are structured correctly',
  24003. help: '<ul> and <ol> must only directly contain <li>, <script> or <template> elements'
  24004. },
  24005. listitem: {
  24006. description: 'Ensures <li> elements are used semantically',
  24007. help: '<li> elements must be contained in a <ul> or <ol>'
  24008. },
  24009. marquee: {
  24010. description: 'Ensures <marquee> elements are not used',
  24011. help: '<marquee> elements are deprecated and must not be used'
  24012. },
  24013. 'meta-refresh-no-exceptions': {
  24014. description: 'Ensures <meta http-equiv="refresh"> is not used for delayed refresh',
  24015. help: 'Delayed refresh must not be used'
  24016. },
  24017. 'meta-refresh': {
  24018. description: 'Ensures <meta http-equiv="refresh"> is not used for delayed refresh',
  24019. help: 'Delayed refresh under 20 hours must not be used'
  24020. },
  24021. 'meta-viewport-large': {
  24022. description: 'Ensures <meta name="viewport"> can scale a significant amount',
  24023. help: 'Users should be able to zoom and scale the text up to 500%'
  24024. },
  24025. 'meta-viewport': {
  24026. description: 'Ensures <meta name="viewport"> does not disable text scaling and zooming',
  24027. help: 'Zooming and scaling must not be disabled'
  24028. },
  24029. 'nested-interactive': {
  24030. description: 'Ensures interactive controls are not nested as they are not always announced by screen readers or can cause focus problems for assistive technologies',
  24031. help: 'Interactive controls must not be nested'
  24032. },
  24033. 'no-autoplay-audio': {
  24034. description: 'Ensures <video> or <audio> elements do not autoplay audio for more than 3 seconds without a control mechanism to stop or mute the audio',
  24035. help: '<video> or <audio> elements must not play automatically'
  24036. },
  24037. 'object-alt': {
  24038. description: 'Ensures <object> elements have alternate text',
  24039. help: '<object> elements must have alternate text'
  24040. },
  24041. 'p-as-heading': {
  24042. description: 'Ensure bold, italic text and font-size is not used to style <p> elements as a heading',
  24043. help: 'Styled <p> elements must not be used as headings'
  24044. },
  24045. 'page-has-heading-one': {
  24046. description: 'Ensure that the page, or at least one of its frames contains a level-one heading',
  24047. help: 'Page should contain a level-one heading'
  24048. },
  24049. 'presentation-role-conflict': {
  24050. description: 'Elements marked as presentational should not have global ARIA or tabindex to ensure all screen readers ignore them',
  24051. help: 'Ensure elements marked as presentational are consistently ignored'
  24052. },
  24053. region: {
  24054. description: 'Ensures all page content is contained by landmarks',
  24055. help: 'All page content should be contained by landmarks'
  24056. },
  24057. 'role-img-alt': {
  24058. description: 'Ensures [role=\'img\'] elements have alternate text',
  24059. help: '[role=\'img\'] elements must have an alternative text'
  24060. },
  24061. 'scope-attr-valid': {
  24062. description: 'Ensures the scope attribute is used correctly on tables',
  24063. help: 'scope attribute should be used correctly'
  24064. },
  24065. 'scrollable-region-focusable': {
  24066. description: 'Ensure elements that have scrollable content are accessible by keyboard',
  24067. help: 'Scrollable region must have keyboard access'
  24068. },
  24069. 'select-name': {
  24070. description: 'Ensures select element has an accessible name',
  24071. help: 'Select element must have an accessible name'
  24072. },
  24073. 'server-side-image-map': {
  24074. description: 'Ensures that server-side image maps are not used',
  24075. help: 'Server-side image maps must not be used'
  24076. },
  24077. 'skip-link': {
  24078. description: 'Ensure all skip links have a focusable target',
  24079. help: 'The skip-link target should exist and be focusable'
  24080. },
  24081. 'svg-img-alt': {
  24082. description: 'Ensures <svg> elements with an img, graphics-document or graphics-symbol role have an accessible text',
  24083. help: '<svg> elements with an img role must have an alternative text'
  24084. },
  24085. tabindex: {
  24086. description: 'Ensures tabindex attribute values are not greater than 0',
  24087. help: 'Elements should not have tabindex greater than zero'
  24088. },
  24089. 'table-duplicate-name': {
  24090. description: 'Ensure the <caption> element does not contain the same text as the summary attribute',
  24091. help: 'tables should not have the same summary and caption'
  24092. },
  24093. 'table-fake-caption': {
  24094. description: 'Ensure that tables with a caption use the <caption> element.',
  24095. help: 'Data or header cells must not be used to give caption to a data table.'
  24096. },
  24097. 'target-size': {
  24098. description: 'Ensure touch target have sufficient size and space',
  24099. help: 'All touch targets must be 24px large, or leave sufficient space'
  24100. },
  24101. 'td-has-header': {
  24102. description: 'Ensure that each non-empty data cell in a <table> larger than 3 by 3 has one or more table headers',
  24103. help: 'Non-empty <td> elements in larger <table> must have an associated table header'
  24104. },
  24105. 'td-headers-attr': {
  24106. description: 'Ensure that each cell in a table that uses the headers attribute refers only to other cells in that table',
  24107. help: 'Table cells that use the headers attribute must only refer to cells in the same table'
  24108. },
  24109. 'th-has-data-cells': {
  24110. description: 'Ensure that <th> elements and elements with role=columnheader/rowheader have data cells they describe',
  24111. help: 'Table headers in a data table must refer to data cells'
  24112. },
  24113. 'valid-lang': {
  24114. description: 'Ensures lang attributes have valid values',
  24115. help: 'lang attribute must have a valid value'
  24116. },
  24117. 'video-caption': {
  24118. description: 'Ensures <video> elements have captions',
  24119. help: '<video> elements must have captions'
  24120. }
  24121. },
  24122. checks: {
  24123. abstractrole: {
  24124. impact: 'serious',
  24125. messages: {
  24126. pass: 'Abstract roles are not used',
  24127. fail: {
  24128. singular: 'Abstract role cannot be directly used: ${data.values}',
  24129. plural: 'Abstract roles cannot be directly used: ${data.values}'
  24130. }
  24131. }
  24132. },
  24133. 'aria-allowed-attr': {
  24134. impact: 'critical',
  24135. messages: {
  24136. pass: 'ARIA attributes are used correctly for the defined role',
  24137. fail: {
  24138. singular: 'ARIA attribute is not allowed: ${data.values}',
  24139. plural: 'ARIA attributes are not allowed: ${data.values}'
  24140. },
  24141. incomplete: 'Check that there is no problem if the ARIA attribute is ignored on this element: ${data.values}'
  24142. }
  24143. },
  24144. 'aria-allowed-role': {
  24145. impact: 'minor',
  24146. messages: {
  24147. pass: 'ARIA role is allowed for given element',
  24148. fail: {
  24149. singular: 'ARIA role ${data.values} is not allowed for given element',
  24150. plural: 'ARIA roles ${data.values} are not allowed for given element'
  24151. },
  24152. incomplete: {
  24153. singular: 'ARIA role ${data.values} must be removed when the element is made visible, as it is not allowed for the element',
  24154. plural: 'ARIA roles ${data.values} must be removed when the element is made visible, as they are not allowed for the element'
  24155. }
  24156. }
  24157. },
  24158. 'aria-busy': {
  24159. impact: 'serious',
  24160. messages: {
  24161. pass: 'Element has an aria-busy attribute',
  24162. fail: 'Element uses aria-busy="true" while showing a loader'
  24163. }
  24164. },
  24165. 'aria-errormessage': {
  24166. impact: 'critical',
  24167. messages: {
  24168. pass: 'aria-errormessage exists and references elements visible to screen readers that use a supported aria-errormessage technique',
  24169. fail: {
  24170. singular: 'aria-errormessage value `${data.values}` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)',
  24171. plural: 'aria-errormessage values `${data.values}` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)',
  24172. hidden: 'aria-errormessage value `${data.values}` cannot reference a hidden element'
  24173. },
  24174. incomplete: {
  24175. singular: 'ensure aria-errormessage value `${data.values}` references an existing element',
  24176. plural: 'ensure aria-errormessage values `${data.values}` reference existing elements',
  24177. idrefs: 'unable to determine if aria-errormessage element exists on the page: ${data.values}'
  24178. }
  24179. }
  24180. },
  24181. 'aria-hidden-body': {
  24182. impact: 'critical',
  24183. messages: {
  24184. pass: 'No aria-hidden attribute is present on document body',
  24185. fail: 'aria-hidden=true should not be present on the document body'
  24186. }
  24187. },
  24188. 'aria-level': {
  24189. impact: 'serious',
  24190. messages: {
  24191. pass: 'aria-level values are valid',
  24192. incomplete: 'aria-level values greater than 6 are not supported in all screenreader and browser combinations'
  24193. }
  24194. },
  24195. 'aria-prohibited-attr': {
  24196. impact: 'serious',
  24197. messages: {
  24198. pass: 'ARIA attribute is allowed',
  24199. fail: {
  24200. hasRolePlural: '${data.prohibited} attributes cannot be used with role "${data.role}".',
  24201. hasRoleSingular: '${data.prohibited} attribute cannot be used with role "${data.role}".',
  24202. noRolePlural: '${data.prohibited} attributes cannot be used on a ${data.nodeName} with no valid role attribute.',
  24203. noRoleSingular: '${data.prohibited} attribute cannot be used on a ${data.nodeName} with no valid role attribute.'
  24204. },
  24205. incomplete: {
  24206. hasRoleSingular: '${data.prohibited} attribute is not well supported with role "${data.role}".',
  24207. hasRolePlural: '${data.prohibited} attributes are not well supported with role "${data.role}".',
  24208. noRoleSingular: '${data.prohibited} attribute is not well supported on a ${data.nodeName} with no valid role attribute.',
  24209. noRolePlural: '${data.prohibited} attributes are not well supported on a ${data.nodeName} with no valid role attribute.'
  24210. }
  24211. }
  24212. },
  24213. 'aria-required-attr': {
  24214. impact: 'critical',
  24215. messages: {
  24216. pass: 'All required ARIA attributes are present',
  24217. fail: {
  24218. singular: 'Required ARIA attribute not present: ${data.values}',
  24219. plural: 'Required ARIA attributes not present: ${data.values}'
  24220. }
  24221. }
  24222. },
  24223. 'aria-required-children': {
  24224. impact: 'critical',
  24225. messages: {
  24226. pass: 'Required ARIA children are present',
  24227. fail: {
  24228. singular: 'Required ARIA child role not present: ${data.values}',
  24229. plural: 'Required ARIA children role not present: ${data.values}',
  24230. unallowed: 'Element has children which are not allowed: ${data.values}'
  24231. },
  24232. incomplete: {
  24233. singular: 'Expecting ARIA child role to be added: ${data.values}',
  24234. plural: 'Expecting ARIA children role to be added: ${data.values}'
  24235. }
  24236. }
  24237. },
  24238. 'aria-required-parent': {
  24239. impact: 'critical',
  24240. messages: {
  24241. pass: 'Required ARIA parent role present',
  24242. fail: {
  24243. singular: 'Required ARIA parent role not present: ${data.values}',
  24244. plural: 'Required ARIA parents role not present: ${data.values}'
  24245. }
  24246. }
  24247. },
  24248. 'aria-roledescription': {
  24249. impact: 'serious',
  24250. messages: {
  24251. pass: 'aria-roledescription used on a supported semantic role',
  24252. incomplete: 'Check that the aria-roledescription is announced by supported screen readers',
  24253. fail: 'Give the element a role that supports aria-roledescription'
  24254. }
  24255. },
  24256. 'aria-unsupported-attr': {
  24257. impact: 'critical',
  24258. messages: {
  24259. pass: 'ARIA attribute is supported',
  24260. fail: 'ARIA attribute is not widely supported in screen readers and assistive technologies: ${data.values}'
  24261. }
  24262. },
  24263. 'aria-valid-attr-value': {
  24264. impact: 'critical',
  24265. messages: {
  24266. pass: 'ARIA attribute values are valid',
  24267. fail: {
  24268. singular: 'Invalid ARIA attribute value: ${data.values}',
  24269. plural: 'Invalid ARIA attribute values: ${data.values}'
  24270. },
  24271. incomplete: {
  24272. noId: 'ARIA attribute element ID does not exist on the page: ${data.needsReview}',
  24273. noIdShadow: 'ARIA attribute element ID does not exist on the page or is a descendant of a different shadow DOM tree: ${data.needsReview}',
  24274. ariaCurrent: 'ARIA attribute value is invalid and will be treated as "aria-current=true": ${data.needsReview}',
  24275. idrefs: 'Unable to determine if ARIA attribute element ID exists on the page: ${data.needsReview}',
  24276. empty: 'ARIA attribute value is ignored while empty: ${data.needsReview}'
  24277. }
  24278. }
  24279. },
  24280. 'aria-valid-attr': {
  24281. impact: 'critical',
  24282. messages: {
  24283. pass: 'ARIA attribute name is valid',
  24284. fail: {
  24285. singular: 'Invalid ARIA attribute name: ${data.values}',
  24286. plural: 'Invalid ARIA attribute names: ${data.values}'
  24287. }
  24288. }
  24289. },
  24290. deprecatedrole: {
  24291. impact: 'minor',
  24292. messages: {
  24293. pass: 'ARIA role is not deprecated',
  24294. fail: 'The role used is deprecated: ${data}'
  24295. }
  24296. },
  24297. fallbackrole: {
  24298. impact: 'serious',
  24299. messages: {
  24300. pass: 'Only one role value used',
  24301. fail: 'Use only one role value, since fallback roles are not supported in older browsers',
  24302. incomplete: 'Use only role \'presentation\' or \'none\' since they are synonymous.'
  24303. }
  24304. },
  24305. 'has-global-aria-attribute': {
  24306. impact: 'minor',
  24307. messages: {
  24308. pass: {
  24309. singular: 'Element has global ARIA attribute: ${data.values}',
  24310. plural: 'Element has global ARIA attributes: ${data.values}'
  24311. },
  24312. fail: 'Element does not have global ARIA attribute'
  24313. }
  24314. },
  24315. 'has-widget-role': {
  24316. impact: 'minor',
  24317. messages: {
  24318. pass: 'Element has a widget role.',
  24319. fail: 'Element does not have a widget role.'
  24320. }
  24321. },
  24322. invalidrole: {
  24323. impact: 'critical',
  24324. messages: {
  24325. pass: 'ARIA role is valid',
  24326. fail: {
  24327. singular: 'Role must be one of the valid ARIA roles: ${data.values}',
  24328. plural: 'Roles must be one of the valid ARIA roles: ${data.values}'
  24329. }
  24330. }
  24331. },
  24332. 'is-element-focusable': {
  24333. impact: 'minor',
  24334. messages: {
  24335. pass: 'Element is focusable.',
  24336. fail: 'Element is not focusable.'
  24337. }
  24338. },
  24339. 'no-implicit-explicit-label': {
  24340. impact: 'moderate',
  24341. messages: {
  24342. pass: 'There is no mismatch between a <label> and accessible name',
  24343. incomplete: 'Check that the <label> does not need be part of the ARIA ${data} field\'s name'
  24344. }
  24345. },
  24346. unsupportedrole: {
  24347. impact: 'critical',
  24348. messages: {
  24349. pass: 'ARIA role is supported',
  24350. fail: 'The role used is not widely supported in screen readers and assistive technologies: ${data}'
  24351. }
  24352. },
  24353. 'valid-scrollable-semantics': {
  24354. impact: 'minor',
  24355. messages: {
  24356. pass: 'Element has valid semantics for an element in the focus order.',
  24357. fail: 'Element has invalid semantics for an element in the focus order.'
  24358. }
  24359. },
  24360. 'color-contrast-enhanced': {
  24361. impact: 'serious',
  24362. messages: {
  24363. pass: 'Element has sufficient color contrast of ${data.contrastRatio}',
  24364. fail: {
  24365. default: 'Element has insufficient color contrast of ${data.contrastRatio} (foreground color: ${data.fgColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
  24366. fgOnShadowColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the foreground and shadow color (foreground color: ${data.fgColor}, text-shadow color: ${data.shadowColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
  24367. shadowOnBgColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the shadow color and background color (text-shadow color: ${data.shadowColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}'
  24368. },
  24369. incomplete: {
  24370. default: 'Unable to determine contrast ratio',
  24371. bgImage: 'Element\'s background color could not be determined due to a background image',
  24372. bgGradient: 'Element\'s background color could not be determined due to a background gradient',
  24373. imgNode: 'Element\'s background color could not be determined because element contains an image node',
  24374. bgOverlap: 'Element\'s background color could not be determined because it is overlapped by another element',
  24375. fgAlpha: 'Element\'s foreground color could not be determined because of alpha transparency',
  24376. elmPartiallyObscured: 'Element\'s background color could not be determined because it\'s partially obscured by another element',
  24377. elmPartiallyObscuring: 'Element\'s background color could not be determined because it partially overlaps other elements',
  24378. outsideViewport: 'Element\'s background color could not be determined because it\'s outside the viewport',
  24379. equalRatio: 'Element has a 1:1 contrast ratio with the background',
  24380. shortTextContent: 'Element content is too short to determine if it is actual text content',
  24381. nonBmp: 'Element content contains only non-text characters',
  24382. pseudoContent: 'Element\'s background color could not be determined due to a pseudo element'
  24383. }
  24384. }
  24385. },
  24386. 'color-contrast': {
  24387. impact: 'serious',
  24388. messages: {
  24389. pass: {
  24390. default: 'Element has sufficient color contrast of ${data.contrastRatio}',
  24391. hidden: 'Element is hidden'
  24392. },
  24393. fail: {
  24394. default: 'Element has insufficient color contrast of ${data.contrastRatio} (foreground color: ${data.fgColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
  24395. fgOnShadowColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the foreground and shadow color (foreground color: ${data.fgColor}, text-shadow color: ${data.shadowColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
  24396. shadowOnBgColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the shadow color and background color (text-shadow color: ${data.shadowColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}'
  24397. },
  24398. incomplete: {
  24399. default: 'Unable to determine contrast ratio',
  24400. bgImage: 'Element\'s background color could not be determined due to a background image',
  24401. bgGradient: 'Element\'s background color could not be determined due to a background gradient',
  24402. imgNode: 'Element\'s background color could not be determined because element contains an image node',
  24403. bgOverlap: 'Element\'s background color could not be determined because it is overlapped by another element',
  24404. fgAlpha: 'Element\'s foreground color could not be determined because of alpha transparency',
  24405. elmPartiallyObscured: 'Element\'s background color could not be determined because it\'s partially obscured by another element',
  24406. elmPartiallyObscuring: 'Element\'s background color could not be determined because it partially overlaps other elements',
  24407. outsideViewport: 'Element\'s background color could not be determined because it\'s outside the viewport',
  24408. equalRatio: 'Element has a 1:1 contrast ratio with the background',
  24409. shortTextContent: 'Element content is too short to determine if it is actual text content',
  24410. nonBmp: 'Element content contains only non-text characters',
  24411. pseudoContent: 'Element\'s background color could not be determined due to a pseudo element'
  24412. }
  24413. }
  24414. },
  24415. 'link-in-text-block-style': {
  24416. impact: 'serious',
  24417. messages: {
  24418. pass: 'Links can be distinguished from surrounding text by visual styling',
  24419. fail: 'The link has no styling (such as underline) to distinguish it from the surrounding text'
  24420. }
  24421. },
  24422. 'link-in-text-block': {
  24423. impact: 'serious',
  24424. messages: {
  24425. pass: 'Links can be distinguished from surrounding text in some way other than by color',
  24426. fail: {
  24427. fgContrast: 'The link has insufficient color contrast of ${data.contrastRatio}:1 with the surrounding text. (Minimum contrast is ${data.requiredContrastRatio}:1, link text: ${data.nodeColor}, surrounding text: ${data.parentColor})',
  24428. bgContrast: 'The link background has insufficient color contrast of ${data.contrastRatio} (Minimum contrast is ${data.requiredContrastRatio}:1, link background color: ${data.nodeBackgroundColor}, surrounding background color: ${data.parentBackgroundColor})'
  24429. },
  24430. incomplete: {
  24431. default: 'Element\'s foreground contrast ratio could not be determined',
  24432. bgContrast: 'Element\'s background contrast ratio could not be determined',
  24433. bgImage: 'Element\'s contrast ratio could not be determined due to a background image',
  24434. bgGradient: 'Element\'s contrast ratio could not be determined due to a background gradient',
  24435. imgNode: 'Element\'s contrast ratio could not be determined because element contains an image node',
  24436. bgOverlap: 'Element\'s contrast ratio could not be determined because of element overlap'
  24437. }
  24438. }
  24439. },
  24440. 'autocomplete-appropriate': {
  24441. impact: 'serious',
  24442. messages: {
  24443. pass: 'the autocomplete value is on an appropriate element',
  24444. fail: 'the autocomplete value is inappropriate for this type of input'
  24445. }
  24446. },
  24447. 'autocomplete-valid': {
  24448. impact: 'serious',
  24449. messages: {
  24450. pass: 'the autocomplete attribute is correctly formatted',
  24451. fail: 'the autocomplete attribute is incorrectly formatted'
  24452. }
  24453. },
  24454. accesskeys: {
  24455. impact: 'serious',
  24456. messages: {
  24457. pass: 'Accesskey attribute value is unique',
  24458. fail: 'Document has multiple elements with the same accesskey'
  24459. }
  24460. },
  24461. 'focusable-content': {
  24462. impact: 'serious',
  24463. messages: {
  24464. pass: 'Element contains focusable elements',
  24465. fail: 'Element should have focusable content'
  24466. }
  24467. },
  24468. 'focusable-disabled': {
  24469. impact: 'serious',
  24470. messages: {
  24471. pass: 'No focusable elements contained within element',
  24472. incomplete: 'Check if the focusable elements immediately move the focus indicator',
  24473. fail: 'Focusable content should be disabled or be removed from the DOM'
  24474. }
  24475. },
  24476. 'focusable-element': {
  24477. impact: 'serious',
  24478. messages: {
  24479. pass: 'Element is focusable',
  24480. fail: 'Element should be focusable'
  24481. }
  24482. },
  24483. 'focusable-modal-open': {
  24484. impact: 'serious',
  24485. messages: {
  24486. pass: 'No focusable elements while a modal is open',
  24487. incomplete: 'Check that focusable elements are not tabbable in the current state'
  24488. }
  24489. },
  24490. 'focusable-no-name': {
  24491. impact: 'serious',
  24492. messages: {
  24493. pass: 'Element is not in tab order or has accessible text',
  24494. fail: 'Element is in tab order and does not have accessible text',
  24495. incomplete: 'Unable to determine if element has an accessible name'
  24496. }
  24497. },
  24498. 'focusable-not-tabbable': {
  24499. impact: 'serious',
  24500. messages: {
  24501. pass: 'No focusable elements contained within element',
  24502. incomplete: 'Check if the focusable elements immediately move the focus indicator',
  24503. fail: 'Focusable content should have tabindex=\'-1\' or be removed from the DOM'
  24504. }
  24505. },
  24506. 'frame-focusable-content': {
  24507. impact: 'serious',
  24508. messages: {
  24509. pass: 'Element does not have focusable descendants',
  24510. fail: 'Element has focusable descendants',
  24511. incomplete: 'Could not determine if element has descendants'
  24512. }
  24513. },
  24514. 'landmark-is-top-level': {
  24515. impact: 'moderate',
  24516. messages: {
  24517. pass: 'The ${data.role} landmark is at the top level.',
  24518. fail: 'The ${data.role} landmark is contained in another landmark.'
  24519. }
  24520. },
  24521. 'no-focusable-content': {
  24522. impact: 'serious',
  24523. messages: {
  24524. pass: 'Element does not have focusable descendants',
  24525. fail: {
  24526. default: 'Element has focusable descendants',
  24527. notHidden: 'Using a negative tabindex on an element inside an interactive control does not prevent assistive technologies from focusing the element (even with \'aria-hidden=true\')'
  24528. },
  24529. incomplete: 'Could not determine if element has descendants'
  24530. }
  24531. },
  24532. 'page-has-heading-one': {
  24533. impact: 'moderate',
  24534. messages: {
  24535. pass: 'Page has at least one level-one heading',
  24536. fail: 'Page must have a level-one heading'
  24537. }
  24538. },
  24539. 'page-has-main': {
  24540. impact: 'moderate',
  24541. messages: {
  24542. pass: 'Document has at least one main landmark',
  24543. fail: 'Document does not have a main landmark'
  24544. }
  24545. },
  24546. 'page-no-duplicate-banner': {
  24547. impact: 'moderate',
  24548. messages: {
  24549. pass: 'Document does not have more than one banner landmark',
  24550. fail: 'Document has more than one banner landmark'
  24551. }
  24552. },
  24553. 'page-no-duplicate-contentinfo': {
  24554. impact: 'moderate',
  24555. messages: {
  24556. pass: 'Document does not have more than one contentinfo landmark',
  24557. fail: 'Document has more than one contentinfo landmark'
  24558. }
  24559. },
  24560. 'page-no-duplicate-main': {
  24561. impact: 'moderate',
  24562. messages: {
  24563. pass: 'Document does not have more than one main landmark',
  24564. fail: 'Document has more than one main landmark'
  24565. }
  24566. },
  24567. tabindex: {
  24568. impact: 'serious',
  24569. messages: {
  24570. pass: 'Element does not have a tabindex greater than 0',
  24571. fail: 'Element has a tabindex greater than 0'
  24572. }
  24573. },
  24574. 'alt-space-value': {
  24575. impact: 'critical',
  24576. messages: {
  24577. pass: 'Element has a valid alt attribute value',
  24578. fail: 'Element has an alt attribute containing only a space character, which is not ignored by all screen readers'
  24579. }
  24580. },
  24581. 'duplicate-img-label': {
  24582. impact: 'minor',
  24583. messages: {
  24584. pass: 'Element does not duplicate existing text in <img> alt text',
  24585. fail: 'Element contains <img> element with alt text that duplicates existing text'
  24586. }
  24587. },
  24588. 'explicit-label': {
  24589. impact: 'critical',
  24590. messages: {
  24591. pass: 'Form element has an explicit <label>',
  24592. fail: 'Form element does not have an explicit <label>',
  24593. incomplete: 'Unable to determine if form element has an explicit <label>'
  24594. }
  24595. },
  24596. 'help-same-as-label': {
  24597. impact: 'minor',
  24598. messages: {
  24599. pass: 'Help text (title or aria-describedby) does not duplicate label text',
  24600. fail: 'Help text (title or aria-describedby) text is the same as the label text'
  24601. }
  24602. },
  24603. 'hidden-explicit-label': {
  24604. impact: 'critical',
  24605. messages: {
  24606. pass: 'Form element has a visible explicit <label>',
  24607. fail: 'Form element has explicit <label> that is hidden',
  24608. incomplete: 'Unable to determine if form element has explicit <label> that is hidden'
  24609. }
  24610. },
  24611. 'implicit-label': {
  24612. impact: 'critical',
  24613. messages: {
  24614. pass: 'Form element has an implicit (wrapped) <label>',
  24615. fail: 'Form element does not have an implicit (wrapped) <label>',
  24616. incomplete: 'Unable to determine if form element has an implicit (wrapped} <label>'
  24617. }
  24618. },
  24619. 'label-content-name-mismatch': {
  24620. impact: 'serious',
  24621. messages: {
  24622. pass: 'Element contains visible text as part of it\'s accessible name',
  24623. fail: 'Text inside the element is not included in the accessible name'
  24624. }
  24625. },
  24626. 'multiple-label': {
  24627. impact: 'moderate',
  24628. messages: {
  24629. pass: 'Form field does not have multiple label elements',
  24630. incomplete: 'Multiple label elements is not widely supported in assistive technologies. Ensure the first label contains all necessary information.'
  24631. }
  24632. },
  24633. 'title-only': {
  24634. impact: 'serious',
  24635. messages: {
  24636. pass: 'Form element does not solely use title attribute for its label',
  24637. fail: 'Only title used to generate label for form element'
  24638. }
  24639. },
  24640. 'landmark-is-unique': {
  24641. impact: 'moderate',
  24642. messages: {
  24643. pass: 'Landmarks must have a unique role or role/label/title (i.e. accessible name) combination',
  24644. fail: 'The landmark must have a unique aria-label, aria-labelledby, or title to make landmarks distinguishable'
  24645. }
  24646. },
  24647. 'has-lang': {
  24648. impact: 'serious',
  24649. messages: {
  24650. pass: 'The <html> element has a lang attribute',
  24651. fail: {
  24652. noXHTML: 'The xml:lang attribute is not valid on HTML pages, use the lang attribute.',
  24653. noLang: 'The <html> element does not have a lang attribute'
  24654. }
  24655. }
  24656. },
  24657. 'valid-lang': {
  24658. impact: 'serious',
  24659. messages: {
  24660. pass: 'Value of lang attribute is included in the list of valid languages',
  24661. fail: 'Value of lang attribute not included in the list of valid languages'
  24662. }
  24663. },
  24664. 'xml-lang-mismatch': {
  24665. impact: 'moderate',
  24666. messages: {
  24667. pass: 'Lang and xml:lang attributes have the same base language',
  24668. fail: 'Lang and xml:lang attributes do not have the same base language'
  24669. }
  24670. },
  24671. dlitem: {
  24672. impact: 'serious',
  24673. messages: {
  24674. pass: 'Description list item has a <dl> parent element',
  24675. fail: 'Description list item does not have a <dl> parent element'
  24676. }
  24677. },
  24678. listitem: {
  24679. impact: 'serious',
  24680. messages: {
  24681. pass: 'List item has a <ul>, <ol> or role="list" parent element',
  24682. fail: {
  24683. default: 'List item does not have a <ul>, <ol> parent element',
  24684. roleNotValid: 'List item does not have a <ul>, <ol> parent element without a role, or a role="list"'
  24685. }
  24686. }
  24687. },
  24688. 'only-dlitems': {
  24689. impact: 'serious',
  24690. messages: {
  24691. pass: 'dl element only has direct children that are allowed inside; <dt>, <dd>, or <div> elements',
  24692. fail: 'dl element has direct children that are not allowed: ${data.values}'
  24693. }
  24694. },
  24695. 'only-listitems': {
  24696. impact: 'serious',
  24697. messages: {
  24698. pass: 'List element only has direct children that are allowed inside <li> elements',
  24699. fail: 'List element has direct children that are not allowed: ${data.values}'
  24700. }
  24701. },
  24702. 'structured-dlitems': {
  24703. impact: 'serious',
  24704. messages: {
  24705. pass: 'When not empty, element has both <dt> and <dd> elements',
  24706. fail: 'When not empty, element does not have at least one <dt> element followed by at least one <dd> element'
  24707. }
  24708. },
  24709. caption: {
  24710. impact: 'critical',
  24711. messages: {
  24712. pass: 'The multimedia element has a captions track',
  24713. incomplete: 'Check that captions is available for the element'
  24714. }
  24715. },
  24716. 'frame-tested': {
  24717. impact: 'critical',
  24718. messages: {
  24719. pass: 'The iframe was tested with axe-core',
  24720. fail: 'The iframe could not be tested with axe-core',
  24721. incomplete: 'The iframe still has to be tested with axe-core'
  24722. }
  24723. },
  24724. 'no-autoplay-audio': {
  24725. impact: 'moderate',
  24726. messages: {
  24727. pass: '<video> or <audio> does not output audio for more than allowed duration or has controls mechanism',
  24728. fail: '<video> or <audio> outputs audio for more than allowed duration and does not have a controls mechanism',
  24729. incomplete: 'Check that the <video> or <audio> does not output audio for more than allowed duration or provides a controls mechanism'
  24730. }
  24731. },
  24732. 'css-orientation-lock': {
  24733. impact: 'serious',
  24734. messages: {
  24735. pass: 'Display is operable, and orientation lock does not exist',
  24736. fail: 'CSS Orientation lock is applied, and makes display inoperable',
  24737. incomplete: 'CSS Orientation lock cannot be determined'
  24738. }
  24739. },
  24740. 'meta-viewport-large': {
  24741. impact: 'minor',
  24742. messages: {
  24743. pass: '<meta> tag does not prevent significant zooming on mobile devices',
  24744. fail: '<meta> tag limits zooming on mobile devices'
  24745. }
  24746. },
  24747. 'meta-viewport': {
  24748. impact: 'critical',
  24749. messages: {
  24750. pass: '<meta> tag does not disable zooming on mobile devices',
  24751. fail: '${data} on <meta> tag disables zooming on mobile devices'
  24752. }
  24753. },
  24754. 'target-offset': {
  24755. impact: 'serious',
  24756. messages: {
  24757. pass: 'Target has sufficient offset from its closest neighbor (${data.closestOffset}px should be at least ${data.minOffset}px)',
  24758. fail: 'Target has insufficient offset from its closest neighbor (${data.closestOffset}px should be at least ${data.minOffset}px)',
  24759. incomplete: {
  24760. default: 'Element with negative tabindex has insufficient offset from its closest neighbor (${data.closestOffset}px should be at least ${data.minOffset}px). Is this a target?',
  24761. nonTabbableNeighbor: 'Target has insufficient offset from a neighbor with negative tabindex (${data.closestOffset}px should be at least ${data.minOffset}px). Is the neighbor a target?'
  24762. }
  24763. }
  24764. },
  24765. 'target-size': {
  24766. impact: 'serious',
  24767. messages: {
  24768. pass: {
  24769. default: 'Control has sufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)',
  24770. obscured: 'Control is ignored because it is fully obscured and thus not clickable'
  24771. },
  24772. fail: {
  24773. default: 'Target has insufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)',
  24774. partiallyObscured: 'Target has insufficient size because it is partially obscured (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)'
  24775. },
  24776. incomplete: {
  24777. default: 'Element with negative tabindex has insufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is this a target?',
  24778. contentOverflow: 'Element size could not be accurately determined due to overflow content',
  24779. partiallyObscured: 'Element with negative tabindex has insufficient size because it is partially obscured (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is this a target?',
  24780. partiallyObscuredNonTabbable: 'Target has insufficient size because it is partially obscured by a neighbor with negative tabindex (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is the neighbor a target?'
  24781. }
  24782. }
  24783. },
  24784. 'header-present': {
  24785. impact: 'serious',
  24786. messages: {
  24787. pass: 'Page has a heading',
  24788. fail: 'Page does not have a heading'
  24789. }
  24790. },
  24791. 'heading-order': {
  24792. impact: 'moderate',
  24793. messages: {
  24794. pass: 'Heading order valid',
  24795. fail: 'Heading order invalid',
  24796. incomplete: 'Unable to determine previous heading'
  24797. }
  24798. },
  24799. 'identical-links-same-purpose': {
  24800. impact: 'minor',
  24801. messages: {
  24802. pass: 'There are no other links with the same name, that go to a different URL',
  24803. incomplete: 'Check that links have the same purpose, or are intentionally ambiguous.'
  24804. }
  24805. },
  24806. 'internal-link-present': {
  24807. impact: 'serious',
  24808. messages: {
  24809. pass: 'Valid skip link found',
  24810. fail: 'No valid skip link found'
  24811. }
  24812. },
  24813. landmark: {
  24814. impact: 'serious',
  24815. messages: {
  24816. pass: 'Page has a landmark region',
  24817. fail: 'Page does not have a landmark region'
  24818. }
  24819. },
  24820. 'meta-refresh-no-exceptions': {
  24821. impact: 'minor',
  24822. messages: {
  24823. pass: '<meta> tag does not immediately refresh the page',
  24824. fail: '<meta> tag forces timed refresh of page'
  24825. }
  24826. },
  24827. 'meta-refresh': {
  24828. impact: 'critical',
  24829. messages: {
  24830. pass: '<meta> tag does not immediately refresh the page',
  24831. fail: '<meta> tag forces timed refresh of page (less than 20 hours)'
  24832. }
  24833. },
  24834. 'p-as-heading': {
  24835. impact: 'serious',
  24836. messages: {
  24837. pass: '<p> elements are not styled as headings',
  24838. fail: 'Heading elements should be used instead of styled <p> elements',
  24839. incomplete: 'Unable to determine if <p> elements are styled as headings'
  24840. }
  24841. },
  24842. region: {
  24843. impact: 'moderate',
  24844. messages: {
  24845. pass: 'All page content is contained by landmarks',
  24846. fail: 'Some page content is not contained by landmarks'
  24847. }
  24848. },
  24849. 'skip-link': {
  24850. impact: 'moderate',
  24851. messages: {
  24852. pass: 'Skip link target exists',
  24853. incomplete: 'Skip link target should become visible on activation',
  24854. fail: 'No skip link target'
  24855. }
  24856. },
  24857. 'unique-frame-title': {
  24858. impact: 'serious',
  24859. messages: {
  24860. pass: 'Element\'s title attribute is unique',
  24861. fail: 'Element\'s title attribute is not unique'
  24862. }
  24863. },
  24864. 'duplicate-id-active': {
  24865. impact: 'serious',
  24866. messages: {
  24867. pass: 'Document has no active elements that share the same id attribute',
  24868. fail: 'Document has active elements with the same id attribute: ${data}'
  24869. }
  24870. },
  24871. 'duplicate-id-aria': {
  24872. impact: 'critical',
  24873. messages: {
  24874. pass: 'Document has no elements referenced with ARIA or labels that share the same id attribute',
  24875. fail: 'Document has multiple elements referenced with ARIA with the same id attribute: ${data}'
  24876. }
  24877. },
  24878. 'duplicate-id': {
  24879. impact: 'minor',
  24880. messages: {
  24881. pass: 'Document has no static elements that share the same id attribute',
  24882. fail: 'Document has multiple static elements with the same id attribute: ${data}'
  24883. }
  24884. },
  24885. 'aria-label': {
  24886. impact: 'serious',
  24887. messages: {
  24888. pass: 'aria-label attribute exists and is not empty',
  24889. fail: 'aria-label attribute does not exist or is empty'
  24890. }
  24891. },
  24892. 'aria-labelledby': {
  24893. impact: 'serious',
  24894. messages: {
  24895. pass: 'aria-labelledby attribute exists and references elements that are visible to screen readers',
  24896. fail: 'aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty',
  24897. incomplete: 'ensure aria-labelledby references an existing element'
  24898. }
  24899. },
  24900. 'avoid-inline-spacing': {
  24901. impact: 'serious',
  24902. messages: {
  24903. pass: 'No inline styles with \'!important\' that affect text spacing has been specified',
  24904. fail: {
  24905. singular: 'Remove \'!important\' from inline style ${data.values}, as overriding this is not supported by most browsers',
  24906. plural: 'Remove \'!important\' from inline styles ${data.values}, as overriding this is not supported by most browsers'
  24907. }
  24908. }
  24909. },
  24910. 'button-has-visible-text': {
  24911. impact: 'critical',
  24912. messages: {
  24913. pass: 'Element has inner text that is visible to screen readers',
  24914. fail: 'Element does not have inner text that is visible to screen readers',
  24915. incomplete: 'Unable to determine if element has children'
  24916. }
  24917. },
  24918. 'doc-has-title': {
  24919. impact: 'serious',
  24920. messages: {
  24921. pass: 'Document has a non-empty <title> element',
  24922. fail: 'Document does not have a non-empty <title> element'
  24923. }
  24924. },
  24925. exists: {
  24926. impact: 'minor',
  24927. messages: {
  24928. pass: 'Element does not exist',
  24929. incomplete: 'Element exists'
  24930. }
  24931. },
  24932. 'has-alt': {
  24933. impact: 'critical',
  24934. messages: {
  24935. pass: 'Element has an alt attribute',
  24936. fail: 'Element does not have an alt attribute'
  24937. }
  24938. },
  24939. 'has-visible-text': {
  24940. impact: 'minor',
  24941. messages: {
  24942. pass: 'Element has text that is visible to screen readers',
  24943. fail: 'Element does not have text that is visible to screen readers',
  24944. incomplete: 'Unable to determine if element has children'
  24945. }
  24946. },
  24947. 'important-letter-spacing': {
  24948. impact: 'serious',
  24949. messages: {
  24950. pass: 'Letter-spacing in the style attribute is not set to !important, or meets the minimum',
  24951. fail: 'letter-spacing in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)'
  24952. }
  24953. },
  24954. 'important-line-height': {
  24955. impact: 'serious',
  24956. messages: {
  24957. pass: 'line-height in the style attribute is not set to !important, or meets the minimum',
  24958. fail: 'line-height in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)'
  24959. }
  24960. },
  24961. 'important-word-spacing': {
  24962. impact: 'serious',
  24963. messages: {
  24964. pass: 'word-spacing in the style attribute is not set to !important, or meets the minimum',
  24965. fail: 'word-spacing in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)'
  24966. }
  24967. },
  24968. 'is-on-screen': {
  24969. impact: 'serious',
  24970. messages: {
  24971. pass: 'Element is not visible',
  24972. fail: 'Element is visible'
  24973. }
  24974. },
  24975. 'non-empty-alt': {
  24976. impact: 'critical',
  24977. messages: {
  24978. pass: 'Element has a non-empty alt attribute',
  24979. fail: {
  24980. noAttr: 'Element has no alt attribute',
  24981. emptyAttr: 'Element has an empty alt attribute'
  24982. }
  24983. }
  24984. },
  24985. 'non-empty-if-present': {
  24986. impact: 'critical',
  24987. messages: {
  24988. pass: {
  24989. default: 'Element does not have a value attribute',
  24990. 'has-label': 'Element has a non-empty value attribute'
  24991. },
  24992. fail: 'Element has a value attribute and the value attribute is empty'
  24993. }
  24994. },
  24995. 'non-empty-placeholder': {
  24996. impact: 'serious',
  24997. messages: {
  24998. pass: 'Element has a placeholder attribute',
  24999. fail: {
  25000. noAttr: 'Element has no placeholder attribute',
  25001. emptyAttr: 'Element has an empty placeholder attribute'
  25002. }
  25003. }
  25004. },
  25005. 'non-empty-title': {
  25006. impact: 'serious',
  25007. messages: {
  25008. pass: 'Element has a title attribute',
  25009. fail: {
  25010. noAttr: 'Element has no title attribute',
  25011. emptyAttr: 'Element has an empty title attribute'
  25012. }
  25013. }
  25014. },
  25015. 'non-empty-value': {
  25016. impact: 'critical',
  25017. messages: {
  25018. pass: 'Element has a non-empty value attribute',
  25019. fail: {
  25020. noAttr: 'Element has no value attribute',
  25021. emptyAttr: 'Element has an empty value attribute'
  25022. }
  25023. }
  25024. },
  25025. 'presentational-role': {
  25026. impact: 'minor',
  25027. messages: {
  25028. pass: 'Element\'s default semantics were overriden with role="${data.role}"',
  25029. fail: {
  25030. default: 'Element\'s default semantics were not overridden with role="none" or role="presentation"',
  25031. globalAria: 'Element\'s role is not presentational because it has a global ARIA attribute',
  25032. focusable: 'Element\'s role is not presentational because it is focusable',
  25033. both: 'Element\'s role is not presentational because it has a global ARIA attribute and is focusable',
  25034. iframe: 'Using the "title" attribute on an ${data.nodeName} element with a presentational role behaves inconsistently between screen readers'
  25035. }
  25036. }
  25037. },
  25038. 'role-none': {
  25039. impact: 'minor',
  25040. messages: {
  25041. pass: 'Element\'s default semantics were overriden with role="none"',
  25042. fail: 'Element\'s default semantics were not overridden with role="none"'
  25043. }
  25044. },
  25045. 'role-presentation': {
  25046. impact: 'minor',
  25047. messages: {
  25048. pass: 'Element\'s default semantics were overriden with role="presentation"',
  25049. fail: 'Element\'s default semantics were not overridden with role="presentation"'
  25050. }
  25051. },
  25052. 'svg-non-empty-title': {
  25053. impact: 'serious',
  25054. messages: {
  25055. pass: 'Element has a child that is a title',
  25056. fail: {
  25057. noTitle: 'Element has no child that is a title',
  25058. emptyTitle: 'Element child title is empty'
  25059. },
  25060. incomplete: 'Unable to determine element has a child that is a title'
  25061. }
  25062. },
  25063. 'caption-faked': {
  25064. impact: 'serious',
  25065. messages: {
  25066. pass: 'The first row of a table is not used as a caption',
  25067. fail: 'The first child of the table should be a caption instead of a table cell'
  25068. }
  25069. },
  25070. 'html5-scope': {
  25071. impact: 'moderate',
  25072. messages: {
  25073. pass: 'Scope attribute is only used on table header elements (<th>)',
  25074. fail: 'In HTML 5, scope attributes may only be used on table header elements (<th>)'
  25075. }
  25076. },
  25077. 'same-caption-summary': {
  25078. impact: 'minor',
  25079. messages: {
  25080. pass: 'Content of summary attribute and <caption> are not duplicated',
  25081. fail: 'Content of summary attribute and <caption> element are identical',
  25082. incomplete: 'Unable to determine if <table> element has a caption'
  25083. }
  25084. },
  25085. 'scope-value': {
  25086. impact: 'critical',
  25087. messages: {
  25088. pass: 'Scope attribute is used correctly',
  25089. fail: 'The value of the scope attribute may only be \'row\' or \'col\''
  25090. }
  25091. },
  25092. 'td-has-header': {
  25093. impact: 'critical',
  25094. messages: {
  25095. pass: 'All non-empty data cells have table headers',
  25096. fail: 'Some non-empty data cells do not have table headers'
  25097. }
  25098. },
  25099. 'td-headers-attr': {
  25100. impact: 'serious',
  25101. messages: {
  25102. pass: 'The headers attribute is exclusively used to refer to other cells in the table',
  25103. incomplete: 'The headers attribute is empty',
  25104. fail: 'The headers attribute is not exclusively used to refer to other cells in the table'
  25105. }
  25106. },
  25107. 'th-has-data-cells': {
  25108. impact: 'serious',
  25109. messages: {
  25110. pass: 'All table header cells refer to data cells',
  25111. fail: 'Not all table header cells refer to data cells',
  25112. incomplete: 'Table data cells are missing or empty'
  25113. }
  25114. },
  25115. 'hidden-content': {
  25116. impact: 'minor',
  25117. messages: {
  25118. pass: 'All content on the page has been analyzed.',
  25119. fail: 'There were problems analyzing the content on this page.',
  25120. incomplete: 'There is hidden content on the page that was not analyzed. You will need to trigger the display of this content in order to analyze it.'
  25121. }
  25122. }
  25123. },
  25124. failureSummaries: {
  25125. any: {
  25126. failureMessage: function anonymous(it) {
  25127. var out = 'Fix any of the following:';
  25128. var arr1 = it;
  25129. if (arr1) {
  25130. var value, i1 = -1, l1 = arr1.length - 1;
  25131. while (i1 < l1) {
  25132. value = arr1[i1 += 1];
  25133. out += '\n ' + value.split('\n').join('\n ');
  25134. }
  25135. }
  25136. return out;
  25137. }
  25138. },
  25139. none: {
  25140. failureMessage: function anonymous(it) {
  25141. var out = 'Fix all of the following:';
  25142. var arr1 = it;
  25143. if (arr1) {
  25144. var value, i1 = -1, l1 = arr1.length - 1;
  25145. while (i1 < l1) {
  25146. value = arr1[i1 += 1];
  25147. out += '\n ' + value.split('\n').join('\n ');
  25148. }
  25149. }
  25150. return out;
  25151. }
  25152. }
  25153. },
  25154. incompleteFallbackMessage: 'axe couldn\'t tell the reason. Time to break out the element inspector!'
  25155. },
  25156. rules: [ {
  25157. id: 'accesskeys',
  25158. selector: '[accesskey]',
  25159. excludeHidden: false,
  25160. tags: [ 'cat.keyboard', 'best-practice' ],
  25161. all: [],
  25162. any: [],
  25163. none: [ 'accesskeys' ]
  25164. }, {
  25165. id: 'area-alt',
  25166. selector: 'map area[href]',
  25167. excludeHidden: false,
  25168. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag244', 'wcag412', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT6.a' ],
  25169. actIds: [ 'c487ae' ],
  25170. all: [],
  25171. any: [ {
  25172. options: {
  25173. attribute: 'alt'
  25174. },
  25175. id: 'non-empty-alt'
  25176. }, 'aria-label', 'aria-labelledby', {
  25177. options: {
  25178. attribute: 'title'
  25179. },
  25180. id: 'non-empty-title'
  25181. } ],
  25182. none: []
  25183. }, {
  25184. id: 'aria-allowed-attr',
  25185. matches: 'aria-allowed-attr-matches',
  25186. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  25187. actIds: [ '5c01ea' ],
  25188. all: [],
  25189. any: [ {
  25190. options: {
  25191. validTreeRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ]
  25192. },
  25193. id: 'aria-allowed-attr'
  25194. } ],
  25195. none: [ 'aria-unsupported-attr', {
  25196. options: {
  25197. elementsAllowedAriaLabel: [ 'applet', 'input' ]
  25198. },
  25199. id: 'aria-prohibited-attr'
  25200. } ]
  25201. }, {
  25202. id: 'aria-allowed-role',
  25203. excludeHidden: false,
  25204. selector: '[role]',
  25205. matches: 'aria-allowed-role-matches',
  25206. tags: [ 'cat.aria', 'best-practice' ],
  25207. all: [],
  25208. any: [ {
  25209. options: {
  25210. allowImplicit: true,
  25211. ignoredTags: []
  25212. },
  25213. id: 'aria-allowed-role'
  25214. } ],
  25215. none: []
  25216. }, {
  25217. id: 'aria-command-name',
  25218. selector: '[role="link"], [role="button"], [role="menuitem"]',
  25219. matches: 'no-naming-method-matches',
  25220. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'ACT', 'TTv5', 'TT6.a' ],
  25221. actIds: [ '97a4e1' ],
  25222. all: [],
  25223. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  25224. options: {
  25225. attribute: 'title'
  25226. },
  25227. id: 'non-empty-title'
  25228. } ],
  25229. none: []
  25230. }, {
  25231. id: 'aria-dialog-name',
  25232. selector: '[role="dialog"], [role="alertdialog"]',
  25233. matches: 'no-naming-method-matches',
  25234. tags: [ 'cat.aria', 'best-practice' ],
  25235. all: [],
  25236. any: [ 'aria-label', 'aria-labelledby', {
  25237. options: {
  25238. attribute: 'title'
  25239. },
  25240. id: 'non-empty-title'
  25241. } ],
  25242. none: []
  25243. }, {
  25244. id: 'aria-hidden-body',
  25245. selector: 'body',
  25246. excludeHidden: false,
  25247. matches: 'is-initiator-matches',
  25248. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  25249. all: [],
  25250. any: [ 'aria-hidden-body' ],
  25251. none: []
  25252. }, {
  25253. id: 'aria-hidden-focus',
  25254. selector: '[aria-hidden="true"]',
  25255. matches: 'aria-hidden-focus-matches',
  25256. excludeHidden: false,
  25257. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412' ],
  25258. actIds: [ '6cfa84' ],
  25259. all: [ 'focusable-modal-open', 'focusable-disabled', 'focusable-not-tabbable' ],
  25260. any: [],
  25261. none: []
  25262. }, {
  25263. id: 'aria-input-field-name',
  25264. selector: '[role="combobox"], [role="listbox"], [role="searchbox"], [role="slider"], [role="spinbutton"], [role="textbox"]',
  25265. matches: 'no-naming-method-matches',
  25266. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'ACT', 'TTv5', 'TT5.c' ],
  25267. actIds: [ 'e086e5' ],
  25268. all: [],
  25269. any: [ 'aria-label', 'aria-labelledby', {
  25270. options: {
  25271. attribute: 'title'
  25272. },
  25273. id: 'non-empty-title'
  25274. } ],
  25275. none: [ 'no-implicit-explicit-label' ]
  25276. }, {
  25277. id: 'aria-meter-name',
  25278. selector: '[role="meter"]',
  25279. matches: 'no-naming-method-matches',
  25280. tags: [ 'cat.aria', 'wcag2a', 'wcag111' ],
  25281. all: [],
  25282. any: [ 'aria-label', 'aria-labelledby', {
  25283. options: {
  25284. attribute: 'title'
  25285. },
  25286. id: 'non-empty-title'
  25287. } ],
  25288. none: []
  25289. }, {
  25290. id: 'aria-progressbar-name',
  25291. selector: '[role="progressbar"]',
  25292. matches: 'no-naming-method-matches',
  25293. tags: [ 'cat.aria', 'wcag2a', 'wcag111' ],
  25294. all: [],
  25295. any: [ 'aria-label', 'aria-labelledby', {
  25296. options: {
  25297. attribute: 'title'
  25298. },
  25299. id: 'non-empty-title'
  25300. } ],
  25301. none: []
  25302. }, {
  25303. id: 'aria-required-attr',
  25304. selector: '[role]',
  25305. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  25306. actIds: [ '4e8ab6' ],
  25307. all: [],
  25308. any: [ 'aria-required-attr' ],
  25309. none: []
  25310. }, {
  25311. id: 'aria-required-children',
  25312. selector: '[role]',
  25313. matches: 'aria-required-children-matches',
  25314. tags: [ 'cat.aria', 'wcag2a', 'wcag131' ],
  25315. actIds: [ 'bc4a75', 'ff89c9' ],
  25316. all: [],
  25317. any: [ {
  25318. options: {
  25319. reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'menu', 'menubar', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ]
  25320. },
  25321. id: 'aria-required-children'
  25322. }, 'aria-busy' ],
  25323. none: []
  25324. }, {
  25325. id: 'aria-required-parent',
  25326. selector: '[role]',
  25327. matches: 'aria-required-parent-matches',
  25328. tags: [ 'cat.aria', 'wcag2a', 'wcag131' ],
  25329. actIds: [ 'ff89c9' ],
  25330. all: [],
  25331. any: [ {
  25332. options: {
  25333. ownGroupRoles: [ 'listitem', 'treeitem' ]
  25334. },
  25335. id: 'aria-required-parent'
  25336. } ],
  25337. none: []
  25338. }, {
  25339. id: 'aria-roledescription',
  25340. selector: '[aria-roledescription]',
  25341. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'deprecated' ],
  25342. enabled: false,
  25343. all: [],
  25344. any: [ {
  25345. options: {
  25346. supportedRoles: [ 'button', 'img', 'checkbox', 'radio', 'combobox', 'menuitemcheckbox', 'menuitemradio' ]
  25347. },
  25348. id: 'aria-roledescription'
  25349. } ],
  25350. none: []
  25351. }, {
  25352. id: 'aria-roles',
  25353. selector: '[role]',
  25354. matches: 'no-empty-role-matches',
  25355. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  25356. actIds: [ '674b10' ],
  25357. all: [],
  25358. any: [],
  25359. none: [ 'invalidrole', 'abstractrole', 'unsupportedrole', 'deprecatedrole' ]
  25360. }, {
  25361. id: 'aria-text',
  25362. selector: '[role=text]',
  25363. tags: [ 'cat.aria', 'best-practice' ],
  25364. all: [],
  25365. any: [ 'no-focusable-content' ],
  25366. none: []
  25367. }, {
  25368. id: 'aria-toggle-field-name',
  25369. selector: '[role="checkbox"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="radio"], [role="switch"], [role="option"]',
  25370. matches: 'no-naming-method-matches',
  25371. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'ACT', 'TTv5', 'TT5.c' ],
  25372. actIds: [ 'e086e5' ],
  25373. all: [],
  25374. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  25375. options: {
  25376. attribute: 'title'
  25377. },
  25378. id: 'non-empty-title'
  25379. } ],
  25380. none: [ 'no-implicit-explicit-label' ]
  25381. }, {
  25382. id: 'aria-tooltip-name',
  25383. selector: '[role="tooltip"]',
  25384. matches: 'no-naming-method-matches',
  25385. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  25386. all: [],
  25387. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  25388. options: {
  25389. attribute: 'title'
  25390. },
  25391. id: 'non-empty-title'
  25392. } ],
  25393. none: []
  25394. }, {
  25395. id: 'aria-treeitem-name',
  25396. selector: '[role="treeitem"]',
  25397. matches: 'no-naming-method-matches',
  25398. tags: [ 'cat.aria', 'best-practice' ],
  25399. all: [],
  25400. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  25401. options: {
  25402. attribute: 'title'
  25403. },
  25404. id: 'non-empty-title'
  25405. } ],
  25406. none: []
  25407. }, {
  25408. id: 'aria-valid-attr-value',
  25409. matches: 'aria-has-attr-matches',
  25410. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  25411. actIds: [ '6a7281' ],
  25412. all: [ {
  25413. options: [],
  25414. id: 'aria-valid-attr-value'
  25415. }, 'aria-errormessage', 'aria-level' ],
  25416. any: [],
  25417. none: []
  25418. }, {
  25419. id: 'aria-valid-attr',
  25420. matches: 'aria-has-attr-matches',
  25421. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  25422. actIds: [ '5f99a7' ],
  25423. all: [],
  25424. any: [ {
  25425. options: [],
  25426. id: 'aria-valid-attr'
  25427. } ],
  25428. none: []
  25429. }, {
  25430. id: 'audio-caption',
  25431. selector: 'audio',
  25432. enabled: false,
  25433. excludeHidden: false,
  25434. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag121', 'section508', 'section508.22.a', 'deprecated' ],
  25435. actIds: [ '2eb176', 'afb423' ],
  25436. all: [],
  25437. any: [],
  25438. none: [ 'caption' ]
  25439. }, {
  25440. id: 'autocomplete-valid',
  25441. matches: 'autocomplete-matches',
  25442. tags: [ 'cat.forms', 'wcag21aa', 'wcag135', 'ACT' ],
  25443. actIds: [ '73f2c2' ],
  25444. all: [ {
  25445. options: {
  25446. stateTerms: [ 'none', 'false', 'true', 'disabled', 'enabled', 'undefined', 'null' ]
  25447. },
  25448. id: 'autocomplete-valid'
  25449. } ],
  25450. any: [],
  25451. none: []
  25452. }, {
  25453. id: 'avoid-inline-spacing',
  25454. selector: '[style]',
  25455. matches: 'is-visible-on-screen-matches',
  25456. tags: [ 'cat.structure', 'wcag21aa', 'wcag1412', 'ACT' ],
  25457. actIds: [ '24afc2', '9e45ec', '78fd32' ],
  25458. all: [ {
  25459. options: {
  25460. cssProperty: 'letter-spacing',
  25461. minValue: .12
  25462. },
  25463. id: 'important-letter-spacing'
  25464. }, {
  25465. options: {
  25466. cssProperty: 'word-spacing',
  25467. minValue: .16
  25468. },
  25469. id: 'important-word-spacing'
  25470. }, {
  25471. options: {
  25472. multiLineOnly: true,
  25473. cssProperty: 'line-height',
  25474. minValue: 1.5,
  25475. normalValue: 1
  25476. },
  25477. id: 'important-line-height'
  25478. } ],
  25479. any: [],
  25480. none: []
  25481. }, {
  25482. id: 'blink',
  25483. selector: 'blink',
  25484. excludeHidden: false,
  25485. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag222', 'section508', 'section508.22.j', 'TTv5', 'TT2.b' ],
  25486. all: [],
  25487. any: [],
  25488. none: [ 'is-on-screen' ]
  25489. }, {
  25490. id: 'button-name',
  25491. selector: 'button',
  25492. matches: 'no-explicit-name-required-matches',
  25493. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT6.a' ],
  25494. actIds: [ '97a4e1', 'm6b1q3' ],
  25495. all: [],
  25496. any: [ 'button-has-visible-text', 'aria-label', 'aria-labelledby', {
  25497. options: {
  25498. attribute: 'title'
  25499. },
  25500. id: 'non-empty-title'
  25501. }, 'presentational-role' ],
  25502. none: []
  25503. }, {
  25504. id: 'bypass',
  25505. selector: 'html',
  25506. pageLevel: true,
  25507. matches: 'bypass-matches',
  25508. reviewOnFail: true,
  25509. tags: [ 'cat.keyboard', 'wcag2a', 'wcag241', 'section508', 'section508.22.o', 'TTv5', 'TT9.a' ],
  25510. actIds: [ 'cf77f2', '047fe0', 'b40fd1', '3e12e1', 'ye5d6e' ],
  25511. all: [],
  25512. any: [ 'internal-link-present', {
  25513. options: {
  25514. selector: ':is(h1, h2, h3, h4, h5, h6):not([role]), [role=heading]'
  25515. },
  25516. id: 'header-present'
  25517. }, {
  25518. options: {
  25519. selector: 'main, [role=main]'
  25520. },
  25521. id: 'landmark'
  25522. } ],
  25523. none: []
  25524. }, {
  25525. id: 'color-contrast-enhanced',
  25526. matches: 'color-contrast-matches',
  25527. excludeHidden: false,
  25528. enabled: false,
  25529. tags: [ 'cat.color', 'wcag2aaa', 'wcag146', 'ACT' ],
  25530. actIds: [ '09o5cg' ],
  25531. all: [],
  25532. any: [ {
  25533. options: {
  25534. ignoreUnicode: true,
  25535. ignoreLength: false,
  25536. ignorePseudo: false,
  25537. boldValue: 700,
  25538. boldTextPt: 14,
  25539. largeTextPt: 18,
  25540. contrastRatio: {
  25541. normal: {
  25542. expected: 7,
  25543. minThreshold: 4.5
  25544. },
  25545. large: {
  25546. expected: 4.5,
  25547. minThreshold: 3
  25548. }
  25549. },
  25550. pseudoSizeThreshold: .25,
  25551. shadowOutlineEmMax: .1,
  25552. textStrokeEmMin: .03
  25553. },
  25554. id: 'color-contrast-enhanced'
  25555. } ],
  25556. none: []
  25557. }, {
  25558. id: 'color-contrast',
  25559. matches: 'color-contrast-matches',
  25560. excludeHidden: false,
  25561. tags: [ 'cat.color', 'wcag2aa', 'wcag143', 'ACT', 'TTv5', 'TT13.c' ],
  25562. actIds: [ 'afw4f7', '09o5cg' ],
  25563. all: [],
  25564. any: [ {
  25565. options: {
  25566. ignoreUnicode: true,
  25567. ignoreLength: false,
  25568. ignorePseudo: false,
  25569. boldValue: 700,
  25570. boldTextPt: 14,
  25571. largeTextPt: 18,
  25572. contrastRatio: {
  25573. normal: {
  25574. expected: 4.5
  25575. },
  25576. large: {
  25577. expected: 3
  25578. }
  25579. },
  25580. pseudoSizeThreshold: .25,
  25581. shadowOutlineEmMax: .2,
  25582. textStrokeEmMin: .03
  25583. },
  25584. id: 'color-contrast'
  25585. } ],
  25586. none: []
  25587. }, {
  25588. id: 'css-orientation-lock',
  25589. selector: 'html',
  25590. tags: [ 'cat.structure', 'wcag134', 'wcag21aa', 'experimental' ],
  25591. actIds: [ 'b33eff' ],
  25592. all: [ {
  25593. options: {
  25594. degreeThreshold: 2
  25595. },
  25596. id: 'css-orientation-lock'
  25597. } ],
  25598. any: [],
  25599. none: [],
  25600. preload: true
  25601. }, {
  25602. id: 'definition-list',
  25603. selector: 'dl',
  25604. matches: 'no-role-matches',
  25605. tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
  25606. all: [],
  25607. any: [],
  25608. none: [ 'structured-dlitems', {
  25609. options: {
  25610. validRoles: [ 'definition', 'term', 'listitem' ],
  25611. validNodeNames: [ 'dt', 'dd' ],
  25612. divGroups: true
  25613. },
  25614. id: 'only-dlitems'
  25615. } ]
  25616. }, {
  25617. id: 'dlitem',
  25618. selector: 'dd, dt',
  25619. matches: 'no-role-matches',
  25620. tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
  25621. all: [],
  25622. any: [ 'dlitem' ],
  25623. none: []
  25624. }, {
  25625. id: 'document-title',
  25626. selector: 'html',
  25627. matches: 'is-initiator-matches',
  25628. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag242', 'ACT', 'TTv5', 'TT12.a' ],
  25629. actIds: [ '2779a5' ],
  25630. all: [],
  25631. any: [ 'doc-has-title' ],
  25632. none: []
  25633. }, {
  25634. id: 'duplicate-id-active',
  25635. selector: '[id]',
  25636. matches: 'duplicate-id-active-matches',
  25637. excludeHidden: false,
  25638. tags: [ 'cat.parsing', 'wcag2a', 'wcag411' ],
  25639. actIds: [ '3ea0c8' ],
  25640. all: [],
  25641. any: [ 'duplicate-id-active' ],
  25642. none: []
  25643. }, {
  25644. id: 'duplicate-id-aria',
  25645. selector: '[id]',
  25646. matches: 'duplicate-id-aria-matches',
  25647. excludeHidden: false,
  25648. tags: [ 'cat.parsing', 'wcag2a', 'wcag411' ],
  25649. actIds: [ '3ea0c8' ],
  25650. all: [],
  25651. any: [ 'duplicate-id-aria' ],
  25652. none: []
  25653. }, {
  25654. id: 'duplicate-id',
  25655. selector: '[id]',
  25656. matches: 'duplicate-id-misc-matches',
  25657. excludeHidden: false,
  25658. tags: [ 'cat.parsing', 'wcag2a', 'wcag411' ],
  25659. actIds: [ '3ea0c8' ],
  25660. all: [],
  25661. any: [ 'duplicate-id' ],
  25662. none: []
  25663. }, {
  25664. id: 'empty-heading',
  25665. selector: 'h1, h2, h3, h4, h5, h6, [role="heading"]',
  25666. matches: 'heading-matches',
  25667. tags: [ 'cat.name-role-value', 'best-practice' ],
  25668. actIds: [ 'ffd0e9' ],
  25669. impact: 'minor',
  25670. all: [],
  25671. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  25672. options: {
  25673. attribute: 'title'
  25674. },
  25675. id: 'non-empty-title'
  25676. } ],
  25677. none: []
  25678. }, {
  25679. id: 'empty-table-header',
  25680. selector: 'th:not([role]), [role="rowheader"], [role="columnheader"]',
  25681. tags: [ 'cat.name-role-value', 'best-practice' ],
  25682. all: [],
  25683. any: [ 'has-visible-text' ],
  25684. none: []
  25685. }, {
  25686. id: 'focus-order-semantics',
  25687. selector: 'div, h1, h2, h3, h4, h5, h6, [role=heading], p, span',
  25688. matches: 'inserted-into-focus-order-matches',
  25689. tags: [ 'cat.keyboard', 'best-practice', 'experimental' ],
  25690. all: [],
  25691. any: [ {
  25692. options: [],
  25693. id: 'has-widget-role'
  25694. }, {
  25695. options: {
  25696. roles: [ 'tooltip' ]
  25697. },
  25698. id: 'valid-scrollable-semantics'
  25699. } ],
  25700. none: []
  25701. }, {
  25702. id: 'form-field-multiple-labels',
  25703. selector: 'input, select, textarea',
  25704. matches: 'label-matches',
  25705. tags: [ 'cat.forms', 'wcag2a', 'wcag332', 'TTv5', 'TT5.c' ],
  25706. all: [],
  25707. any: [],
  25708. none: [ 'multiple-label' ]
  25709. }, {
  25710. id: 'frame-focusable-content',
  25711. selector: 'html',
  25712. matches: 'frame-focusable-content-matches',
  25713. tags: [ 'cat.keyboard', 'wcag2a', 'wcag211', 'TTv5', 'TT4.a' ],
  25714. actIds: [ 'akn7bn' ],
  25715. all: [],
  25716. any: [ 'frame-focusable-content' ],
  25717. none: []
  25718. }, {
  25719. id: 'frame-tested',
  25720. selector: 'html, frame, iframe',
  25721. tags: [ 'cat.structure', 'review-item', 'best-practice' ],
  25722. all: [ {
  25723. options: {
  25724. isViolation: false
  25725. },
  25726. id: 'frame-tested'
  25727. } ],
  25728. any: [],
  25729. none: []
  25730. }, {
  25731. id: 'frame-title-unique',
  25732. selector: 'frame[title], iframe[title]',
  25733. matches: 'frame-title-has-text-matches',
  25734. tags: [ 'cat.text-alternatives', 'wcag412', 'wcag2a', 'TTv5', 'TT12.c' ],
  25735. actIds: [ '4b1c6c' ],
  25736. all: [],
  25737. any: [],
  25738. none: [ 'unique-frame-title' ],
  25739. reviewOnFail: true
  25740. }, {
  25741. id: 'frame-title',
  25742. selector: 'frame, iframe',
  25743. matches: 'no-negative-tabindex-matches',
  25744. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag412', 'section508', 'section508.22.i', 'TTv5', 'TT12.c' ],
  25745. actIds: [ 'cae760' ],
  25746. all: [],
  25747. any: [ {
  25748. options: {
  25749. attribute: 'title'
  25750. },
  25751. id: 'non-empty-title'
  25752. }, 'aria-label', 'aria-labelledby', 'presentational-role' ],
  25753. none: []
  25754. }, {
  25755. id: 'heading-order',
  25756. selector: 'h1, h2, h3, h4, h5, h6, [role=heading]',
  25757. matches: 'heading-matches',
  25758. tags: [ 'cat.semantics', 'best-practice' ],
  25759. all: [],
  25760. any: [ 'heading-order' ],
  25761. none: []
  25762. }, {
  25763. id: 'hidden-content',
  25764. selector: '*',
  25765. excludeHidden: false,
  25766. tags: [ 'cat.structure', 'experimental', 'review-item', 'best-practice' ],
  25767. all: [],
  25768. any: [ 'hidden-content' ],
  25769. none: []
  25770. }, {
  25771. id: 'html-has-lang',
  25772. selector: 'html',
  25773. matches: 'is-initiator-matches',
  25774. tags: [ 'cat.language', 'wcag2a', 'wcag311', 'ACT', 'TTv5', 'TT11.a' ],
  25775. actIds: [ 'b5c3f8' ],
  25776. all: [],
  25777. any: [ {
  25778. options: {
  25779. attributes: [ 'lang', 'xml:lang' ]
  25780. },
  25781. id: 'has-lang'
  25782. } ],
  25783. none: []
  25784. }, {
  25785. id: 'html-lang-valid',
  25786. selector: 'html[lang]:not([lang=""]), html[xml\\:lang]:not([xml\\:lang=""])',
  25787. tags: [ 'cat.language', 'wcag2a', 'wcag311', 'ACT', 'TTv5', 'TT11.a' ],
  25788. actIds: [ 'bf051a' ],
  25789. all: [],
  25790. any: [],
  25791. none: [ {
  25792. options: {
  25793. attributes: [ 'lang', 'xml:lang' ]
  25794. },
  25795. id: 'valid-lang'
  25796. } ]
  25797. }, {
  25798. id: 'html-xml-lang-mismatch',
  25799. selector: 'html[lang][xml\\:lang]',
  25800. matches: 'xml-lang-mismatch-matches',
  25801. tags: [ 'cat.language', 'wcag2a', 'wcag311', 'ACT' ],
  25802. actIds: [ '5b7ae0' ],
  25803. all: [ 'xml-lang-mismatch' ],
  25804. any: [],
  25805. none: []
  25806. }, {
  25807. id: 'identical-links-same-purpose',
  25808. selector: 'a[href], area[href], [role="link"]',
  25809. excludeHidden: false,
  25810. enabled: false,
  25811. matches: 'identical-links-same-purpose-matches',
  25812. tags: [ 'cat.semantics', 'wcag2aaa', 'wcag249' ],
  25813. actIds: [ 'b20e66' ],
  25814. all: [ 'identical-links-same-purpose' ],
  25815. any: [],
  25816. none: []
  25817. }, {
  25818. id: 'image-alt',
  25819. selector: 'img',
  25820. matches: 'no-explicit-name-required-matches',
  25821. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT7.a', 'TT7.b' ],
  25822. actIds: [ '23a2a8' ],
  25823. all: [],
  25824. any: [ 'has-alt', 'aria-label', 'aria-labelledby', {
  25825. options: {
  25826. attribute: 'title'
  25827. },
  25828. id: 'non-empty-title'
  25829. }, 'presentational-role' ],
  25830. none: [ 'alt-space-value' ]
  25831. }, {
  25832. id: 'image-redundant-alt',
  25833. selector: 'img',
  25834. tags: [ 'cat.text-alternatives', 'best-practice' ],
  25835. all: [],
  25836. any: [],
  25837. none: [ {
  25838. options: {
  25839. parentSelector: 'button, [role=button], a[href], p, li, td, th'
  25840. },
  25841. id: 'duplicate-img-label'
  25842. } ]
  25843. }, {
  25844. id: 'input-button-name',
  25845. selector: 'input[type="button"], input[type="submit"], input[type="reset"]',
  25846. matches: 'no-explicit-name-required-matches',
  25847. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT5.c' ],
  25848. actIds: [ '97a4e1' ],
  25849. all: [],
  25850. any: [ 'non-empty-if-present', {
  25851. options: {
  25852. attribute: 'value'
  25853. },
  25854. id: 'non-empty-value'
  25855. }, 'aria-label', 'aria-labelledby', {
  25856. options: {
  25857. attribute: 'title'
  25858. },
  25859. id: 'non-empty-title'
  25860. }, 'presentational-role' ],
  25861. none: []
  25862. }, {
  25863. id: 'input-image-alt',
  25864. selector: 'input[type="image"]',
  25865. matches: 'no-explicit-name-required-matches',
  25866. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'wcag412', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT7.a' ],
  25867. actIds: [ '59796f' ],
  25868. all: [],
  25869. any: [ {
  25870. options: {
  25871. attribute: 'alt'
  25872. },
  25873. id: 'non-empty-alt'
  25874. }, 'aria-label', 'aria-labelledby', {
  25875. options: {
  25876. attribute: 'title'
  25877. },
  25878. id: 'non-empty-title'
  25879. } ],
  25880. none: []
  25881. }, {
  25882. id: 'label-content-name-mismatch',
  25883. matches: 'label-content-name-mismatch-matches',
  25884. tags: [ 'cat.semantics', 'wcag21a', 'wcag253', 'experimental' ],
  25885. actIds: [ '2ee8b8' ],
  25886. all: [],
  25887. any: [ {
  25888. options: {
  25889. pixelThreshold: .1,
  25890. occurrenceThreshold: 3
  25891. },
  25892. id: 'label-content-name-mismatch'
  25893. } ],
  25894. none: []
  25895. }, {
  25896. id: 'label-title-only',
  25897. selector: 'input, select, textarea',
  25898. matches: 'label-matches',
  25899. tags: [ 'cat.forms', 'best-practice' ],
  25900. all: [],
  25901. any: [],
  25902. none: [ 'title-only' ]
  25903. }, {
  25904. id: 'label',
  25905. selector: 'input, textarea',
  25906. matches: 'label-matches',
  25907. tags: [ 'cat.forms', 'wcag2a', 'wcag412', 'section508', 'section508.22.n', 'ACT', 'TTv5', 'TT5.c' ],
  25908. actIds: [ 'e086e5' ],
  25909. all: [],
  25910. any: [ 'implicit-label', 'explicit-label', 'aria-label', 'aria-labelledby', {
  25911. options: {
  25912. attribute: 'title'
  25913. },
  25914. id: 'non-empty-title'
  25915. }, {
  25916. options: {
  25917. attribute: 'placeholder'
  25918. },
  25919. id: 'non-empty-placeholder'
  25920. }, 'presentational-role' ],
  25921. none: [ 'help-same-as-label', 'hidden-explicit-label' ]
  25922. }, {
  25923. id: 'landmark-banner-is-top-level',
  25924. selector: 'header:not([role]), [role=banner]',
  25925. matches: 'landmark-has-body-context-matches',
  25926. tags: [ 'cat.semantics', 'best-practice' ],
  25927. all: [],
  25928. any: [ 'landmark-is-top-level' ],
  25929. none: []
  25930. }, {
  25931. id: 'landmark-complementary-is-top-level',
  25932. selector: 'aside:not([role]), [role=complementary]',
  25933. tags: [ 'cat.semantics', 'best-practice' ],
  25934. all: [],
  25935. any: [ 'landmark-is-top-level' ],
  25936. none: []
  25937. }, {
  25938. id: 'landmark-contentinfo-is-top-level',
  25939. selector: 'footer:not([role]), [role=contentinfo]',
  25940. matches: 'landmark-has-body-context-matches',
  25941. tags: [ 'cat.semantics', 'best-practice' ],
  25942. all: [],
  25943. any: [ 'landmark-is-top-level' ],
  25944. none: []
  25945. }, {
  25946. id: 'landmark-main-is-top-level',
  25947. selector: 'main:not([role]), [role=main]',
  25948. tags: [ 'cat.semantics', 'best-practice' ],
  25949. all: [],
  25950. any: [ 'landmark-is-top-level' ],
  25951. none: []
  25952. }, {
  25953. id: 'landmark-no-duplicate-banner',
  25954. selector: 'header:not([role]), [role=banner]',
  25955. tags: [ 'cat.semantics', 'best-practice' ],
  25956. all: [],
  25957. any: [ {
  25958. options: {
  25959. selector: 'header:not([role]), [role=banner]',
  25960. nativeScopeFilter: 'article, aside, main, nav, section'
  25961. },
  25962. id: 'page-no-duplicate-banner'
  25963. } ],
  25964. none: []
  25965. }, {
  25966. id: 'landmark-no-duplicate-contentinfo',
  25967. selector: 'footer:not([role]), [role=contentinfo]',
  25968. tags: [ 'cat.semantics', 'best-practice' ],
  25969. all: [],
  25970. any: [ {
  25971. options: {
  25972. selector: 'footer:not([role]), [role=contentinfo]',
  25973. nativeScopeFilter: 'article, aside, main, nav, section'
  25974. },
  25975. id: 'page-no-duplicate-contentinfo'
  25976. } ],
  25977. none: []
  25978. }, {
  25979. id: 'landmark-no-duplicate-main',
  25980. selector: 'main:not([role]), [role=main]',
  25981. tags: [ 'cat.semantics', 'best-practice' ],
  25982. all: [],
  25983. any: [ {
  25984. options: {
  25985. selector: 'main:not([role]), [role=\'main\']'
  25986. },
  25987. id: 'page-no-duplicate-main'
  25988. } ],
  25989. none: []
  25990. }, {
  25991. id: 'landmark-one-main',
  25992. selector: 'html',
  25993. tags: [ 'cat.semantics', 'best-practice' ],
  25994. all: [ {
  25995. options: {
  25996. selector: 'main:not([role]), [role=\'main\']',
  25997. passForModal: true
  25998. },
  25999. id: 'page-has-main'
  26000. } ],
  26001. any: [],
  26002. none: []
  26003. }, {
  26004. id: 'landmark-unique',
  26005. selector: '[role=banner], [role=complementary], [role=contentinfo], [role=main], [role=navigation], [role=region], [role=search], [role=form], form, footer, header, aside, main, nav, section',
  26006. tags: [ 'cat.semantics', 'best-practice' ],
  26007. matches: 'landmark-unique-matches',
  26008. all: [],
  26009. any: [ 'landmark-is-unique' ],
  26010. none: []
  26011. }, {
  26012. id: 'link-in-text-block',
  26013. selector: 'a[href], [role=link]',
  26014. matches: 'link-in-text-block-matches',
  26015. excludeHidden: false,
  26016. tags: [ 'cat.color', 'wcag2a', 'wcag141', 'TTv5', 'TT13.a' ],
  26017. all: [],
  26018. any: [ {
  26019. options: {
  26020. requiredContrastRatio: 3,
  26021. allowSameColor: true
  26022. },
  26023. id: 'link-in-text-block'
  26024. }, 'link-in-text-block-style' ],
  26025. none: []
  26026. }, {
  26027. id: 'link-name',
  26028. selector: 'a[href]',
  26029. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'wcag244', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT6.a' ],
  26030. actIds: [ 'c487ae' ],
  26031. all: [],
  26032. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  26033. options: {
  26034. attribute: 'title'
  26035. },
  26036. id: 'non-empty-title'
  26037. } ],
  26038. none: [ 'focusable-no-name' ]
  26039. }, {
  26040. id: 'list',
  26041. selector: 'ul, ol',
  26042. matches: 'no-role-matches',
  26043. tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
  26044. all: [],
  26045. any: [],
  26046. none: [ {
  26047. options: {
  26048. validRoles: [ 'listitem' ],
  26049. validNodeNames: [ 'li' ]
  26050. },
  26051. id: 'only-listitems'
  26052. } ]
  26053. }, {
  26054. id: 'listitem',
  26055. selector: 'li',
  26056. matches: 'no-role-matches',
  26057. tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
  26058. all: [],
  26059. any: [ 'listitem' ],
  26060. none: []
  26061. }, {
  26062. id: 'marquee',
  26063. selector: 'marquee',
  26064. excludeHidden: false,
  26065. tags: [ 'cat.parsing', 'wcag2a', 'wcag222', 'TTv5', 'TT2.b' ],
  26066. all: [],
  26067. any: [],
  26068. none: [ 'is-on-screen' ]
  26069. }, {
  26070. id: 'meta-refresh-no-exceptions',
  26071. selector: 'meta[http-equiv="refresh"][content]',
  26072. excludeHidden: false,
  26073. enabled: false,
  26074. tags: [ 'cat.time-and-media', 'wcag2aaa', 'wcag224', 'wcag325' ],
  26075. actIds: [ 'bisz58' ],
  26076. all: [],
  26077. any: [ {
  26078. options: {
  26079. minDelay: 72e3,
  26080. maxDelay: false
  26081. },
  26082. id: 'meta-refresh-no-exceptions'
  26083. } ],
  26084. none: []
  26085. }, {
  26086. id: 'meta-refresh',
  26087. selector: 'meta[http-equiv="refresh"][content]',
  26088. excludeHidden: false,
  26089. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag221', 'TTv5', 'TT2.c' ],
  26090. actIds: [ 'bc659a', 'bisz58' ],
  26091. all: [],
  26092. any: [ {
  26093. options: {
  26094. minDelay: 0,
  26095. maxDelay: 72e3
  26096. },
  26097. id: 'meta-refresh'
  26098. } ],
  26099. none: []
  26100. }, {
  26101. id: 'meta-viewport-large',
  26102. selector: 'meta[name="viewport"]',
  26103. matches: 'is-initiator-matches',
  26104. excludeHidden: false,
  26105. tags: [ 'cat.sensory-and-visual-cues', 'best-practice' ],
  26106. all: [],
  26107. any: [ {
  26108. options: {
  26109. scaleMinimum: 5,
  26110. lowerBound: 2
  26111. },
  26112. id: 'meta-viewport-large'
  26113. } ],
  26114. none: []
  26115. }, {
  26116. id: 'meta-viewport',
  26117. selector: 'meta[name="viewport"]',
  26118. matches: 'is-initiator-matches',
  26119. excludeHidden: false,
  26120. tags: [ 'cat.sensory-and-visual-cues', 'wcag2aa', 'wcag144', 'ACT' ],
  26121. actIds: [ 'b4f0c3' ],
  26122. all: [],
  26123. any: [ {
  26124. options: {
  26125. scaleMinimum: 2
  26126. },
  26127. id: 'meta-viewport'
  26128. } ],
  26129. none: []
  26130. }, {
  26131. id: 'nested-interactive',
  26132. matches: 'nested-interactive-matches',
  26133. tags: [ 'cat.keyboard', 'wcag2a', 'wcag412', 'TTv5', 'TT4.a' ],
  26134. actIds: [ '307n5z' ],
  26135. all: [],
  26136. any: [ 'no-focusable-content' ],
  26137. none: []
  26138. }, {
  26139. id: 'no-autoplay-audio',
  26140. excludeHidden: false,
  26141. selector: 'audio[autoplay], video[autoplay]',
  26142. matches: 'no-autoplay-audio-matches',
  26143. reviewOnFail: true,
  26144. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag142', 'ACT', 'TTv5', 'TT2.a' ],
  26145. actIds: [ '80f0bf' ],
  26146. preload: true,
  26147. all: [ {
  26148. options: {
  26149. allowedDuration: 3
  26150. },
  26151. id: 'no-autoplay-audio'
  26152. } ],
  26153. any: [],
  26154. none: []
  26155. }, {
  26156. id: 'object-alt',
  26157. selector: 'object[data]',
  26158. matches: 'object-is-loaded-matches',
  26159. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a' ],
  26160. actIds: [ '8fc3b6' ],
  26161. all: [],
  26162. any: [ 'aria-label', 'aria-labelledby', {
  26163. options: {
  26164. attribute: 'title'
  26165. },
  26166. id: 'non-empty-title'
  26167. }, 'presentational-role' ],
  26168. none: []
  26169. }, {
  26170. id: 'p-as-heading',
  26171. selector: 'p',
  26172. matches: 'p-as-heading-matches',
  26173. tags: [ 'cat.semantics', 'wcag2a', 'wcag131', 'experimental' ],
  26174. all: [ {
  26175. options: {
  26176. margins: [ {
  26177. weight: 150,
  26178. italic: true
  26179. }, {
  26180. weight: 150,
  26181. size: 1.15
  26182. }, {
  26183. italic: true,
  26184. size: 1.15
  26185. }, {
  26186. size: 1.4
  26187. } ],
  26188. passLength: 1,
  26189. failLength: .5
  26190. },
  26191. id: 'p-as-heading'
  26192. } ],
  26193. any: [],
  26194. none: []
  26195. }, {
  26196. id: 'page-has-heading-one',
  26197. selector: 'html',
  26198. tags: [ 'cat.semantics', 'best-practice' ],
  26199. all: [ {
  26200. options: {
  26201. selector: 'h1:not([role], [aria-level]), :is(h1, h2, h3, h4, h5, h6):not([role])[aria-level=1], [role=heading][aria-level=1]',
  26202. passForModal: true
  26203. },
  26204. id: 'page-has-heading-one'
  26205. } ],
  26206. any: [],
  26207. none: []
  26208. }, {
  26209. id: 'presentation-role-conflict',
  26210. selector: 'img[alt=\'\'], [role="none"], [role="presentation"]',
  26211. matches: 'has-implicit-chromium-role-matches',
  26212. tags: [ 'cat.aria', 'best-practice', 'ACT' ],
  26213. actIds: [ '46ca7f' ],
  26214. all: [],
  26215. any: [],
  26216. none: [ 'is-element-focusable', 'has-global-aria-attribute' ]
  26217. }, {
  26218. id: 'region',
  26219. selector: 'body *',
  26220. tags: [ 'cat.keyboard', 'best-practice' ],
  26221. all: [],
  26222. any: [ {
  26223. options: {
  26224. regionMatcher: 'dialog, [role=dialog], [role=alertdialog], svg'
  26225. },
  26226. id: 'region'
  26227. } ],
  26228. none: []
  26229. }, {
  26230. id: 'role-img-alt',
  26231. selector: '[role=\'img\']:not(img, area, input, object)',
  26232. matches: 'html-namespace-matches',
  26233. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT7.a' ],
  26234. actIds: [ '23a2a8' ],
  26235. all: [],
  26236. any: [ 'aria-label', 'aria-labelledby', {
  26237. options: {
  26238. attribute: 'title'
  26239. },
  26240. id: 'non-empty-title'
  26241. } ],
  26242. none: []
  26243. }, {
  26244. id: 'scope-attr-valid',
  26245. selector: 'td[scope], th[scope]',
  26246. tags: [ 'cat.tables', 'best-practice' ],
  26247. all: [ 'html5-scope', {
  26248. options: {
  26249. values: [ 'row', 'col', 'rowgroup', 'colgroup' ]
  26250. },
  26251. id: 'scope-value'
  26252. } ],
  26253. any: [],
  26254. none: []
  26255. }, {
  26256. id: 'scrollable-region-focusable',
  26257. selector: '*:not(select,textarea)',
  26258. matches: 'scrollable-region-focusable-matches',
  26259. tags: [ 'cat.keyboard', 'wcag2a', 'wcag211' ],
  26260. actIds: [ '0ssw9k' ],
  26261. all: [],
  26262. any: [ 'focusable-content', 'focusable-element' ],
  26263. none: []
  26264. }, {
  26265. id: 'select-name',
  26266. selector: 'select',
  26267. tags: [ 'cat.forms', 'wcag2a', 'wcag412', 'section508', 'section508.22.n', 'ACT', 'TTv5', 'TT5.c' ],
  26268. actIds: [ 'e086e5' ],
  26269. all: [],
  26270. any: [ 'implicit-label', 'explicit-label', 'aria-label', 'aria-labelledby', {
  26271. options: {
  26272. attribute: 'title'
  26273. },
  26274. id: 'non-empty-title'
  26275. }, 'presentational-role' ],
  26276. none: [ 'help-same-as-label', 'hidden-explicit-label' ]
  26277. }, {
  26278. id: 'server-side-image-map',
  26279. selector: 'img[ismap]',
  26280. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag211', 'section508', 'section508.22.f' ],
  26281. all: [],
  26282. any: [],
  26283. none: [ 'exists' ]
  26284. }, {
  26285. id: 'skip-link',
  26286. selector: 'a[href^="#"], a[href^="/#"]',
  26287. matches: 'skip-link-matches',
  26288. tags: [ 'cat.keyboard', 'best-practice' ],
  26289. all: [],
  26290. any: [ 'skip-link' ],
  26291. none: []
  26292. }, {
  26293. id: 'svg-img-alt',
  26294. selector: '[role="img"], [role="graphics-symbol"], svg[role="graphics-document"]',
  26295. matches: 'svg-namespace-matches',
  26296. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'ACT', 'TTv5', 'TT7.a' ],
  26297. actIds: [ '7d6734' ],
  26298. all: [],
  26299. any: [ 'svg-non-empty-title', 'aria-label', 'aria-labelledby', {
  26300. options: {
  26301. attribute: 'title'
  26302. },
  26303. id: 'non-empty-title'
  26304. } ],
  26305. none: []
  26306. }, {
  26307. id: 'tabindex',
  26308. selector: '[tabindex]',
  26309. tags: [ 'cat.keyboard', 'best-practice' ],
  26310. all: [],
  26311. any: [ 'tabindex' ],
  26312. none: []
  26313. }, {
  26314. id: 'table-duplicate-name',
  26315. selector: 'table',
  26316. tags: [ 'cat.tables', 'best-practice' ],
  26317. all: [],
  26318. any: [],
  26319. none: [ 'same-caption-summary' ]
  26320. }, {
  26321. id: 'table-fake-caption',
  26322. selector: 'table',
  26323. matches: 'data-table-matches',
  26324. tags: [ 'cat.tables', 'experimental', 'wcag2a', 'wcag131', 'section508', 'section508.22.g' ],
  26325. all: [ 'caption-faked' ],
  26326. any: [],
  26327. none: []
  26328. }, {
  26329. id: 'target-size',
  26330. selector: '*',
  26331. enabled: false,
  26332. matches: 'widget-not-inline-matches',
  26333. tags: [ 'wcag22aa', 'wcag258', 'cat.sensory-and-visual-cues' ],
  26334. all: [],
  26335. any: [ {
  26336. options: {
  26337. minSize: 24
  26338. },
  26339. id: 'target-size'
  26340. }, {
  26341. options: {
  26342. minOffset: 24
  26343. },
  26344. id: 'target-offset'
  26345. } ],
  26346. none: []
  26347. }, {
  26348. id: 'td-has-header',
  26349. selector: 'table',
  26350. matches: 'data-table-large-matches',
  26351. tags: [ 'cat.tables', 'experimental', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', 'TT14.b' ],
  26352. all: [ 'td-has-header' ],
  26353. any: [],
  26354. none: []
  26355. }, {
  26356. id: 'td-headers-attr',
  26357. selector: 'table',
  26358. matches: 'table-or-grid-role-matches',
  26359. tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g' ],
  26360. actIds: [ 'a25f45' ],
  26361. all: [ 'td-headers-attr' ],
  26362. any: [],
  26363. none: []
  26364. }, {
  26365. id: 'th-has-data-cells',
  26366. selector: 'table',
  26367. matches: 'data-table-matches',
  26368. tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', '14.b' ],
  26369. actIds: [ 'd0f69e' ],
  26370. all: [ 'th-has-data-cells' ],
  26371. any: [],
  26372. none: []
  26373. }, {
  26374. id: 'valid-lang',
  26375. selector: '[lang]:not(html), [xml\\:lang]:not(html)',
  26376. tags: [ 'cat.language', 'wcag2aa', 'wcag312', 'ACT', 'TTv5', 'TT11.b' ],
  26377. actIds: [ 'de46e4' ],
  26378. all: [],
  26379. any: [],
  26380. none: [ {
  26381. options: {
  26382. attributes: [ 'lang', 'xml:lang' ]
  26383. },
  26384. id: 'valid-lang'
  26385. } ]
  26386. }, {
  26387. id: 'video-caption',
  26388. selector: 'video',
  26389. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag122', 'section508', 'section508.22.a', 'TTv5', 'TT17.a' ],
  26390. actIds: [ 'eac66b' ],
  26391. all: [],
  26392. any: [],
  26393. none: [ 'caption' ]
  26394. } ],
  26395. checks: [ {
  26396. id: 'abstractrole',
  26397. evaluate: 'abstractrole-evaluate'
  26398. }, {
  26399. id: 'aria-allowed-attr',
  26400. evaluate: 'aria-allowed-attr-evaluate',
  26401. options: {
  26402. validTreeRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ]
  26403. }
  26404. }, {
  26405. id: 'aria-allowed-role',
  26406. evaluate: 'aria-allowed-role-evaluate',
  26407. options: {
  26408. allowImplicit: true,
  26409. ignoredTags: []
  26410. }
  26411. }, {
  26412. id: 'aria-busy',
  26413. evaluate: 'aria-busy-evaluate'
  26414. }, {
  26415. id: 'aria-errormessage',
  26416. evaluate: 'aria-errormessage-evaluate'
  26417. }, {
  26418. id: 'aria-hidden-body',
  26419. evaluate: 'aria-hidden-body-evaluate'
  26420. }, {
  26421. id: 'aria-level',
  26422. evaluate: 'aria-level-evaluate'
  26423. }, {
  26424. id: 'aria-prohibited-attr',
  26425. evaluate: 'aria-prohibited-attr-evaluate',
  26426. options: {
  26427. elementsAllowedAriaLabel: [ 'applet', 'input' ]
  26428. }
  26429. }, {
  26430. id: 'aria-required-attr',
  26431. evaluate: 'aria-required-attr-evaluate'
  26432. }, {
  26433. id: 'aria-required-children',
  26434. evaluate: 'aria-required-children-evaluate',
  26435. options: {
  26436. reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'menu', 'menubar', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ]
  26437. }
  26438. }, {
  26439. id: 'aria-required-parent',
  26440. evaluate: 'aria-required-parent-evaluate',
  26441. options: {
  26442. ownGroupRoles: [ 'listitem', 'treeitem' ]
  26443. }
  26444. }, {
  26445. id: 'aria-roledescription',
  26446. evaluate: 'aria-roledescription-evaluate',
  26447. options: {
  26448. supportedRoles: [ 'button', 'img', 'checkbox', 'radio', 'combobox', 'menuitemcheckbox', 'menuitemradio' ]
  26449. }
  26450. }, {
  26451. id: 'aria-unsupported-attr',
  26452. evaluate: 'aria-unsupported-attr-evaluate'
  26453. }, {
  26454. id: 'aria-valid-attr-value',
  26455. evaluate: 'aria-valid-attr-value-evaluate',
  26456. options: []
  26457. }, {
  26458. id: 'aria-valid-attr',
  26459. evaluate: 'aria-valid-attr-evaluate',
  26460. options: []
  26461. }, {
  26462. id: 'deprecatedrole',
  26463. evaluate: 'deprecatedrole-evaluate'
  26464. }, {
  26465. id: 'fallbackrole',
  26466. evaluate: 'fallbackrole-evaluate'
  26467. }, {
  26468. id: 'has-global-aria-attribute',
  26469. evaluate: 'has-global-aria-attribute-evaluate'
  26470. }, {
  26471. id: 'has-widget-role',
  26472. evaluate: 'has-widget-role-evaluate',
  26473. options: []
  26474. }, {
  26475. id: 'invalidrole',
  26476. evaluate: 'invalidrole-evaluate'
  26477. }, {
  26478. id: 'is-element-focusable',
  26479. evaluate: 'is-element-focusable-evaluate'
  26480. }, {
  26481. id: 'no-implicit-explicit-label',
  26482. evaluate: 'no-implicit-explicit-label-evaluate'
  26483. }, {
  26484. id: 'unsupportedrole',
  26485. evaluate: 'unsupportedrole-evaluate'
  26486. }, {
  26487. id: 'valid-scrollable-semantics',
  26488. evaluate: 'valid-scrollable-semantics-evaluate',
  26489. options: {
  26490. roles: [ 'tooltip' ]
  26491. }
  26492. }, {
  26493. id: 'color-contrast-enhanced',
  26494. evaluate: 'color-contrast-evaluate',
  26495. options: {
  26496. ignoreUnicode: true,
  26497. ignoreLength: false,
  26498. ignorePseudo: false,
  26499. boldValue: 700,
  26500. boldTextPt: 14,
  26501. largeTextPt: 18,
  26502. contrastRatio: {
  26503. normal: {
  26504. expected: 7,
  26505. minThreshold: 4.5
  26506. },
  26507. large: {
  26508. expected: 4.5,
  26509. minThreshold: 3
  26510. }
  26511. },
  26512. pseudoSizeThreshold: .25,
  26513. shadowOutlineEmMax: .1,
  26514. textStrokeEmMin: .03
  26515. }
  26516. }, {
  26517. id: 'color-contrast',
  26518. evaluate: 'color-contrast-evaluate',
  26519. options: {
  26520. ignoreUnicode: true,
  26521. ignoreLength: false,
  26522. ignorePseudo: false,
  26523. boldValue: 700,
  26524. boldTextPt: 14,
  26525. largeTextPt: 18,
  26526. contrastRatio: {
  26527. normal: {
  26528. expected: 4.5
  26529. },
  26530. large: {
  26531. expected: 3
  26532. }
  26533. },
  26534. pseudoSizeThreshold: .25,
  26535. shadowOutlineEmMax: .2,
  26536. textStrokeEmMin: .03
  26537. }
  26538. }, {
  26539. id: 'link-in-text-block-style',
  26540. evaluate: 'link-in-text-block-style-evaluate'
  26541. }, {
  26542. id: 'link-in-text-block',
  26543. evaluate: 'link-in-text-block-evaluate',
  26544. options: {
  26545. requiredContrastRatio: 3,
  26546. allowSameColor: true
  26547. }
  26548. }, {
  26549. id: 'autocomplete-appropriate',
  26550. evaluate: 'autocomplete-appropriate-evaluate',
  26551. deprecated: true
  26552. }, {
  26553. id: 'autocomplete-valid',
  26554. evaluate: 'autocomplete-valid-evaluate',
  26555. options: {
  26556. stateTerms: [ 'none', 'false', 'true', 'disabled', 'enabled', 'undefined', 'null' ]
  26557. }
  26558. }, {
  26559. id: 'accesskeys',
  26560. evaluate: 'accesskeys-evaluate',
  26561. after: 'accesskeys-after'
  26562. }, {
  26563. id: 'focusable-content',
  26564. evaluate: 'focusable-content-evaluate'
  26565. }, {
  26566. id: 'focusable-disabled',
  26567. evaluate: 'focusable-disabled-evaluate'
  26568. }, {
  26569. id: 'focusable-element',
  26570. evaluate: 'focusable-element-evaluate'
  26571. }, {
  26572. id: 'focusable-modal-open',
  26573. evaluate: 'focusable-modal-open-evaluate'
  26574. }, {
  26575. id: 'focusable-no-name',
  26576. evaluate: 'focusable-no-name-evaluate'
  26577. }, {
  26578. id: 'focusable-not-tabbable',
  26579. evaluate: 'focusable-not-tabbable-evaluate'
  26580. }, {
  26581. id: 'frame-focusable-content',
  26582. evaluate: 'frame-focusable-content-evaluate'
  26583. }, {
  26584. id: 'landmark-is-top-level',
  26585. evaluate: 'landmark-is-top-level-evaluate'
  26586. }, {
  26587. id: 'no-focusable-content',
  26588. evaluate: 'no-focusable-content-evaluate'
  26589. }, {
  26590. id: 'page-has-heading-one',
  26591. evaluate: 'has-descendant-evaluate',
  26592. after: 'has-descendant-after',
  26593. options: {
  26594. selector: 'h1:not([role], [aria-level]), :is(h1, h2, h3, h4, h5, h6):not([role])[aria-level=1], [role=heading][aria-level=1]',
  26595. passForModal: true
  26596. }
  26597. }, {
  26598. id: 'page-has-main',
  26599. evaluate: 'has-descendant-evaluate',
  26600. after: 'has-descendant-after',
  26601. options: {
  26602. selector: 'main:not([role]), [role=\'main\']',
  26603. passForModal: true
  26604. }
  26605. }, {
  26606. id: 'page-no-duplicate-banner',
  26607. evaluate: 'page-no-duplicate-evaluate',
  26608. after: 'page-no-duplicate-after',
  26609. options: {
  26610. selector: 'header:not([role]), [role=banner]',
  26611. nativeScopeFilter: 'article, aside, main, nav, section'
  26612. }
  26613. }, {
  26614. id: 'page-no-duplicate-contentinfo',
  26615. evaluate: 'page-no-duplicate-evaluate',
  26616. after: 'page-no-duplicate-after',
  26617. options: {
  26618. selector: 'footer:not([role]), [role=contentinfo]',
  26619. nativeScopeFilter: 'article, aside, main, nav, section'
  26620. }
  26621. }, {
  26622. id: 'page-no-duplicate-main',
  26623. evaluate: 'page-no-duplicate-evaluate',
  26624. after: 'page-no-duplicate-after',
  26625. options: {
  26626. selector: 'main:not([role]), [role=\'main\']'
  26627. }
  26628. }, {
  26629. id: 'tabindex',
  26630. evaluate: 'tabindex-evaluate'
  26631. }, {
  26632. id: 'alt-space-value',
  26633. evaluate: 'alt-space-value-evaluate'
  26634. }, {
  26635. id: 'duplicate-img-label',
  26636. evaluate: 'duplicate-img-label-evaluate',
  26637. options: {
  26638. parentSelector: 'button, [role=button], a[href], p, li, td, th'
  26639. }
  26640. }, {
  26641. id: 'explicit-label',
  26642. evaluate: 'explicit-evaluate'
  26643. }, {
  26644. id: 'help-same-as-label',
  26645. evaluate: 'help-same-as-label-evaluate',
  26646. enabled: false
  26647. }, {
  26648. id: 'hidden-explicit-label',
  26649. evaluate: 'hidden-explicit-label-evaluate'
  26650. }, {
  26651. id: 'implicit-label',
  26652. evaluate: 'implicit-evaluate'
  26653. }, {
  26654. id: 'label-content-name-mismatch',
  26655. evaluate: 'label-content-name-mismatch-evaluate',
  26656. options: {
  26657. pixelThreshold: .1,
  26658. occurrenceThreshold: 3
  26659. }
  26660. }, {
  26661. id: 'multiple-label',
  26662. evaluate: 'multiple-label-evaluate'
  26663. }, {
  26664. id: 'title-only',
  26665. evaluate: 'title-only-evaluate'
  26666. }, {
  26667. id: 'landmark-is-unique',
  26668. evaluate: 'landmark-is-unique-evaluate',
  26669. after: 'landmark-is-unique-after'
  26670. }, {
  26671. id: 'has-lang',
  26672. evaluate: 'has-lang-evaluate',
  26673. options: {
  26674. attributes: [ 'lang', 'xml:lang' ]
  26675. }
  26676. }, {
  26677. id: 'valid-lang',
  26678. evaluate: 'valid-lang-evaluate',
  26679. options: {
  26680. attributes: [ 'lang', 'xml:lang' ]
  26681. }
  26682. }, {
  26683. id: 'xml-lang-mismatch',
  26684. evaluate: 'xml-lang-mismatch-evaluate'
  26685. }, {
  26686. id: 'dlitem',
  26687. evaluate: 'dlitem-evaluate'
  26688. }, {
  26689. id: 'listitem',
  26690. evaluate: 'listitem-evaluate'
  26691. }, {
  26692. id: 'only-dlitems',
  26693. evaluate: 'invalid-children-evaluate',
  26694. options: {
  26695. validRoles: [ 'definition', 'term', 'listitem' ],
  26696. validNodeNames: [ 'dt', 'dd' ],
  26697. divGroups: true
  26698. }
  26699. }, {
  26700. id: 'only-listitems',
  26701. evaluate: 'invalid-children-evaluate',
  26702. options: {
  26703. validRoles: [ 'listitem' ],
  26704. validNodeNames: [ 'li' ]
  26705. }
  26706. }, {
  26707. id: 'structured-dlitems',
  26708. evaluate: 'structured-dlitems-evaluate'
  26709. }, {
  26710. id: 'caption',
  26711. evaluate: 'caption-evaluate'
  26712. }, {
  26713. id: 'frame-tested',
  26714. evaluate: 'frame-tested-evaluate',
  26715. after: 'frame-tested-after',
  26716. options: {
  26717. isViolation: false
  26718. }
  26719. }, {
  26720. id: 'no-autoplay-audio',
  26721. evaluate: 'no-autoplay-audio-evaluate',
  26722. options: {
  26723. allowedDuration: 3
  26724. }
  26725. }, {
  26726. id: 'css-orientation-lock',
  26727. evaluate: 'css-orientation-lock-evaluate',
  26728. options: {
  26729. degreeThreshold: 2
  26730. }
  26731. }, {
  26732. id: 'meta-viewport-large',
  26733. evaluate: 'meta-viewport-scale-evaluate',
  26734. options: {
  26735. scaleMinimum: 5,
  26736. lowerBound: 2
  26737. }
  26738. }, {
  26739. id: 'meta-viewport',
  26740. evaluate: 'meta-viewport-scale-evaluate',
  26741. options: {
  26742. scaleMinimum: 2
  26743. }
  26744. }, {
  26745. id: 'target-offset',
  26746. evaluate: 'target-offset-evaluate',
  26747. options: {
  26748. minOffset: 24
  26749. }
  26750. }, {
  26751. id: 'target-size',
  26752. evaluate: 'target-size-evaluate',
  26753. options: {
  26754. minSize: 24
  26755. }
  26756. }, {
  26757. id: 'header-present',
  26758. evaluate: 'has-descendant-evaluate',
  26759. after: 'has-descendant-after',
  26760. options: {
  26761. selector: ':is(h1, h2, h3, h4, h5, h6):not([role]), [role=heading]'
  26762. }
  26763. }, {
  26764. id: 'heading-order',
  26765. evaluate: 'heading-order-evaluate',
  26766. after: 'heading-order-after'
  26767. }, {
  26768. id: 'identical-links-same-purpose',
  26769. evaluate: 'identical-links-same-purpose-evaluate',
  26770. after: 'identical-links-same-purpose-after'
  26771. }, {
  26772. id: 'internal-link-present',
  26773. evaluate: 'internal-link-present-evaluate'
  26774. }, {
  26775. id: 'landmark',
  26776. evaluate: 'has-descendant-evaluate',
  26777. options: {
  26778. selector: 'main, [role=main]'
  26779. }
  26780. }, {
  26781. id: 'meta-refresh-no-exceptions',
  26782. evaluate: 'meta-refresh-evaluate',
  26783. options: {
  26784. minDelay: 72e3,
  26785. maxDelay: false
  26786. }
  26787. }, {
  26788. id: 'meta-refresh',
  26789. evaluate: 'meta-refresh-evaluate',
  26790. options: {
  26791. minDelay: 0,
  26792. maxDelay: 72e3
  26793. }
  26794. }, {
  26795. id: 'p-as-heading',
  26796. evaluate: 'p-as-heading-evaluate',
  26797. options: {
  26798. margins: [ {
  26799. weight: 150,
  26800. italic: true
  26801. }, {
  26802. weight: 150,
  26803. size: 1.15
  26804. }, {
  26805. italic: true,
  26806. size: 1.15
  26807. }, {
  26808. size: 1.4
  26809. } ],
  26810. passLength: 1,
  26811. failLength: .5
  26812. }
  26813. }, {
  26814. id: 'region',
  26815. evaluate: 'region-evaluate',
  26816. after: 'region-after',
  26817. options: {
  26818. regionMatcher: 'dialog, [role=dialog], [role=alertdialog], svg'
  26819. }
  26820. }, {
  26821. id: 'skip-link',
  26822. evaluate: 'skip-link-evaluate'
  26823. }, {
  26824. id: 'unique-frame-title',
  26825. evaluate: 'unique-frame-title-evaluate',
  26826. after: 'unique-frame-title-after'
  26827. }, {
  26828. id: 'duplicate-id-active',
  26829. evaluate: 'duplicate-id-evaluate',
  26830. after: 'duplicate-id-after'
  26831. }, {
  26832. id: 'duplicate-id-aria',
  26833. evaluate: 'duplicate-id-evaluate',
  26834. after: 'duplicate-id-after'
  26835. }, {
  26836. id: 'duplicate-id',
  26837. evaluate: 'duplicate-id-evaluate',
  26838. after: 'duplicate-id-after'
  26839. }, {
  26840. id: 'aria-label',
  26841. evaluate: 'aria-label-evaluate'
  26842. }, {
  26843. id: 'aria-labelledby',
  26844. evaluate: 'aria-labelledby-evaluate'
  26845. }, {
  26846. id: 'avoid-inline-spacing',
  26847. evaluate: 'avoid-inline-spacing-evaluate',
  26848. options: {
  26849. cssProperties: [ 'line-height', 'letter-spacing', 'word-spacing' ]
  26850. }
  26851. }, {
  26852. id: 'button-has-visible-text',
  26853. evaluate: 'has-text-content-evaluate'
  26854. }, {
  26855. id: 'doc-has-title',
  26856. evaluate: 'doc-has-title-evaluate'
  26857. }, {
  26858. id: 'exists',
  26859. evaluate: 'exists-evaluate'
  26860. }, {
  26861. id: 'has-alt',
  26862. evaluate: 'has-alt-evaluate'
  26863. }, {
  26864. id: 'has-visible-text',
  26865. evaluate: 'has-text-content-evaluate'
  26866. }, {
  26867. id: 'important-letter-spacing',
  26868. evaluate: 'inline-style-property-evaluate',
  26869. options: {
  26870. cssProperty: 'letter-spacing',
  26871. minValue: .12
  26872. }
  26873. }, {
  26874. id: 'important-line-height',
  26875. evaluate: 'inline-style-property-evaluate',
  26876. options: {
  26877. multiLineOnly: true,
  26878. cssProperty: 'line-height',
  26879. minValue: 1.5,
  26880. normalValue: 1
  26881. }
  26882. }, {
  26883. id: 'important-word-spacing',
  26884. evaluate: 'inline-style-property-evaluate',
  26885. options: {
  26886. cssProperty: 'word-spacing',
  26887. minValue: .16
  26888. }
  26889. }, {
  26890. id: 'is-on-screen',
  26891. evaluate: 'is-on-screen-evaluate'
  26892. }, {
  26893. id: 'non-empty-alt',
  26894. evaluate: 'attr-non-space-content-evaluate',
  26895. options: {
  26896. attribute: 'alt'
  26897. }
  26898. }, {
  26899. id: 'non-empty-if-present',
  26900. evaluate: 'non-empty-if-present-evaluate'
  26901. }, {
  26902. id: 'non-empty-placeholder',
  26903. evaluate: 'attr-non-space-content-evaluate',
  26904. options: {
  26905. attribute: 'placeholder'
  26906. }
  26907. }, {
  26908. id: 'non-empty-title',
  26909. evaluate: 'attr-non-space-content-evaluate',
  26910. options: {
  26911. attribute: 'title'
  26912. }
  26913. }, {
  26914. id: 'non-empty-value',
  26915. evaluate: 'attr-non-space-content-evaluate',
  26916. options: {
  26917. attribute: 'value'
  26918. }
  26919. }, {
  26920. id: 'presentational-role',
  26921. evaluate: 'presentational-role-evaluate'
  26922. }, {
  26923. id: 'role-none',
  26924. evaluate: 'matches-definition-evaluate',
  26925. deprecated: true,
  26926. options: {
  26927. matcher: {
  26928. attributes: {
  26929. role: 'none'
  26930. }
  26931. }
  26932. }
  26933. }, {
  26934. id: 'role-presentation',
  26935. evaluate: 'matches-definition-evaluate',
  26936. deprecated: true,
  26937. options: {
  26938. matcher: {
  26939. attributes: {
  26940. role: 'presentation'
  26941. }
  26942. }
  26943. }
  26944. }, {
  26945. id: 'svg-non-empty-title',
  26946. evaluate: 'svg-non-empty-title-evaluate'
  26947. }, {
  26948. id: 'caption-faked',
  26949. evaluate: 'caption-faked-evaluate'
  26950. }, {
  26951. id: 'html5-scope',
  26952. evaluate: 'html5-scope-evaluate'
  26953. }, {
  26954. id: 'same-caption-summary',
  26955. evaluate: 'same-caption-summary-evaluate'
  26956. }, {
  26957. id: 'scope-value',
  26958. evaluate: 'scope-value-evaluate',
  26959. options: {
  26960. values: [ 'row', 'col', 'rowgroup', 'colgroup' ]
  26961. }
  26962. }, {
  26963. id: 'td-has-header',
  26964. evaluate: 'td-has-header-evaluate'
  26965. }, {
  26966. id: 'td-headers-attr',
  26967. evaluate: 'td-headers-attr-evaluate'
  26968. }, {
  26969. id: 'th-has-data-cells',
  26970. evaluate: 'th-has-data-cells-evaluate'
  26971. }, {
  26972. id: 'hidden-content',
  26973. evaluate: 'hidden-content-evaluate'
  26974. } ]
  26975. });
  26976. })(typeof window === 'object' ? window : this);