compiler-sfc.cjs.js 512 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var CompilerDOM = require('@vue/compiler-dom');
  4. var require$$0$2 = require('source-map');
  5. var MagicString = require('magic-string');
  6. var parser$2 = require('@babel/parser');
  7. var shared = require('@vue/shared');
  8. var estreeWalker = require('estree-walker');
  9. var path$4 = require('path');
  10. var compilerCore = require('@vue/compiler-core');
  11. var url = require('url');
  12. var CompilerSSR = require('@vue/compiler-ssr');
  13. var require$$2 = require('util');
  14. var require$$0$1 = require('fs');
  15. var reactivityTransform = require('@vue/reactivity-transform');
  16. var require$$0$3 = require('postcss');
  17. function _interopNamespaceDefault(e) {
  18. var n = Object.create(null);
  19. if (e) {
  20. for (var k in e) {
  21. n[k] = e[k];
  22. }
  23. }
  24. n.default = e;
  25. return Object.freeze(n);
  26. }
  27. var CompilerDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(CompilerDOM);
  28. var CompilerSSR__namespace = /*#__PURE__*/_interopNamespaceDefault(CompilerSSR);
  29. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  30. function getDefaultExportFromCjs (x) {
  31. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
  32. }
  33. function getAugmentedNamespace(n) {
  34. var f = n.default;
  35. if (typeof f == "function") {
  36. var a = function () {
  37. return f.apply(this, arguments);
  38. };
  39. a.prototype = f.prototype;
  40. } else a = {};
  41. Object.defineProperty(a, '__esModule', {value: true});
  42. Object.keys(n).forEach(function (k) {
  43. var d = Object.getOwnPropertyDescriptor(n, k);
  44. Object.defineProperty(a, k, d.get ? d : {
  45. enumerable: true,
  46. get: function () {
  47. return n[k];
  48. }
  49. });
  50. });
  51. return a;
  52. }
  53. function pad (hash, len) {
  54. while (hash.length < len) {
  55. hash = '0' + hash;
  56. }
  57. return hash;
  58. }
  59. function fold (hash, text) {
  60. var i;
  61. var chr;
  62. var len;
  63. if (text.length === 0) {
  64. return hash;
  65. }
  66. for (i = 0, len = text.length; i < len; i++) {
  67. chr = text.charCodeAt(i);
  68. hash = ((hash << 5) - hash) + chr;
  69. hash |= 0;
  70. }
  71. return hash < 0 ? hash * -2 : hash;
  72. }
  73. function foldObject (hash, o, seen) {
  74. return Object.keys(o).sort().reduce(foldKey, hash);
  75. function foldKey (hash, key) {
  76. return foldValue(hash, o[key], key, seen);
  77. }
  78. }
  79. function foldValue (input, value, key, seen) {
  80. var hash = fold(fold(fold(input, key), toString$1(value)), typeof value);
  81. if (value === null) {
  82. return fold(hash, 'null');
  83. }
  84. if (value === undefined) {
  85. return fold(hash, 'undefined');
  86. }
  87. if (typeof value === 'object' || typeof value === 'function') {
  88. if (seen.indexOf(value) !== -1) {
  89. return fold(hash, '[Circular]' + key);
  90. }
  91. seen.push(value);
  92. var objHash = foldObject(hash, value, seen);
  93. if (!('valueOf' in value) || typeof value.valueOf !== 'function') {
  94. return objHash;
  95. }
  96. try {
  97. return fold(objHash, String(value.valueOf()))
  98. } catch (err) {
  99. return fold(objHash, '[valueOf exception]' + (err.stack || err.message))
  100. }
  101. }
  102. return fold(hash, value.toString());
  103. }
  104. function toString$1 (o) {
  105. return Object.prototype.toString.call(o);
  106. }
  107. function sum (o) {
  108. return pad(foldValue(0, o, '', []).toString(16), 8);
  109. }
  110. var hashSum = sum;
  111. var hash$1 = hashSum;
  112. const CSS_VARS_HELPER = `useCssVars`;
  113. function genCssVarsFromList(vars, id, isProd, isSSR = false) {
  114. return `{\n ${vars
  115. .map(key => `"${isSSR ? `--` : ``}${genVarName(id, key, isProd)}": (${key})`)
  116. .join(',\n ')}\n}`;
  117. }
  118. function genVarName(id, raw, isProd) {
  119. if (isProd) {
  120. return hash$1(id + raw);
  121. }
  122. else {
  123. // escape ASCII Punctuation & Symbols
  124. return `${id}-${raw.replace(/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g, s => `\\${s}`)}`;
  125. }
  126. }
  127. function normalizeExpression(exp) {
  128. exp = exp.trim();
  129. if ((exp[0] === `'` && exp[exp.length - 1] === `'`) ||
  130. (exp[0] === `"` && exp[exp.length - 1] === `"`)) {
  131. return exp.slice(1, -1);
  132. }
  133. return exp;
  134. }
  135. const vBindRE = /v-bind\s*\(/g;
  136. function parseCssVars(sfc) {
  137. const vars = [];
  138. sfc.styles.forEach(style => {
  139. let match;
  140. // ignore v-bind() in comments /* ... */
  141. const content = style.content.replace(/\/\*([\s\S]*?)\*\//g, '');
  142. while ((match = vBindRE.exec(content))) {
  143. const start = match.index + match[0].length;
  144. const end = lexBinding(content, start);
  145. if (end !== null) {
  146. const variable = normalizeExpression(content.slice(start, end));
  147. if (!vars.includes(variable)) {
  148. vars.push(variable);
  149. }
  150. }
  151. }
  152. });
  153. return vars;
  154. }
  155. function lexBinding(content, start) {
  156. let state = 0 /* LexerState.inParens */;
  157. let parenDepth = 0;
  158. for (let i = start; i < content.length; i++) {
  159. const char = content.charAt(i);
  160. switch (state) {
  161. case 0 /* LexerState.inParens */:
  162. if (char === `'`) {
  163. state = 1 /* LexerState.inSingleQuoteString */;
  164. }
  165. else if (char === `"`) {
  166. state = 2 /* LexerState.inDoubleQuoteString */;
  167. }
  168. else if (char === `(`) {
  169. parenDepth++;
  170. }
  171. else if (char === `)`) {
  172. if (parenDepth > 0) {
  173. parenDepth--;
  174. }
  175. else {
  176. return i;
  177. }
  178. }
  179. break;
  180. case 1 /* LexerState.inSingleQuoteString */:
  181. if (char === `'`) {
  182. state = 0 /* LexerState.inParens */;
  183. }
  184. break;
  185. case 2 /* LexerState.inDoubleQuoteString */:
  186. if (char === `"`) {
  187. state = 0 /* LexerState.inParens */;
  188. }
  189. break;
  190. }
  191. }
  192. return null;
  193. }
  194. const cssVarsPlugin = opts => {
  195. const { id, isProd } = opts;
  196. return {
  197. postcssPlugin: 'vue-sfc-vars',
  198. Declaration(decl) {
  199. // rewrite CSS variables
  200. const value = decl.value;
  201. if (vBindRE.test(value)) {
  202. vBindRE.lastIndex = 0;
  203. let transformed = '';
  204. let lastIndex = 0;
  205. let match;
  206. while ((match = vBindRE.exec(value))) {
  207. const start = match.index + match[0].length;
  208. const end = lexBinding(value, start);
  209. if (end !== null) {
  210. const variable = normalizeExpression(value.slice(start, end));
  211. transformed +=
  212. value.slice(lastIndex, match.index) +
  213. `var(--${genVarName(id, variable, isProd)})`;
  214. lastIndex = end + 1;
  215. }
  216. }
  217. decl.value = transformed + value.slice(lastIndex);
  218. }
  219. }
  220. };
  221. };
  222. cssVarsPlugin.postcss = true;
  223. function genCssVarsCode(vars, bindings, id, isProd) {
  224. const varsExp = genCssVarsFromList(vars, id, isProd);
  225. const exp = CompilerDOM.createSimpleExpression(varsExp, false);
  226. const context = CompilerDOM.createTransformContext(CompilerDOM.createRoot([]), {
  227. prefixIdentifiers: true,
  228. inline: true,
  229. bindingMetadata: bindings.__isScriptSetup === false ? undefined : bindings
  230. });
  231. const transformed = CompilerDOM.processExpression(exp, context);
  232. const transformedString = transformed.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */
  233. ? transformed.content
  234. : transformed.children
  235. .map(c => {
  236. return typeof c === 'string'
  237. ? c
  238. : c.content;
  239. })
  240. .join('');
  241. return `_${CSS_VARS_HELPER}(_ctx => (${transformedString}))`;
  242. }
  243. // <script setup> already gets the calls injected as part of the transform
  244. // this is only for single normal <script>
  245. function genNormalScriptCssVarsCode(cssVars, bindings, id, isProd) {
  246. return (`\nimport { ${CSS_VARS_HELPER} as _${CSS_VARS_HELPER} } from 'vue'\n` +
  247. `const __injectCSSVars__ = () => {\n${genCssVarsCode(cssVars, bindings, id, isProd)}}\n` +
  248. `const __setup__ = __default__.setup\n` +
  249. `__default__.setup = __setup__\n` +
  250. ` ? (props, ctx) => { __injectCSSVars__();return __setup__(props, ctx) }\n` +
  251. ` : __injectCSSVars__\n`);
  252. }
  253. var iterator;
  254. var hasRequiredIterator;
  255. function requireIterator () {
  256. if (hasRequiredIterator) return iterator;
  257. hasRequiredIterator = 1;
  258. iterator = function (Yallist) {
  259. Yallist.prototype[Symbol.iterator] = function* () {
  260. for (let walker = this.head; walker; walker = walker.next) {
  261. yield walker.value;
  262. }
  263. };
  264. };
  265. return iterator;
  266. }
  267. var yallist = Yallist$1;
  268. Yallist$1.Node = Node;
  269. Yallist$1.create = Yallist$1;
  270. function Yallist$1 (list) {
  271. var self = this;
  272. if (!(self instanceof Yallist$1)) {
  273. self = new Yallist$1();
  274. }
  275. self.tail = null;
  276. self.head = null;
  277. self.length = 0;
  278. if (list && typeof list.forEach === 'function') {
  279. list.forEach(function (item) {
  280. self.push(item);
  281. });
  282. } else if (arguments.length > 0) {
  283. for (var i = 0, l = arguments.length; i < l; i++) {
  284. self.push(arguments[i]);
  285. }
  286. }
  287. return self
  288. }
  289. Yallist$1.prototype.removeNode = function (node) {
  290. if (node.list !== this) {
  291. throw new Error('removing node which does not belong to this list')
  292. }
  293. var next = node.next;
  294. var prev = node.prev;
  295. if (next) {
  296. next.prev = prev;
  297. }
  298. if (prev) {
  299. prev.next = next;
  300. }
  301. if (node === this.head) {
  302. this.head = next;
  303. }
  304. if (node === this.tail) {
  305. this.tail = prev;
  306. }
  307. node.list.length--;
  308. node.next = null;
  309. node.prev = null;
  310. node.list = null;
  311. return next
  312. };
  313. Yallist$1.prototype.unshiftNode = function (node) {
  314. if (node === this.head) {
  315. return
  316. }
  317. if (node.list) {
  318. node.list.removeNode(node);
  319. }
  320. var head = this.head;
  321. node.list = this;
  322. node.next = head;
  323. if (head) {
  324. head.prev = node;
  325. }
  326. this.head = node;
  327. if (!this.tail) {
  328. this.tail = node;
  329. }
  330. this.length++;
  331. };
  332. Yallist$1.prototype.pushNode = function (node) {
  333. if (node === this.tail) {
  334. return
  335. }
  336. if (node.list) {
  337. node.list.removeNode(node);
  338. }
  339. var tail = this.tail;
  340. node.list = this;
  341. node.prev = tail;
  342. if (tail) {
  343. tail.next = node;
  344. }
  345. this.tail = node;
  346. if (!this.head) {
  347. this.head = node;
  348. }
  349. this.length++;
  350. };
  351. Yallist$1.prototype.push = function () {
  352. for (var i = 0, l = arguments.length; i < l; i++) {
  353. push(this, arguments[i]);
  354. }
  355. return this.length
  356. };
  357. Yallist$1.prototype.unshift = function () {
  358. for (var i = 0, l = arguments.length; i < l; i++) {
  359. unshift(this, arguments[i]);
  360. }
  361. return this.length
  362. };
  363. Yallist$1.prototype.pop = function () {
  364. if (!this.tail) {
  365. return undefined
  366. }
  367. var res = this.tail.value;
  368. this.tail = this.tail.prev;
  369. if (this.tail) {
  370. this.tail.next = null;
  371. } else {
  372. this.head = null;
  373. }
  374. this.length--;
  375. return res
  376. };
  377. Yallist$1.prototype.shift = function () {
  378. if (!this.head) {
  379. return undefined
  380. }
  381. var res = this.head.value;
  382. this.head = this.head.next;
  383. if (this.head) {
  384. this.head.prev = null;
  385. } else {
  386. this.tail = null;
  387. }
  388. this.length--;
  389. return res
  390. };
  391. Yallist$1.prototype.forEach = function (fn, thisp) {
  392. thisp = thisp || this;
  393. for (var walker = this.head, i = 0; walker !== null; i++) {
  394. fn.call(thisp, walker.value, i, this);
  395. walker = walker.next;
  396. }
  397. };
  398. Yallist$1.prototype.forEachReverse = function (fn, thisp) {
  399. thisp = thisp || this;
  400. for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
  401. fn.call(thisp, walker.value, i, this);
  402. walker = walker.prev;
  403. }
  404. };
  405. Yallist$1.prototype.get = function (n) {
  406. for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
  407. // abort out of the list early if we hit a cycle
  408. walker = walker.next;
  409. }
  410. if (i === n && walker !== null) {
  411. return walker.value
  412. }
  413. };
  414. Yallist$1.prototype.getReverse = function (n) {
  415. for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
  416. // abort out of the list early if we hit a cycle
  417. walker = walker.prev;
  418. }
  419. if (i === n && walker !== null) {
  420. return walker.value
  421. }
  422. };
  423. Yallist$1.prototype.map = function (fn, thisp) {
  424. thisp = thisp || this;
  425. var res = new Yallist$1();
  426. for (var walker = this.head; walker !== null;) {
  427. res.push(fn.call(thisp, walker.value, this));
  428. walker = walker.next;
  429. }
  430. return res
  431. };
  432. Yallist$1.prototype.mapReverse = function (fn, thisp) {
  433. thisp = thisp || this;
  434. var res = new Yallist$1();
  435. for (var walker = this.tail; walker !== null;) {
  436. res.push(fn.call(thisp, walker.value, this));
  437. walker = walker.prev;
  438. }
  439. return res
  440. };
  441. Yallist$1.prototype.reduce = function (fn, initial) {
  442. var acc;
  443. var walker = this.head;
  444. if (arguments.length > 1) {
  445. acc = initial;
  446. } else if (this.head) {
  447. walker = this.head.next;
  448. acc = this.head.value;
  449. } else {
  450. throw new TypeError('Reduce of empty list with no initial value')
  451. }
  452. for (var i = 0; walker !== null; i++) {
  453. acc = fn(acc, walker.value, i);
  454. walker = walker.next;
  455. }
  456. return acc
  457. };
  458. Yallist$1.prototype.reduceReverse = function (fn, initial) {
  459. var acc;
  460. var walker = this.tail;
  461. if (arguments.length > 1) {
  462. acc = initial;
  463. } else if (this.tail) {
  464. walker = this.tail.prev;
  465. acc = this.tail.value;
  466. } else {
  467. throw new TypeError('Reduce of empty list with no initial value')
  468. }
  469. for (var i = this.length - 1; walker !== null; i--) {
  470. acc = fn(acc, walker.value, i);
  471. walker = walker.prev;
  472. }
  473. return acc
  474. };
  475. Yallist$1.prototype.toArray = function () {
  476. var arr = new Array(this.length);
  477. for (var i = 0, walker = this.head; walker !== null; i++) {
  478. arr[i] = walker.value;
  479. walker = walker.next;
  480. }
  481. return arr
  482. };
  483. Yallist$1.prototype.toArrayReverse = function () {
  484. var arr = new Array(this.length);
  485. for (var i = 0, walker = this.tail; walker !== null; i++) {
  486. arr[i] = walker.value;
  487. walker = walker.prev;
  488. }
  489. return arr
  490. };
  491. Yallist$1.prototype.slice = function (from, to) {
  492. to = to || this.length;
  493. if (to < 0) {
  494. to += this.length;
  495. }
  496. from = from || 0;
  497. if (from < 0) {
  498. from += this.length;
  499. }
  500. var ret = new Yallist$1();
  501. if (to < from || to < 0) {
  502. return ret
  503. }
  504. if (from < 0) {
  505. from = 0;
  506. }
  507. if (to > this.length) {
  508. to = this.length;
  509. }
  510. for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
  511. walker = walker.next;
  512. }
  513. for (; walker !== null && i < to; i++, walker = walker.next) {
  514. ret.push(walker.value);
  515. }
  516. return ret
  517. };
  518. Yallist$1.prototype.sliceReverse = function (from, to) {
  519. to = to || this.length;
  520. if (to < 0) {
  521. to += this.length;
  522. }
  523. from = from || 0;
  524. if (from < 0) {
  525. from += this.length;
  526. }
  527. var ret = new Yallist$1();
  528. if (to < from || to < 0) {
  529. return ret
  530. }
  531. if (from < 0) {
  532. from = 0;
  533. }
  534. if (to > this.length) {
  535. to = this.length;
  536. }
  537. for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
  538. walker = walker.prev;
  539. }
  540. for (; walker !== null && i > from; i--, walker = walker.prev) {
  541. ret.push(walker.value);
  542. }
  543. return ret
  544. };
  545. Yallist$1.prototype.splice = function (start, deleteCount /*, ...nodes */) {
  546. if (start > this.length) {
  547. start = this.length - 1;
  548. }
  549. if (start < 0) {
  550. start = this.length + start;
  551. }
  552. for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
  553. walker = walker.next;
  554. }
  555. var ret = [];
  556. for (var i = 0; walker && i < deleteCount; i++) {
  557. ret.push(walker.value);
  558. walker = this.removeNode(walker);
  559. }
  560. if (walker === null) {
  561. walker = this.tail;
  562. }
  563. if (walker !== this.head && walker !== this.tail) {
  564. walker = walker.prev;
  565. }
  566. for (var i = 2; i < arguments.length; i++) {
  567. walker = insert(this, walker, arguments[i]);
  568. }
  569. return ret;
  570. };
  571. Yallist$1.prototype.reverse = function () {
  572. var head = this.head;
  573. var tail = this.tail;
  574. for (var walker = head; walker !== null; walker = walker.prev) {
  575. var p = walker.prev;
  576. walker.prev = walker.next;
  577. walker.next = p;
  578. }
  579. this.head = tail;
  580. this.tail = head;
  581. return this
  582. };
  583. function insert (self, node, value) {
  584. var inserted = node === self.head ?
  585. new Node(value, null, node, self) :
  586. new Node(value, node, node.next, self);
  587. if (inserted.next === null) {
  588. self.tail = inserted;
  589. }
  590. if (inserted.prev === null) {
  591. self.head = inserted;
  592. }
  593. self.length++;
  594. return inserted
  595. }
  596. function push (self, item) {
  597. self.tail = new Node(item, self.tail, null, self);
  598. if (!self.head) {
  599. self.head = self.tail;
  600. }
  601. self.length++;
  602. }
  603. function unshift (self, item) {
  604. self.head = new Node(item, null, self.head, self);
  605. if (!self.tail) {
  606. self.tail = self.head;
  607. }
  608. self.length++;
  609. }
  610. function Node (value, prev, next, list) {
  611. if (!(this instanceof Node)) {
  612. return new Node(value, prev, next, list)
  613. }
  614. this.list = list;
  615. this.value = value;
  616. if (prev) {
  617. prev.next = this;
  618. this.prev = prev;
  619. } else {
  620. this.prev = null;
  621. }
  622. if (next) {
  623. next.prev = this;
  624. this.next = next;
  625. } else {
  626. this.next = null;
  627. }
  628. }
  629. try {
  630. // add if support for Symbol.iterator is present
  631. requireIterator()(Yallist$1);
  632. } catch (er) {}
  633. // A linked list to keep track of recently-used-ness
  634. const Yallist = yallist;
  635. const MAX = Symbol('max');
  636. const LENGTH = Symbol('length');
  637. const LENGTH_CALCULATOR = Symbol('lengthCalculator');
  638. const ALLOW_STALE = Symbol('allowStale');
  639. const MAX_AGE = Symbol('maxAge');
  640. const DISPOSE = Symbol('dispose');
  641. const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
  642. const LRU_LIST = Symbol('lruList');
  643. const CACHE = Symbol('cache');
  644. const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
  645. const naiveLength = () => 1;
  646. // lruList is a yallist where the head is the youngest
  647. // item, and the tail is the oldest. the list contains the Hit
  648. // objects as the entries.
  649. // Each Hit object has a reference to its Yallist.Node. This
  650. // never changes.
  651. //
  652. // cache is a Map (or PseudoMap) that matches the keys to
  653. // the Yallist.Node object.
  654. class LRUCache {
  655. constructor (options) {
  656. if (typeof options === 'number')
  657. options = { max: options };
  658. if (!options)
  659. options = {};
  660. if (options.max && (typeof options.max !== 'number' || options.max < 0))
  661. throw new TypeError('max must be a non-negative number')
  662. // Kind of weird to have a default max of Infinity, but oh well.
  663. this[MAX] = options.max || Infinity;
  664. const lc = options.length || naiveLength;
  665. this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc;
  666. this[ALLOW_STALE] = options.stale || false;
  667. if (options.maxAge && typeof options.maxAge !== 'number')
  668. throw new TypeError('maxAge must be a number')
  669. this[MAX_AGE] = options.maxAge || 0;
  670. this[DISPOSE] = options.dispose;
  671. this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
  672. this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
  673. this.reset();
  674. }
  675. // resize the cache when the max changes.
  676. set max (mL) {
  677. if (typeof mL !== 'number' || mL < 0)
  678. throw new TypeError('max must be a non-negative number')
  679. this[MAX] = mL || Infinity;
  680. trim(this);
  681. }
  682. get max () {
  683. return this[MAX]
  684. }
  685. set allowStale (allowStale) {
  686. this[ALLOW_STALE] = !!allowStale;
  687. }
  688. get allowStale () {
  689. return this[ALLOW_STALE]
  690. }
  691. set maxAge (mA) {
  692. if (typeof mA !== 'number')
  693. throw new TypeError('maxAge must be a non-negative number')
  694. this[MAX_AGE] = mA;
  695. trim(this);
  696. }
  697. get maxAge () {
  698. return this[MAX_AGE]
  699. }
  700. // resize the cache when the lengthCalculator changes.
  701. set lengthCalculator (lC) {
  702. if (typeof lC !== 'function')
  703. lC = naiveLength;
  704. if (lC !== this[LENGTH_CALCULATOR]) {
  705. this[LENGTH_CALCULATOR] = lC;
  706. this[LENGTH] = 0;
  707. this[LRU_LIST].forEach(hit => {
  708. hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
  709. this[LENGTH] += hit.length;
  710. });
  711. }
  712. trim(this);
  713. }
  714. get lengthCalculator () { return this[LENGTH_CALCULATOR] }
  715. get length () { return this[LENGTH] }
  716. get itemCount () { return this[LRU_LIST].length }
  717. rforEach (fn, thisp) {
  718. thisp = thisp || this;
  719. for (let walker = this[LRU_LIST].tail; walker !== null;) {
  720. const prev = walker.prev;
  721. forEachStep(this, fn, walker, thisp);
  722. walker = prev;
  723. }
  724. }
  725. forEach (fn, thisp) {
  726. thisp = thisp || this;
  727. for (let walker = this[LRU_LIST].head; walker !== null;) {
  728. const next = walker.next;
  729. forEachStep(this, fn, walker, thisp);
  730. walker = next;
  731. }
  732. }
  733. keys () {
  734. return this[LRU_LIST].toArray().map(k => k.key)
  735. }
  736. values () {
  737. return this[LRU_LIST].toArray().map(k => k.value)
  738. }
  739. reset () {
  740. if (this[DISPOSE] &&
  741. this[LRU_LIST] &&
  742. this[LRU_LIST].length) {
  743. this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
  744. }
  745. this[CACHE] = new Map(); // hash of items by key
  746. this[LRU_LIST] = new Yallist(); // list of items in order of use recency
  747. this[LENGTH] = 0; // length of items in the list
  748. }
  749. dump () {
  750. return this[LRU_LIST].map(hit =>
  751. isStale(this, hit) ? false : {
  752. k: hit.key,
  753. v: hit.value,
  754. e: hit.now + (hit.maxAge || 0)
  755. }).toArray().filter(h => h)
  756. }
  757. dumpLru () {
  758. return this[LRU_LIST]
  759. }
  760. set (key, value, maxAge) {
  761. maxAge = maxAge || this[MAX_AGE];
  762. if (maxAge && typeof maxAge !== 'number')
  763. throw new TypeError('maxAge must be a number')
  764. const now = maxAge ? Date.now() : 0;
  765. const len = this[LENGTH_CALCULATOR](value, key);
  766. if (this[CACHE].has(key)) {
  767. if (len > this[MAX]) {
  768. del(this, this[CACHE].get(key));
  769. return false
  770. }
  771. const node = this[CACHE].get(key);
  772. const item = node.value;
  773. // dispose of the old one before overwriting
  774. // split out into 2 ifs for better coverage tracking
  775. if (this[DISPOSE]) {
  776. if (!this[NO_DISPOSE_ON_SET])
  777. this[DISPOSE](key, item.value);
  778. }
  779. item.now = now;
  780. item.maxAge = maxAge;
  781. item.value = value;
  782. this[LENGTH] += len - item.length;
  783. item.length = len;
  784. this.get(key);
  785. trim(this);
  786. return true
  787. }
  788. const hit = new Entry(key, value, len, now, maxAge);
  789. // oversized objects fall out of cache automatically.
  790. if (hit.length > this[MAX]) {
  791. if (this[DISPOSE])
  792. this[DISPOSE](key, value);
  793. return false
  794. }
  795. this[LENGTH] += hit.length;
  796. this[LRU_LIST].unshift(hit);
  797. this[CACHE].set(key, this[LRU_LIST].head);
  798. trim(this);
  799. return true
  800. }
  801. has (key) {
  802. if (!this[CACHE].has(key)) return false
  803. const hit = this[CACHE].get(key).value;
  804. return !isStale(this, hit)
  805. }
  806. get (key) {
  807. return get(this, key, true)
  808. }
  809. peek (key) {
  810. return get(this, key, false)
  811. }
  812. pop () {
  813. const node = this[LRU_LIST].tail;
  814. if (!node)
  815. return null
  816. del(this, node);
  817. return node.value
  818. }
  819. del (key) {
  820. del(this, this[CACHE].get(key));
  821. }
  822. load (arr) {
  823. // reset the cache
  824. this.reset();
  825. const now = Date.now();
  826. // A previous serialized cache has the most recent items first
  827. for (let l = arr.length - 1; l >= 0; l--) {
  828. const hit = arr[l];
  829. const expiresAt = hit.e || 0;
  830. if (expiresAt === 0)
  831. // the item was created without expiration in a non aged cache
  832. this.set(hit.k, hit.v);
  833. else {
  834. const maxAge = expiresAt - now;
  835. // dont add already expired items
  836. if (maxAge > 0) {
  837. this.set(hit.k, hit.v, maxAge);
  838. }
  839. }
  840. }
  841. }
  842. prune () {
  843. this[CACHE].forEach((value, key) => get(this, key, false));
  844. }
  845. }
  846. const get = (self, key, doUse) => {
  847. const node = self[CACHE].get(key);
  848. if (node) {
  849. const hit = node.value;
  850. if (isStale(self, hit)) {
  851. del(self, node);
  852. if (!self[ALLOW_STALE])
  853. return undefined
  854. } else {
  855. if (doUse) {
  856. if (self[UPDATE_AGE_ON_GET])
  857. node.value.now = Date.now();
  858. self[LRU_LIST].unshiftNode(node);
  859. }
  860. }
  861. return hit.value
  862. }
  863. };
  864. const isStale = (self, hit) => {
  865. if (!hit || (!hit.maxAge && !self[MAX_AGE]))
  866. return false
  867. const diff = Date.now() - hit.now;
  868. return hit.maxAge ? diff > hit.maxAge
  869. : self[MAX_AGE] && (diff > self[MAX_AGE])
  870. };
  871. const trim = self => {
  872. if (self[LENGTH] > self[MAX]) {
  873. for (let walker = self[LRU_LIST].tail;
  874. self[LENGTH] > self[MAX] && walker !== null;) {
  875. // We know that we're about to delete this one, and also
  876. // what the next least recently used key will be, so just
  877. // go ahead and set it now.
  878. const prev = walker.prev;
  879. del(self, walker);
  880. walker = prev;
  881. }
  882. }
  883. };
  884. const del = (self, node) => {
  885. if (node) {
  886. const hit = node.value;
  887. if (self[DISPOSE])
  888. self[DISPOSE](hit.key, hit.value);
  889. self[LENGTH] -= hit.length;
  890. self[CACHE].delete(hit.key);
  891. self[LRU_LIST].removeNode(node);
  892. }
  893. };
  894. class Entry {
  895. constructor (key, value, length, now, maxAge) {
  896. this.key = key;
  897. this.value = value;
  898. this.length = length;
  899. this.now = now;
  900. this.maxAge = maxAge || 0;
  901. }
  902. }
  903. const forEachStep = (self, fn, node, thisp) => {
  904. let hit = node.value;
  905. if (isStale(self, hit)) {
  906. del(self, node);
  907. if (!self[ALLOW_STALE])
  908. hit = undefined;
  909. }
  910. if (hit)
  911. fn.call(thisp, hit.value, hit.key, self);
  912. };
  913. var lruCache = LRUCache;
  914. var LRU = lruCache;
  915. function createCache(size = 500) {
  916. return new LRU(size);
  917. }
  918. function isRelativeUrl(url) {
  919. const firstChar = url.charAt(0);
  920. return firstChar === '.' || firstChar === '~' || firstChar === '@';
  921. }
  922. const externalRE = /^(https?:)?\/\//;
  923. function isExternalUrl(url) {
  924. return externalRE.test(url);
  925. }
  926. const dataUrlRE = /^\s*data:/i;
  927. function isDataUrl(url) {
  928. return dataUrlRE.test(url);
  929. }
  930. /**
  931. * Parses string url into URL object.
  932. */
  933. function parseUrl(url) {
  934. const firstChar = url.charAt(0);
  935. if (firstChar === '~') {
  936. const secondChar = url.charAt(1);
  937. url = url.slice(secondChar === '/' ? 2 : 1);
  938. }
  939. return parseUriParts(url);
  940. }
  941. /**
  942. * vuejs/component-compiler-utils#22 Support uri fragment in transformed require
  943. * @param urlString an url as a string
  944. */
  945. function parseUriParts(urlString) {
  946. // A TypeError is thrown if urlString is not a string
  947. // @see https://nodejs.org/api/url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost
  948. return url.parse(shared.isString(urlString) ? urlString : '', false, true);
  949. }
  950. const defaultAssetUrlOptions = {
  951. base: null,
  952. includeAbsolute: false,
  953. tags: {
  954. video: ['src', 'poster'],
  955. source: ['src'],
  956. img: ['src'],
  957. image: ['xlink:href', 'href'],
  958. use: ['xlink:href', 'href']
  959. }
  960. };
  961. const normalizeOptions = (options) => {
  962. if (Object.keys(options).some(key => shared.isArray(options[key]))) {
  963. // legacy option format which directly passes in tags config
  964. return {
  965. ...defaultAssetUrlOptions,
  966. tags: options
  967. };
  968. }
  969. return {
  970. ...defaultAssetUrlOptions,
  971. ...options
  972. };
  973. };
  974. const createAssetUrlTransformWithOptions = (options) => {
  975. return (node, context) => transformAssetUrl(node, context, options);
  976. };
  977. /**
  978. * A `@vue/compiler-core` plugin that transforms relative asset urls into
  979. * either imports or absolute urls.
  980. *
  981. * ``` js
  982. * // Before
  983. * createVNode('img', { src: './logo.png' })
  984. *
  985. * // After
  986. * import _imports_0 from './logo.png'
  987. * createVNode('img', { src: _imports_0 })
  988. * ```
  989. */
  990. const transformAssetUrl = (node, context, options = defaultAssetUrlOptions) => {
  991. if (node.type === 1 /* NodeTypes.ELEMENT */) {
  992. if (!node.props.length) {
  993. return;
  994. }
  995. const tags = options.tags || defaultAssetUrlOptions.tags;
  996. const attrs = tags[node.tag];
  997. const wildCardAttrs = tags['*'];
  998. if (!attrs && !wildCardAttrs) {
  999. return;
  1000. }
  1001. const assetAttrs = (attrs || []).concat(wildCardAttrs || []);
  1002. node.props.forEach((attr, index) => {
  1003. if (attr.type !== 6 /* NodeTypes.ATTRIBUTE */ ||
  1004. !assetAttrs.includes(attr.name) ||
  1005. !attr.value ||
  1006. isExternalUrl(attr.value.content) ||
  1007. isDataUrl(attr.value.content) ||
  1008. attr.value.content[0] === '#' ||
  1009. (!options.includeAbsolute && !isRelativeUrl(attr.value.content))) {
  1010. return;
  1011. }
  1012. const url = parseUrl(attr.value.content);
  1013. if (options.base && attr.value.content[0] === '.') {
  1014. // explicit base - directly rewrite relative urls into absolute url
  1015. // to avoid generating extra imports
  1016. // Allow for full hostnames provided in options.base
  1017. const base = parseUrl(options.base);
  1018. const protocol = base.protocol || '';
  1019. const host = base.host ? protocol + '//' + base.host : '';
  1020. const basePath = base.path || '/';
  1021. // when packaged in the browser, path will be using the posix-
  1022. // only version provided by rollup-plugin-node-builtins.
  1023. attr.value.content =
  1024. host +
  1025. (path$4.posix || path$4).join(basePath, url.path + (url.hash || ''));
  1026. return;
  1027. }
  1028. // otherwise, transform the url into an import.
  1029. // this assumes a bundler will resolve the import into the correct
  1030. // absolute url (e.g. webpack file-loader)
  1031. const exp = getImportsExpressionExp(url.path, url.hash, attr.loc, context);
  1032. node.props[index] = {
  1033. type: 7 /* NodeTypes.DIRECTIVE */,
  1034. name: 'bind',
  1035. arg: compilerCore.createSimpleExpression(attr.name, true, attr.loc),
  1036. exp,
  1037. modifiers: [],
  1038. loc: attr.loc
  1039. };
  1040. });
  1041. }
  1042. };
  1043. function getImportsExpressionExp(path, hash, loc, context) {
  1044. if (path) {
  1045. let name;
  1046. let exp;
  1047. const existingIndex = context.imports.findIndex(i => i.path === path);
  1048. if (existingIndex > -1) {
  1049. name = `_imports_${existingIndex}`;
  1050. exp = context.imports[existingIndex].exp;
  1051. }
  1052. else {
  1053. name = `_imports_${context.imports.length}`;
  1054. exp = compilerCore.createSimpleExpression(name, false, loc, 3 /* ConstantTypes.CAN_STRINGIFY */);
  1055. context.imports.push({ exp, path });
  1056. }
  1057. if (!hash) {
  1058. return exp;
  1059. }
  1060. const hashExp = `${name} + '${hash}'`;
  1061. const finalExp = compilerCore.createSimpleExpression(hashExp, false, loc, 3 /* ConstantTypes.CAN_STRINGIFY */);
  1062. if (!context.hoistStatic) {
  1063. return finalExp;
  1064. }
  1065. const existingHoistIndex = context.hoists.findIndex(h => {
  1066. return (h &&
  1067. h.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ &&
  1068. !h.isStatic &&
  1069. h.content === hashExp);
  1070. });
  1071. if (existingHoistIndex > -1) {
  1072. return compilerCore.createSimpleExpression(`_hoisted_${existingHoistIndex + 1}`, false, loc, 3 /* ConstantTypes.CAN_STRINGIFY */);
  1073. }
  1074. return context.hoist(finalExp);
  1075. }
  1076. else {
  1077. return compilerCore.createSimpleExpression(`''`, false, loc, 3 /* ConstantTypes.CAN_STRINGIFY */);
  1078. }
  1079. }
  1080. const srcsetTags = ['img', 'source'];
  1081. // http://w3c.github.io/html/semantics-embedded-content.html#ref-for-image-candidate-string-5
  1082. const escapedSpaceCharacters = /( |\\t|\\n|\\f|\\r)+/g;
  1083. const createSrcsetTransformWithOptions = (options) => {
  1084. return (node, context) => transformSrcset(node, context, options);
  1085. };
  1086. const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
  1087. if (node.type === 1 /* NodeTypes.ELEMENT */) {
  1088. if (srcsetTags.includes(node.tag) && node.props.length) {
  1089. node.props.forEach((attr, index) => {
  1090. if (attr.name === 'srcset' && attr.type === 6 /* NodeTypes.ATTRIBUTE */) {
  1091. if (!attr.value)
  1092. return;
  1093. const value = attr.value.content;
  1094. if (!value)
  1095. return;
  1096. const imageCandidates = value.split(',').map(s => {
  1097. // The attribute value arrives here with all whitespace, except
  1098. // normal spaces, represented by escape sequences
  1099. const [url, descriptor] = s
  1100. .replace(escapedSpaceCharacters, ' ')
  1101. .trim()
  1102. .split(' ', 2);
  1103. return { url, descriptor };
  1104. });
  1105. // data urls contains comma after the encoding so we need to re-merge
  1106. // them
  1107. for (let i = 0; i < imageCandidates.length; i++) {
  1108. const { url } = imageCandidates[i];
  1109. if (isDataUrl(url)) {
  1110. imageCandidates[i + 1].url =
  1111. url + ',' + imageCandidates[i + 1].url;
  1112. imageCandidates.splice(i, 1);
  1113. }
  1114. }
  1115. const shouldProcessUrl = (url) => {
  1116. return (!isExternalUrl(url) &&
  1117. !isDataUrl(url) &&
  1118. (options.includeAbsolute || isRelativeUrl(url)));
  1119. };
  1120. // When srcset does not contain any qualified URLs, skip transforming
  1121. if (!imageCandidates.some(({ url }) => shouldProcessUrl(url))) {
  1122. return;
  1123. }
  1124. if (options.base) {
  1125. const base = options.base;
  1126. const set = [];
  1127. let needImportTransform = false;
  1128. imageCandidates.forEach(candidate => {
  1129. let { url, descriptor } = candidate;
  1130. descriptor = descriptor ? ` ${descriptor}` : ``;
  1131. if (url[0] === '.') {
  1132. candidate.url = (path$4.posix || path$4).join(base, url);
  1133. set.push(candidate.url + descriptor);
  1134. }
  1135. else if (shouldProcessUrl(url)) {
  1136. needImportTransform = true;
  1137. }
  1138. else {
  1139. set.push(url + descriptor);
  1140. }
  1141. });
  1142. if (!needImportTransform) {
  1143. attr.value.content = set.join(', ');
  1144. return;
  1145. }
  1146. }
  1147. const compoundExpression = compilerCore.createCompoundExpression([], attr.loc);
  1148. imageCandidates.forEach(({ url, descriptor }, index) => {
  1149. if (shouldProcessUrl(url)) {
  1150. const { path } = parseUrl(url);
  1151. let exp;
  1152. if (path) {
  1153. const existingImportsIndex = context.imports.findIndex(i => i.path === path);
  1154. if (existingImportsIndex > -1) {
  1155. exp = compilerCore.createSimpleExpression(`_imports_${existingImportsIndex}`, false, attr.loc, 3 /* ConstantTypes.CAN_STRINGIFY */);
  1156. }
  1157. else {
  1158. exp = compilerCore.createSimpleExpression(`_imports_${context.imports.length}`, false, attr.loc, 3 /* ConstantTypes.CAN_STRINGIFY */);
  1159. context.imports.push({ exp, path });
  1160. }
  1161. compoundExpression.children.push(exp);
  1162. }
  1163. }
  1164. else {
  1165. const exp = compilerCore.createSimpleExpression(`"${url}"`, false, attr.loc, 3 /* ConstantTypes.CAN_STRINGIFY */);
  1166. compoundExpression.children.push(exp);
  1167. }
  1168. const isNotLast = imageCandidates.length - 1 > index;
  1169. if (descriptor && isNotLast) {
  1170. compoundExpression.children.push(` + ' ${descriptor}, ' + `);
  1171. }
  1172. else if (descriptor) {
  1173. compoundExpression.children.push(` + ' ${descriptor}'`);
  1174. }
  1175. else if (isNotLast) {
  1176. compoundExpression.children.push(` + ', ' + `);
  1177. }
  1178. });
  1179. let exp = compoundExpression;
  1180. if (context.hoistStatic) {
  1181. exp = context.hoist(compoundExpression);
  1182. exp.constType = 3 /* ConstantTypes.CAN_STRINGIFY */;
  1183. }
  1184. node.props[index] = {
  1185. type: 7 /* NodeTypes.DIRECTIVE */,
  1186. name: 'bind',
  1187. arg: compilerCore.createSimpleExpression('srcset', true, attr.loc),
  1188. exp,
  1189. modifiers: [],
  1190. loc: attr.loc
  1191. };
  1192. }
  1193. });
  1194. }
  1195. }
  1196. };
  1197. var consolidate$2 = {exports: {}};
  1198. function commonjsRequire(path) {
  1199. throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
  1200. }
  1201. var consolidate$1 = {exports: {}};
  1202. (function (module, exports) {
  1203. /*
  1204. * Engines which do not support caching of their file contents
  1205. * should use the `read()` function defined in consolidate.js
  1206. * On top of this, when an engine compiles to a `Function`,
  1207. * these functions should either be cached within consolidate.js
  1208. * or the engine itself via `options.cache`. This will allow
  1209. * users and frameworks to pass `options.cache = true` for
  1210. * `NODE_ENV=production`, however edit the file(s) without
  1211. * re-loading the application in development.
  1212. */
  1213. /**
  1214. * Module dependencies.
  1215. */
  1216. var fs = require$$0$1;
  1217. var path = path$4;
  1218. var util = require$$2;
  1219. var join = path.join;
  1220. var resolve = path.resolve;
  1221. var extname = path.extname;
  1222. var dirname = path.dirname;
  1223. var isAbsolute = path.isAbsolute;
  1224. var readCache = {};
  1225. /**
  1226. * Require cache.
  1227. */
  1228. var cacheStore = {};
  1229. /**
  1230. * Require cache.
  1231. */
  1232. var requires = {};
  1233. /**
  1234. * Clear the cache.
  1235. *
  1236. * @api public
  1237. */
  1238. exports.clearCache = function() {
  1239. readCache = {};
  1240. cacheStore = {};
  1241. };
  1242. /**
  1243. * Conditionally cache `compiled` template based
  1244. * on the `options` filename and `.cache` boolean.
  1245. *
  1246. * @param {Object} options
  1247. * @param {Function} compiled
  1248. * @return {Function}
  1249. * @api private
  1250. */
  1251. function cache(options, compiled) {
  1252. // cachable
  1253. if (compiled && options.filename && options.cache) {
  1254. delete readCache[options.filename];
  1255. cacheStore[options.filename] = compiled;
  1256. return compiled;
  1257. }
  1258. // check cache
  1259. if (options.filename && options.cache) {
  1260. return cacheStore[options.filename];
  1261. }
  1262. return compiled;
  1263. }
  1264. /**
  1265. * Read `path` with `options` with
  1266. * callback `(err, str)`. When `options.cache`
  1267. * is true the template string will be cached.
  1268. *
  1269. * @param {String} options
  1270. * @param {Function} cb
  1271. * @api private
  1272. */
  1273. function read(path, options, cb) {
  1274. var str = readCache[path];
  1275. var cached = options.cache && str && typeof str === 'string';
  1276. // cached (only if cached is a string and not a compiled template function)
  1277. if (cached) return cb(null, str);
  1278. // read
  1279. fs.readFile(path, 'utf8', function(err, str) {
  1280. if (err) return cb(err);
  1281. // remove extraneous utf8 BOM marker
  1282. str = str.replace(/^\uFEFF/, '');
  1283. if (options.cache) readCache[path] = str;
  1284. cb(null, str);
  1285. });
  1286. }
  1287. /**
  1288. * Read `path` with `options` with
  1289. * callback `(err, str)`. When `options.cache`
  1290. * is true the partial string will be cached.
  1291. *
  1292. * @param {String} options
  1293. * @param {Function} fn
  1294. * @api private
  1295. */
  1296. function readPartials(path, options, cb) {
  1297. if (!options.partials) return cb();
  1298. var keys = Object.keys(options.partials);
  1299. var partials = {};
  1300. function next(index) {
  1301. if (index === keys.length) return cb(null, partials);
  1302. var key = keys[index];
  1303. var partialPath = options.partials[key];
  1304. if (partialPath === undefined || partialPath === null || partialPath === false) {
  1305. return next(++index);
  1306. }
  1307. var file;
  1308. if (isAbsolute(partialPath)) {
  1309. if (extname(partialPath) !== '') {
  1310. file = partialPath;
  1311. } else {
  1312. file = join(partialPath + extname(path));
  1313. }
  1314. } else {
  1315. file = join(dirname(path), partialPath + extname(path));
  1316. }
  1317. read(file, options, function(err, str) {
  1318. if (err) return cb(err);
  1319. partials[key] = str;
  1320. next(++index);
  1321. });
  1322. }
  1323. next(0);
  1324. }
  1325. /**
  1326. * promisify
  1327. */
  1328. function promisify(cb, fn) {
  1329. return new Promise(function(resolve, reject) {
  1330. cb = cb || function(err, html) {
  1331. if (err) {
  1332. return reject(err);
  1333. }
  1334. resolve(html);
  1335. };
  1336. fn(cb);
  1337. });
  1338. }
  1339. /**
  1340. * fromStringRenderer
  1341. */
  1342. function fromStringRenderer(name) {
  1343. return function(path, options, cb) {
  1344. options.filename = path;
  1345. return promisify(cb, function(cb) {
  1346. readPartials(path, options, function(err, partials) {
  1347. var extend = (requires.extend || (requires.extend = require$$2._extend));
  1348. var opts = extend({}, options);
  1349. opts.partials = partials;
  1350. if (err) return cb(err);
  1351. if (cache(opts)) {
  1352. exports[name].render('', opts, cb);
  1353. } else {
  1354. read(path, opts, function(err, str) {
  1355. if (err) return cb(err);
  1356. exports[name].render(str, opts, cb);
  1357. });
  1358. }
  1359. });
  1360. });
  1361. };
  1362. }
  1363. /**
  1364. * velocity support.
  1365. */
  1366. exports.velocityjs = fromStringRenderer('velocityjs');
  1367. /**
  1368. * velocity string support.
  1369. */
  1370. exports.velocityjs.render = function(str, options, cb) {
  1371. return promisify(cb, function(cb) {
  1372. var engine = requires.velocityjs || (requires.velocityjs = require('velocityjs'));
  1373. try {
  1374. options.locals = options;
  1375. cb(null, engine.render(str, options).trimLeft());
  1376. } catch (err) {
  1377. cb(err);
  1378. }
  1379. });
  1380. };
  1381. /**
  1382. * Liquid support.
  1383. */
  1384. exports.liquid = fromStringRenderer('liquid');
  1385. /**
  1386. * Liquid string support.
  1387. */
  1388. /**
  1389. * Note that in order to get filters and custom tags we've had to push
  1390. * all user-defined locals down into @locals. However, just to make things
  1391. * backwards-compatible, any property of `options` that is left after
  1392. * processing and removing `locals`, `meta`, `filters`, `customTags` and
  1393. * `includeDir` will also become a local.
  1394. */
  1395. function _renderTinyliquid(engine, str, options, cb) {
  1396. var context = engine.newContext();
  1397. var k;
  1398. /**
  1399. * Note that there's a bug in the library that doesn't allow us to pass
  1400. * the locals to newContext(), hence looping through the keys:
  1401. */
  1402. if (options.locals) {
  1403. for (k in options.locals) {
  1404. context.setLocals(k, options.locals[k]);
  1405. }
  1406. delete options.locals;
  1407. }
  1408. if (options.meta) {
  1409. context.setLocals('page', options.meta);
  1410. delete options.meta;
  1411. }
  1412. /**
  1413. * Add any defined filters:
  1414. */
  1415. if (options.filters) {
  1416. for (k in options.filters) {
  1417. context.setFilter(k, options.filters[k]);
  1418. }
  1419. delete options.filters;
  1420. }
  1421. /**
  1422. * Set up a callback for the include directory:
  1423. */
  1424. var includeDir = options.includeDir || process.cwd();
  1425. context.onInclude(function(name, callback) {
  1426. var extname = path.extname(name) ? '' : '.liquid';
  1427. var filename = path.resolve(includeDir, name + extname);
  1428. fs.readFile(filename, {encoding: 'utf8'}, function(err, data) {
  1429. if (err) return callback(err);
  1430. callback(null, engine.parse(data));
  1431. });
  1432. });
  1433. delete options.includeDir;
  1434. /**
  1435. * The custom tag functions need to have their results pushed back
  1436. * through the parser, so set up a shim before calling the provided
  1437. * callback:
  1438. */
  1439. var compileOptions = {
  1440. customTags: {}
  1441. };
  1442. if (options.customTags) {
  1443. var tagFunctions = options.customTags;
  1444. for (k in options.customTags) {
  1445. /*Tell jshint there's no problem with having this function in the loop */
  1446. /*jshint -W083 */
  1447. compileOptions.customTags[k] = function(context, name, body) {
  1448. var tpl = tagFunctions[name](body.trim());
  1449. context.astStack.push(engine.parse(tpl));
  1450. };
  1451. /*jshint +W083 */
  1452. }
  1453. delete options.customTags;
  1454. }
  1455. /**
  1456. * Now anything left in `options` becomes a local:
  1457. */
  1458. for (k in options) {
  1459. context.setLocals(k, options[k]);
  1460. }
  1461. /**
  1462. * Finally, execute the template:
  1463. */
  1464. var tmpl = cache(context) || cache(context, engine.compile(str, compileOptions));
  1465. tmpl(context, cb);
  1466. }
  1467. exports.liquid.render = function(str, options, cb) {
  1468. return promisify(cb, function(cb) {
  1469. var engine = requires.liquid;
  1470. var Liquid;
  1471. try {
  1472. // set up tinyliquid engine
  1473. engine = requires.liquid = require('tinyliquid');
  1474. // use tinyliquid engine
  1475. _renderTinyliquid(engine, str, options, cb);
  1476. return;
  1477. } catch (err) {
  1478. // set up liquid-node engine
  1479. try {
  1480. Liquid = requires.liquid = require('liquid-node');
  1481. engine = new Liquid.Engine();
  1482. } catch (err) {
  1483. throw err;
  1484. }
  1485. }
  1486. // use liquid-node engine
  1487. try {
  1488. var locals = options.locals || {};
  1489. if (options.meta) {
  1490. locals.pages = options.meta;
  1491. delete options.meta;
  1492. }
  1493. /**
  1494. * Add any defined filters:
  1495. */
  1496. if (options.filters) {
  1497. engine.registerFilters(options.filters);
  1498. delete options.filters;
  1499. }
  1500. /**
  1501. * Set up a callback for the include directory:
  1502. */
  1503. var includeDir = options.includeDir || process.cwd();
  1504. engine.fileSystem = new Liquid.LocalFileSystem(includeDir, 'liquid');
  1505. delete options.includeDir;
  1506. /**
  1507. * The custom tag functions need to have their results pushed back
  1508. * through the parser, so set up a shim before calling the provided
  1509. * callback:
  1510. */
  1511. if (options.customTags) {
  1512. var tagFunctions = options.customTags;
  1513. for (k in options.customTags) {
  1514. engine.registerTag(k, tagFunctions[k]);
  1515. }
  1516. delete options.customTags;
  1517. }
  1518. /**
  1519. * Now anything left in `options` becomes a local:
  1520. */
  1521. for (var k in options) {
  1522. locals[k] = options[k];
  1523. }
  1524. /**
  1525. * Finally, execute the template:
  1526. */
  1527. return engine
  1528. .parseAndRender(str, locals)
  1529. .nodeify(function(err, result) {
  1530. if (err) {
  1531. throw new Error(err);
  1532. } else {
  1533. return cb(null, result);
  1534. }
  1535. });
  1536. } catch (err) {
  1537. cb(err);
  1538. }
  1539. });
  1540. };
  1541. /**
  1542. * Jade support.
  1543. */
  1544. exports.jade = function(path, options, cb) {
  1545. return promisify(cb, function(cb) {
  1546. var engine = requires.jade;
  1547. if (!engine) {
  1548. try {
  1549. engine = requires.jade = require('jade');
  1550. } catch (err) {
  1551. try {
  1552. engine = requires.jade = require('then-jade');
  1553. } catch (otherError) {
  1554. throw err;
  1555. }
  1556. }
  1557. }
  1558. try {
  1559. var tmpl = cache(options) || cache(options, engine.compileFile(path, options));
  1560. cb(null, tmpl(options));
  1561. } catch (err) {
  1562. cb(err);
  1563. }
  1564. });
  1565. };
  1566. /**
  1567. * Jade string support.
  1568. */
  1569. exports.jade.render = function(str, options, cb) {
  1570. return promisify(cb, function(cb) {
  1571. var engine = requires.jade;
  1572. if (!engine) {
  1573. try {
  1574. engine = requires.jade = require('jade');
  1575. } catch (err) {
  1576. try {
  1577. engine = requires.jade = require('then-jade');
  1578. } catch (otherError) {
  1579. throw err;
  1580. }
  1581. }
  1582. }
  1583. try {
  1584. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  1585. cb(null, tmpl(options));
  1586. } catch (err) {
  1587. cb(err);
  1588. }
  1589. });
  1590. };
  1591. /**
  1592. * Dust support.
  1593. */
  1594. exports.dust = fromStringRenderer('dust');
  1595. /**
  1596. * Dust string support.
  1597. */
  1598. exports.dust.render = function(str, options, cb) {
  1599. return promisify(cb, function(cb) {
  1600. var engine = requires.dust;
  1601. if (!engine) {
  1602. try {
  1603. engine = requires.dust = require('dust');
  1604. } catch (err) {
  1605. try {
  1606. engine = requires.dust = require('dustjs-helpers');
  1607. } catch (err) {
  1608. engine = requires.dust = require('dustjs-linkedin');
  1609. }
  1610. }
  1611. }
  1612. var ext = 'dust';
  1613. var views = '.';
  1614. if (options) {
  1615. if (options.ext) ext = options.ext;
  1616. if (options.views) views = options.views;
  1617. if (options.settings && options.settings.views) views = options.settings.views;
  1618. }
  1619. if (!options || (options && !options.cache)) engine.cache = {};
  1620. engine.onLoad = function(path, callback) {
  1621. if (extname(path) === '') path += '.' + ext;
  1622. if (path[0] !== '/') path = views + '/' + path;
  1623. read(path, options, callback);
  1624. };
  1625. try {
  1626. var templateName;
  1627. if (options.filename) {
  1628. templateName = options.filename.replace(new RegExp('^' + views + '/'), '').replace(new RegExp('\\.' + ext), '');
  1629. }
  1630. var tmpl = cache(options) || cache(options, engine.compileFn(str, templateName));
  1631. tmpl(options, cb);
  1632. } catch (err) {
  1633. cb(err);
  1634. }
  1635. });
  1636. };
  1637. /**
  1638. * Swig support.
  1639. */
  1640. exports.swig = fromStringRenderer('swig');
  1641. /**
  1642. * Swig string support.
  1643. */
  1644. exports.swig.render = function(str, options, cb) {
  1645. return promisify(cb, function(cb) {
  1646. var engine = requires.swig;
  1647. if (!engine) {
  1648. try {
  1649. engine = requires.swig = require('swig');
  1650. } catch (err) {
  1651. try {
  1652. engine = requires.swig = require('swig-templates');
  1653. } catch (otherError) {
  1654. throw err;
  1655. }
  1656. }
  1657. }
  1658. try {
  1659. if (options.cache === true) options.cache = 'memory';
  1660. engine.setDefaults({ cache: options.cache });
  1661. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  1662. cb(null, tmpl(options));
  1663. } catch (err) {
  1664. cb(err);
  1665. }
  1666. });
  1667. };
  1668. /**
  1669. * Razor support.
  1670. */
  1671. exports.razor = function(path, options, cb) {
  1672. return promisify(cb, function(cb) {
  1673. var engine = requires.razor;
  1674. if (!engine) {
  1675. try {
  1676. engine = requires.razor = require('razor-tmpl');
  1677. } catch (err) {
  1678. throw err;
  1679. }
  1680. }
  1681. try {
  1682. var tmpl = cache(options) || cache(options, (locals) => {
  1683. console.log('Rendering razor file', path);
  1684. return engine.renderFileSync(path, locals);
  1685. });
  1686. cb(null, tmpl(options));
  1687. } catch (err) {
  1688. cb(err);
  1689. }
  1690. });
  1691. };
  1692. /**
  1693. * razor string support.
  1694. */
  1695. exports.razor.render = function(str, options, cb) {
  1696. return promisify(cb, function(cb) {
  1697. try {
  1698. var engine = requires.razor = require('razor-tmpl');
  1699. } catch (err) {
  1700. throw err;
  1701. }
  1702. try {
  1703. var tf = engine.compile(str);
  1704. var tmpl = cache(options) || cache(options, tf);
  1705. cb(null, tmpl(options));
  1706. } catch (err) {
  1707. cb(err);
  1708. }
  1709. });
  1710. };
  1711. /**
  1712. * Atpl support.
  1713. */
  1714. exports.atpl = fromStringRenderer('atpl');
  1715. /**
  1716. * Atpl string support.
  1717. */
  1718. exports.atpl.render = function(str, options, cb) {
  1719. return promisify(cb, function(cb) {
  1720. var engine = requires.atpl || (requires.atpl = require('atpl'));
  1721. try {
  1722. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  1723. cb(null, tmpl(options));
  1724. } catch (err) {
  1725. cb(err);
  1726. }
  1727. });
  1728. };
  1729. /**
  1730. * Liquor support,
  1731. */
  1732. exports.liquor = fromStringRenderer('liquor');
  1733. /**
  1734. * Liquor string support.
  1735. */
  1736. exports.liquor.render = function(str, options, cb) {
  1737. return promisify(cb, function(cb) {
  1738. var engine = requires.liquor || (requires.liquor = require('liquor'));
  1739. try {
  1740. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  1741. cb(null, tmpl(options));
  1742. } catch (err) {
  1743. cb(err);
  1744. }
  1745. });
  1746. };
  1747. /**
  1748. * Twig support.
  1749. */
  1750. exports.twig = fromStringRenderer('twig');
  1751. /**
  1752. * Twig string support.
  1753. */
  1754. exports.twig.render = function(str, options, cb) {
  1755. return promisify(cb, function(cb) {
  1756. var engine = requires.twig || (requires.twig = require('twig').twig);
  1757. var templateData = {
  1758. data: str,
  1759. allowInlineIncludes: options.allowInlineIncludes,
  1760. namespaces: options.namespaces,
  1761. path: options.path
  1762. };
  1763. try {
  1764. var tmpl = cache(templateData) || cache(templateData, engine(templateData));
  1765. cb(null, tmpl.render(options));
  1766. } catch (err) {
  1767. cb(err);
  1768. }
  1769. });
  1770. };
  1771. /**
  1772. * EJS support.
  1773. */
  1774. exports.ejs = fromStringRenderer('ejs');
  1775. /**
  1776. * EJS string support.
  1777. */
  1778. exports.ejs.render = function(str, options, cb) {
  1779. return promisify(cb, function(cb) {
  1780. var engine = requires.ejs || (requires.ejs = require('ejs'));
  1781. try {
  1782. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  1783. cb(null, tmpl(options));
  1784. } catch (err) {
  1785. cb(err);
  1786. }
  1787. });
  1788. };
  1789. /**
  1790. * Eco support.
  1791. */
  1792. exports.eco = fromStringRenderer('eco');
  1793. /**
  1794. * Eco string support.
  1795. */
  1796. exports.eco.render = function(str, options, cb) {
  1797. return promisify(cb, function(cb) {
  1798. var engine = requires.eco || (requires.eco = require('eco'));
  1799. try {
  1800. cb(null, engine.render(str, options));
  1801. } catch (err) {
  1802. cb(err);
  1803. }
  1804. });
  1805. };
  1806. /**
  1807. * Jazz support.
  1808. */
  1809. exports.jazz = fromStringRenderer('jazz');
  1810. /**
  1811. * Jazz string support.
  1812. */
  1813. exports.jazz.render = function(str, options, cb) {
  1814. return promisify(cb, function(cb) {
  1815. var engine = requires.jazz || (requires.jazz = require('jazz'));
  1816. try {
  1817. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  1818. tmpl.eval(options, function(str) {
  1819. cb(null, str);
  1820. });
  1821. } catch (err) {
  1822. cb(err);
  1823. }
  1824. });
  1825. };
  1826. /**
  1827. * JQTPL support.
  1828. */
  1829. exports.jqtpl = fromStringRenderer('jqtpl');
  1830. /**
  1831. * JQTPL string support.
  1832. */
  1833. exports.jqtpl.render = function(str, options, cb) {
  1834. return promisify(cb, function(cb) {
  1835. var engine = requires.jqtpl || (requires.jqtpl = require('jqtpl'));
  1836. try {
  1837. engine.template(str, str);
  1838. cb(null, engine.tmpl(str, options));
  1839. } catch (err) {
  1840. cb(err);
  1841. }
  1842. });
  1843. };
  1844. /**
  1845. * Haml support.
  1846. */
  1847. exports.haml = fromStringRenderer('haml');
  1848. /**
  1849. * Haml string support.
  1850. */
  1851. exports.haml.render = function(str, options, cb) {
  1852. return promisify(cb, function(cb) {
  1853. var engine = requires.haml || (requires.haml = require('hamljs'));
  1854. try {
  1855. options.locals = options;
  1856. cb(null, engine.render(str, options).trimLeft());
  1857. } catch (err) {
  1858. cb(err);
  1859. }
  1860. });
  1861. };
  1862. /**
  1863. * Hamlet support.
  1864. */
  1865. exports.hamlet = fromStringRenderer('hamlet');
  1866. /**
  1867. * Hamlet string support.
  1868. */
  1869. exports.hamlet.render = function(str, options, cb) {
  1870. return promisify(cb, function(cb) {
  1871. var engine = requires.hamlet || (requires.hamlet = require('hamlet'));
  1872. try {
  1873. options.locals = options;
  1874. cb(null, engine.render(str, options).trimLeft());
  1875. } catch (err) {
  1876. cb(err);
  1877. }
  1878. });
  1879. };
  1880. /**
  1881. * Whiskers support.
  1882. */
  1883. exports.whiskers = function(path, options, cb) {
  1884. return promisify(cb, function(cb) {
  1885. var engine = requires.whiskers || (requires.whiskers = require('whiskers'));
  1886. engine.__express(path, options, cb);
  1887. });
  1888. };
  1889. /**
  1890. * Whiskers string support.
  1891. */
  1892. exports.whiskers.render = function(str, options, cb) {
  1893. return promisify(cb, function(cb) {
  1894. var engine = requires.whiskers || (requires.whiskers = require('whiskers'));
  1895. try {
  1896. cb(null, engine.render(str, options));
  1897. } catch (err) {
  1898. cb(err);
  1899. }
  1900. });
  1901. };
  1902. /**
  1903. * Coffee-HAML support.
  1904. */
  1905. exports['haml-coffee'] = fromStringRenderer('haml-coffee');
  1906. /**
  1907. * Coffee-HAML string support.
  1908. */
  1909. exports['haml-coffee'].render = function(str, options, cb) {
  1910. return promisify(cb, function(cb) {
  1911. var engine = requires['haml-coffee'] || (requires['haml-coffee'] = require('haml-coffee'));
  1912. try {
  1913. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  1914. cb(null, tmpl(options));
  1915. } catch (err) {
  1916. cb(err);
  1917. }
  1918. });
  1919. };
  1920. /**
  1921. * Hogan support.
  1922. */
  1923. exports.hogan = fromStringRenderer('hogan');
  1924. /**
  1925. * Hogan string support.
  1926. */
  1927. exports.hogan.render = function(str, options, cb) {
  1928. return promisify(cb, function(cb) {
  1929. var engine = requires.hogan || (requires.hogan = require('hogan.js'));
  1930. try {
  1931. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  1932. cb(null, tmpl.render(options, options.partials));
  1933. } catch (err) {
  1934. cb(err);
  1935. }
  1936. });
  1937. };
  1938. /**
  1939. * templayed.js support.
  1940. */
  1941. exports.templayed = fromStringRenderer('templayed');
  1942. /**
  1943. * templayed.js string support.
  1944. */
  1945. exports.templayed.render = function(str, options, cb) {
  1946. return promisify(cb, function(cb) {
  1947. var engine = requires.templayed || (requires.templayed = require('templayed'));
  1948. try {
  1949. var tmpl = cache(options) || cache(options, engine(str));
  1950. cb(null, tmpl(options));
  1951. } catch (err) {
  1952. cb(err);
  1953. }
  1954. });
  1955. };
  1956. /**
  1957. * Handlebars support.
  1958. */
  1959. exports.handlebars = fromStringRenderer('handlebars');
  1960. /**
  1961. * Handlebars string support.
  1962. */
  1963. exports.handlebars.render = function(str, options, cb) {
  1964. return promisify(cb, function(cb) {
  1965. var engine = requires.handlebars || (requires.handlebars = require('handlebars'));
  1966. try {
  1967. for (var partial in options.partials) {
  1968. engine.registerPartial(partial, options.partials[partial]);
  1969. }
  1970. for (var helper in options.helpers) {
  1971. engine.registerHelper(helper, options.helpers[helper]);
  1972. }
  1973. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  1974. cb(null, tmpl(options));
  1975. } catch (err) {
  1976. cb(err);
  1977. }
  1978. });
  1979. };
  1980. /**
  1981. * Underscore support.
  1982. */
  1983. exports.underscore = fromStringRenderer('underscore');
  1984. /**
  1985. * Underscore string support.
  1986. */
  1987. exports.underscore.render = function(str, options, cb) {
  1988. return promisify(cb, function(cb) {
  1989. var engine = requires.underscore || (requires.underscore = require('underscore'));
  1990. try {
  1991. const partials = {};
  1992. for (var partial in options.partials) {
  1993. partials[partial] = engine.template(options.partials[partial]);
  1994. }
  1995. options.partials = partials;
  1996. var tmpl = cache(options) || cache(options, engine.template(str, null, options));
  1997. cb(null, tmpl(options).replace(/\n$/, ''));
  1998. } catch (err) {
  1999. cb(err);
  2000. }
  2001. });
  2002. };
  2003. /**
  2004. * Lodash support.
  2005. */
  2006. exports.lodash = fromStringRenderer('lodash');
  2007. /**
  2008. * Lodash string support.
  2009. */
  2010. exports.lodash.render = function(str, options, cb) {
  2011. return promisify(cb, function(cb) {
  2012. var engine = requires.lodash || (requires.lodash = require('lodash'));
  2013. try {
  2014. var tmpl = cache(options) || cache(options, engine.template(str, options));
  2015. cb(null, tmpl(options).replace(/\n$/, ''));
  2016. } catch (err) {
  2017. cb(err);
  2018. }
  2019. });
  2020. };
  2021. /**
  2022. * Pug support. (formerly Jade)
  2023. */
  2024. exports.pug = function(path, options, cb) {
  2025. return promisify(cb, function(cb) {
  2026. var engine = requires.pug;
  2027. if (!engine) {
  2028. try {
  2029. engine = requires.pug = require('pug');
  2030. } catch (err) {
  2031. try {
  2032. engine = requires.pug = require('then-pug');
  2033. } catch (otherError) {
  2034. throw err;
  2035. }
  2036. }
  2037. }
  2038. try {
  2039. var tmpl = cache(options) || cache(options, engine.compileFile(path, options));
  2040. cb(null, tmpl(options));
  2041. } catch (err) {
  2042. cb(err);
  2043. }
  2044. });
  2045. };
  2046. /**
  2047. * Pug string support.
  2048. */
  2049. exports.pug.render = function(str, options, cb) {
  2050. return promisify(cb, function(cb) {
  2051. var engine = requires.pug;
  2052. if (!engine) {
  2053. try {
  2054. engine = requires.pug = require('pug');
  2055. } catch (err) {
  2056. try {
  2057. engine = requires.pug = require('then-pug');
  2058. } catch (otherError) {
  2059. throw err;
  2060. }
  2061. }
  2062. }
  2063. try {
  2064. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  2065. cb(null, tmpl(options));
  2066. } catch (err) {
  2067. cb(err);
  2068. }
  2069. });
  2070. };
  2071. /**
  2072. * QEJS support.
  2073. */
  2074. exports.qejs = fromStringRenderer('qejs');
  2075. /**
  2076. * QEJS string support.
  2077. */
  2078. exports.qejs.render = function(str, options, cb) {
  2079. return promisify(cb, function(cb) {
  2080. try {
  2081. var engine = requires.qejs || (requires.qejs = require('qejs'));
  2082. engine.render(str, options).then(function(result) {
  2083. cb(null, result);
  2084. }, function(err) {
  2085. cb(err);
  2086. }).done();
  2087. } catch (err) {
  2088. cb(err);
  2089. }
  2090. });
  2091. };
  2092. /**
  2093. * Walrus support.
  2094. */
  2095. exports.walrus = fromStringRenderer('walrus');
  2096. /**
  2097. * Walrus string support.
  2098. */
  2099. exports.walrus.render = function(str, options, cb) {
  2100. return promisify(cb, function(cb) {
  2101. var engine = requires.walrus || (requires.walrus = require('walrus'));
  2102. try {
  2103. var tmpl = cache(options) || cache(options, engine.parse(str));
  2104. cb(null, tmpl.compile(options));
  2105. } catch (err) {
  2106. cb(err);
  2107. }
  2108. });
  2109. };
  2110. /**
  2111. * Mustache support.
  2112. */
  2113. exports.mustache = fromStringRenderer('mustache');
  2114. /**
  2115. * Mustache string support.
  2116. */
  2117. exports.mustache.render = function(str, options, cb) {
  2118. return promisify(cb, function(cb) {
  2119. var engine = requires.mustache || (requires.mustache = require('mustache'));
  2120. try {
  2121. cb(null, engine.render(str, options, options.partials));
  2122. } catch (err) {
  2123. cb(err);
  2124. }
  2125. });
  2126. };
  2127. /**
  2128. * Just support.
  2129. */
  2130. exports.just = function(path, options, cb) {
  2131. return promisify(cb, function(cb) {
  2132. var engine = requires.just;
  2133. if (!engine) {
  2134. var JUST = require('just');
  2135. engine = requires.just = new JUST();
  2136. }
  2137. engine.configure({ useCache: options.cache });
  2138. engine.render(path, options, cb);
  2139. });
  2140. };
  2141. /**
  2142. * Just string support.
  2143. */
  2144. exports.just.render = function(str, options, cb) {
  2145. return promisify(cb, function(cb) {
  2146. var JUST = require('just');
  2147. var engine = new JUST({ root: { page: str }});
  2148. engine.render('page', options, cb);
  2149. });
  2150. };
  2151. /**
  2152. * ECT support.
  2153. */
  2154. exports.ect = function(path, options, cb) {
  2155. return promisify(cb, function(cb) {
  2156. var engine = requires.ect;
  2157. if (!engine) {
  2158. var ECT = require('ect');
  2159. engine = requires.ect = new ECT(options);
  2160. }
  2161. engine.configure({ cache: options.cache });
  2162. engine.render(path, options, cb);
  2163. });
  2164. };
  2165. /**
  2166. * ECT string support.
  2167. */
  2168. exports.ect.render = function(str, options, cb) {
  2169. return promisify(cb, function(cb) {
  2170. var ECT = require('ect');
  2171. var engine = new ECT({ root: { page: str }});
  2172. engine.render('page', options, cb);
  2173. });
  2174. };
  2175. /**
  2176. * mote support.
  2177. */
  2178. exports.mote = fromStringRenderer('mote');
  2179. /**
  2180. * mote string support.
  2181. */
  2182. exports.mote.render = function(str, options, cb) {
  2183. return promisify(cb, function(cb) {
  2184. var engine = requires.mote || (requires.mote = require('mote'));
  2185. try {
  2186. var tmpl = cache(options) || cache(options, engine.compile(str));
  2187. cb(null, tmpl(options));
  2188. } catch (err) {
  2189. cb(err);
  2190. }
  2191. });
  2192. };
  2193. /**
  2194. * Toffee support.
  2195. */
  2196. exports.toffee = function(path, options, cb) {
  2197. return promisify(cb, function(cb) {
  2198. var toffee = requires.toffee || (requires.toffee = require('toffee'));
  2199. toffee.__consolidate_engine_render(path, options, cb);
  2200. });
  2201. };
  2202. /**
  2203. * Toffee string support.
  2204. */
  2205. exports.toffee.render = function(str, options, cb) {
  2206. return promisify(cb, function(cb) {
  2207. var engine = requires.toffee || (requires.toffee = require('toffee'));
  2208. try {
  2209. engine.str_render(str, options, cb);
  2210. } catch (err) {
  2211. cb(err);
  2212. }
  2213. });
  2214. };
  2215. /**
  2216. * doT support.
  2217. */
  2218. exports.dot = fromStringRenderer('dot');
  2219. /**
  2220. * doT string support.
  2221. */
  2222. exports.dot.render = function(str, options, cb) {
  2223. return promisify(cb, function(cb) {
  2224. var engine = requires.dot || (requires.dot = require('dot'));
  2225. var extend = (requires.extend || (requires.extend = require$$2._extend));
  2226. try {
  2227. var settings = {};
  2228. settings = extend(settings, engine.templateSettings);
  2229. settings = extend(settings, options ? options.dot : {});
  2230. var tmpl = cache(options) || cache(options, engine.template(str, settings, options));
  2231. cb(null, tmpl(options));
  2232. } catch (err) {
  2233. cb(err);
  2234. }
  2235. });
  2236. };
  2237. /**
  2238. * bracket support.
  2239. */
  2240. exports.bracket = fromStringRenderer('bracket');
  2241. /**
  2242. * bracket string support.
  2243. */
  2244. exports.bracket.render = function(str, options, cb) {
  2245. return promisify(cb, function(cb) {
  2246. var engine = requires.bracket || (requires.bracket = require('bracket-template'));
  2247. try {
  2248. var tmpl = cache(options) || cache(options, engine.default.compile(str, options));
  2249. cb(null, tmpl(options));
  2250. } catch (err) {
  2251. cb(err);
  2252. }
  2253. });
  2254. };
  2255. /**
  2256. * Ractive support.
  2257. */
  2258. exports.ractive = fromStringRenderer('ractive');
  2259. /**
  2260. * Ractive string support.
  2261. */
  2262. exports.ractive.render = function(str, options, cb) {
  2263. return promisify(cb, function(cb) {
  2264. var Engine = requires.ractive || (requires.ractive = require('ractive'));
  2265. var template = cache(options) || cache(options, Engine.parse(str));
  2266. options.template = template;
  2267. if (options.data === null || options.data === undefined) {
  2268. var extend = (requires.extend || (requires.extend = require$$2._extend));
  2269. // Shallow clone the options object
  2270. options.data = extend({}, options);
  2271. // Remove consolidate-specific properties from the clone
  2272. var i;
  2273. var length;
  2274. var properties = ['template', 'filename', 'cache', 'partials'];
  2275. for (i = 0, length = properties.length; i < length; i++) {
  2276. var property = properties[i];
  2277. delete options.data[property];
  2278. }
  2279. }
  2280. try {
  2281. cb(null, new Engine(options).toHTML());
  2282. } catch (err) {
  2283. cb(err);
  2284. }
  2285. });
  2286. };
  2287. /**
  2288. * Nunjucks support.
  2289. */
  2290. exports.nunjucks = fromStringRenderer('nunjucks');
  2291. /**
  2292. * Nunjucks string support.
  2293. */
  2294. exports.nunjucks.render = function(str, options, cb) {
  2295. return promisify(cb, function(cb) {
  2296. try {
  2297. var engine = options.nunjucksEnv || requires.nunjucks || (requires.nunjucks = require('nunjucks'));
  2298. var env = engine;
  2299. // deprecated fallback support for express
  2300. // <https://github.com/tj/consolidate.js/pull/152>
  2301. // <https://github.com/tj/consolidate.js/pull/224>
  2302. if (options.settings && options.settings.views) {
  2303. env = engine.configure(options.settings.views);
  2304. } else if (options.nunjucks && options.nunjucks.configure) {
  2305. env = engine.configure.apply(engine, options.nunjucks.configure);
  2306. }
  2307. //
  2308. // because `renderString` does not initiate loaders
  2309. // we must manually create a loader for it based off
  2310. // either `options.settings.views` or `options.nunjucks` or `options.nunjucks.root`
  2311. //
  2312. // <https://github.com/mozilla/nunjucks/issues/730>
  2313. // <https://github.com/crocodilejs/node-email-templates/issues/182>
  2314. //
  2315. // so instead we simply check if we passed a custom loader
  2316. // otherwise we create a simple file based loader
  2317. if (options.loader) {
  2318. env = new engine.Environment(options.loader);
  2319. } else if (options.settings && options.settings.views) {
  2320. env = new engine.Environment(
  2321. new engine.FileSystemLoader(options.settings.views)
  2322. );
  2323. } else if (options.nunjucks && options.nunjucks.loader) {
  2324. if (typeof options.nunjucks.loader === 'string') {
  2325. env = new engine.Environment(new engine.FileSystemLoader(options.nunjucks.loader));
  2326. } else {
  2327. env = new engine.Environment(
  2328. new engine.FileSystemLoader(
  2329. options.nunjucks.loader[0],
  2330. options.nunjucks.loader[1]
  2331. )
  2332. );
  2333. }
  2334. }
  2335. env.renderString(str, options, cb);
  2336. } catch (err) {
  2337. throw cb(err);
  2338. }
  2339. });
  2340. };
  2341. /**
  2342. * HTMLing support.
  2343. */
  2344. exports.htmling = fromStringRenderer('htmling');
  2345. /**
  2346. * HTMLing string support.
  2347. */
  2348. exports.htmling.render = function(str, options, cb) {
  2349. return promisify(cb, function(cb) {
  2350. var engine = requires.htmling || (requires.htmling = require('htmling'));
  2351. try {
  2352. var tmpl = cache(options) || cache(options, engine.string(str));
  2353. cb(null, tmpl.render(options));
  2354. } catch (err) {
  2355. cb(err);
  2356. }
  2357. });
  2358. };
  2359. /**
  2360. * Rendering function
  2361. */
  2362. function requireReact(module, filename) {
  2363. var babel = requires.babel || (requires.babel = require('babel-core'));
  2364. var compiled = babel.transformFileSync(filename, { presets: [ 'react' ] }).code;
  2365. return module._compile(compiled, filename);
  2366. }
  2367. exports.requireReact = requireReact;
  2368. /**
  2369. * Converting a string into a node module.
  2370. */
  2371. function requireReactString(src, filename) {
  2372. var babel = requires.babel || (requires.babel = require('babel-core'));
  2373. if (!filename) filename = '';
  2374. var m = new module.constructor();
  2375. filename = filename || '';
  2376. // Compile Using React
  2377. var compiled = babel.transform(src, { presets: [ 'react' ] }).code;
  2378. // Compile as a module
  2379. m.paths = module.paths;
  2380. m._compile(compiled, filename);
  2381. return m.exports;
  2382. }
  2383. /**
  2384. * A naive helper to replace {{tags}} with options.tags content
  2385. */
  2386. function reactBaseTmpl(data, options) {
  2387. var exp;
  2388. var regex;
  2389. // Iterates through the keys in file object
  2390. // and interpolate / replace {{key}} with it's value
  2391. for (var k in options) {
  2392. if (options.hasOwnProperty(k)) {
  2393. exp = '{{' + k + '}}';
  2394. regex = new RegExp(exp, 'g');
  2395. if (data.match(regex)) {
  2396. data = data.replace(regex, options[k]);
  2397. }
  2398. }
  2399. }
  2400. return data;
  2401. }
  2402. /**
  2403. * Plates Support.
  2404. */
  2405. exports.plates = fromStringRenderer('plates');
  2406. /**
  2407. * Plates string support.
  2408. */
  2409. exports.plates.render = function(str, options, cb) {
  2410. return promisify(cb, function(cb) {
  2411. var engine = requires.plates || (requires.plates = require('plates'));
  2412. var map = options.map || undefined;
  2413. try {
  2414. var tmpl = engine.bind(str, options, map);
  2415. cb(null, tmpl);
  2416. } catch (err) {
  2417. cb(err);
  2418. }
  2419. });
  2420. };
  2421. /**
  2422. * The main render parser for React bsaed templates
  2423. */
  2424. function reactRenderer(type) {
  2425. if (commonjsRequire.extensions) {
  2426. // Ensure JSX is transformed on require
  2427. if (!commonjsRequire.extensions['.jsx']) {
  2428. commonjsRequire.extensions['.jsx'] = requireReact;
  2429. }
  2430. // Supporting .react extension as well as test cases
  2431. // Using .react extension is not recommended.
  2432. if (!commonjsRequire.extensions['.react']) {
  2433. commonjsRequire.extensions['.react'] = requireReact;
  2434. }
  2435. }
  2436. // Return rendering fx
  2437. return function(str, options, cb) {
  2438. return promisify(cb, function(cb) {
  2439. // React Import
  2440. var ReactDOM = requires.ReactDOM || (requires.ReactDOM = require('react-dom/server'));
  2441. var react = requires.react || (requires.react = require('react'));
  2442. // Assign HTML Base
  2443. var base = options.base;
  2444. delete options.base;
  2445. var enableCache = options.cache;
  2446. delete options.cache;
  2447. var isNonStatic = options.isNonStatic;
  2448. delete options.isNonStatic;
  2449. // Start Conversion
  2450. try {
  2451. var Code;
  2452. var Factory;
  2453. var baseStr;
  2454. var content;
  2455. var parsed;
  2456. if (!cache(options)) {
  2457. // Parsing
  2458. if (type === 'path') {
  2459. var path = resolve(str);
  2460. delete require.cache[path];
  2461. Code = commonjsRequire(path);
  2462. } else {
  2463. Code = requireReactString(str);
  2464. }
  2465. Factory = cache(options, react.createFactory(Code));
  2466. } else {
  2467. Factory = cache(options);
  2468. }
  2469. parsed = new Factory(options);
  2470. content = (isNonStatic) ? ReactDOM.renderToString(parsed) : ReactDOM.renderToStaticMarkup(parsed);
  2471. if (base) {
  2472. baseStr = readCache[str] || fs.readFileSync(resolve(base), 'utf8');
  2473. if (enableCache) {
  2474. readCache[str] = baseStr;
  2475. }
  2476. options.content = content;
  2477. content = reactBaseTmpl(baseStr, options);
  2478. }
  2479. cb(null, content);
  2480. } catch (err) {
  2481. cb(err);
  2482. }
  2483. });
  2484. };
  2485. }
  2486. /**
  2487. * React JS Support
  2488. */
  2489. exports.react = reactRenderer('path');
  2490. /**
  2491. * React JS string support.
  2492. */
  2493. exports.react.render = reactRenderer('string');
  2494. /**
  2495. * ARC-templates support.
  2496. */
  2497. exports['arc-templates'] = fromStringRenderer('arc-templates');
  2498. /**
  2499. * ARC-templates string support.
  2500. */
  2501. exports['arc-templates'].render = function(str, options, cb) {
  2502. var readFileWithOptions = util.promisify(read);
  2503. var consolidateFileSystem = {};
  2504. consolidateFileSystem.readFile = function(path) {
  2505. return readFileWithOptions(path, options);
  2506. };
  2507. return promisify(cb, function(cb) {
  2508. try {
  2509. var engine = requires['arc-templates'];
  2510. if (!engine) {
  2511. var Engine = require('arc-templates/dist/es5');
  2512. engine = requires['arc-templates'] = new Engine({ filesystem: consolidateFileSystem });
  2513. }
  2514. var compiler = cache(options) || cache(options, engine.compileString(str, options.filename));
  2515. compiler.then(function(func) { return func(options); })
  2516. .then(function(result) { cb(null, result.content); })
  2517. .catch(cb);
  2518. } catch (err) {
  2519. cb(err);
  2520. }
  2521. });
  2522. };
  2523. /**
  2524. * Vash support
  2525. */
  2526. exports.vash = fromStringRenderer('vash');
  2527. /**
  2528. * Vash string support
  2529. */
  2530. exports.vash.render = function(str, options, cb) {
  2531. return promisify(cb, function(cb) {
  2532. var engine = requires.vash || (requires.vash = require('vash'));
  2533. try {
  2534. // helper system : https://github.com/kirbysayshi/vash#helper-system
  2535. if (options.helpers) {
  2536. for (var key in options.helpers) {
  2537. if (!options.helpers.hasOwnProperty(key) || typeof options.helpers[key] !== 'function') {
  2538. continue;
  2539. }
  2540. engine.helpers[key] = options.helpers[key];
  2541. }
  2542. }
  2543. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  2544. tmpl(options, function sealLayout(err, ctx) {
  2545. if (err) cb(err);
  2546. ctx.finishLayout();
  2547. cb(null, ctx.toString().replace(/\n$/, ''));
  2548. });
  2549. } catch (err) {
  2550. cb(err);
  2551. }
  2552. });
  2553. };
  2554. /**
  2555. * Slm support.
  2556. */
  2557. exports.slm = fromStringRenderer('slm');
  2558. /**
  2559. * Slm string support.
  2560. */
  2561. exports.slm.render = function(str, options, cb) {
  2562. return promisify(cb, function(cb) {
  2563. var engine = requires.slm || (requires.slm = require('slm'));
  2564. try {
  2565. var tmpl = cache(options) || cache(options, engine.compile(str, options));
  2566. cb(null, tmpl(options));
  2567. } catch (err) {
  2568. cb(err);
  2569. }
  2570. });
  2571. };
  2572. /**
  2573. * Marko support.
  2574. */
  2575. exports.marko = function(path, options, cb) {
  2576. return promisify(cb, function(cb) {
  2577. var engine = requires.marko || (requires.marko = require('marko'));
  2578. options.writeToDisk = !!options.cache;
  2579. try {
  2580. var tmpl = cache(options) || cache(options, engine.load(path, options));
  2581. tmpl.renderToString(options, cb);
  2582. } catch (err) {
  2583. cb(err);
  2584. }
  2585. });
  2586. };
  2587. /**
  2588. * Marko string support.
  2589. */
  2590. exports.marko.render = function(str, options, cb) {
  2591. return promisify(cb, function(cb) {
  2592. var engine = requires.marko || (requires.marko = require('marko'));
  2593. options.writeToDisk = !!options.cache;
  2594. options.filename = options.filename || 'string.marko';
  2595. try {
  2596. var tmpl = cache(options) || cache(options, engine.load(options.filename, str, options));
  2597. tmpl.renderToString(options, cb);
  2598. } catch (err) {
  2599. cb(err);
  2600. }
  2601. });
  2602. };
  2603. /**
  2604. * Teacup support.
  2605. */
  2606. exports.teacup = function(path, options, cb) {
  2607. return promisify(cb, function(cb) {
  2608. var engine = requires.teacup || (requires.teacup = require('teacup/lib/express'));
  2609. commonjsRequire.extensions['.teacup'] = commonjsRequire.extensions['.coffee'];
  2610. if (path[0] !== '/') {
  2611. path = join(process.cwd(), path);
  2612. }
  2613. if (!options.cache) {
  2614. var callback = cb;
  2615. cb = function() {
  2616. delete require.cache[path];
  2617. callback.apply(this, arguments);
  2618. };
  2619. }
  2620. engine.renderFile(path, options, cb);
  2621. });
  2622. };
  2623. /**
  2624. * Teacup string support.
  2625. */
  2626. exports.teacup.render = function(str, options, cb) {
  2627. var coffee = require('coffee-script');
  2628. var vm = require('vm');
  2629. var sandbox = {
  2630. module: {exports: {}},
  2631. require: commonjsRequire
  2632. };
  2633. return promisify(cb, function(cb) {
  2634. vm.runInNewContext(coffee.compile(str), sandbox);
  2635. var tmpl = sandbox.module.exports;
  2636. cb(null, tmpl(options));
  2637. });
  2638. };
  2639. /**
  2640. * Squirrelly support.
  2641. */
  2642. exports.squirrelly = fromStringRenderer('squirrelly');
  2643. /**
  2644. * Squirrelly string support.
  2645. */
  2646. exports.squirrelly.render = function(str, options, cb) {
  2647. return promisify(cb, function(cb) {
  2648. var engine = requires.squirrelly || (requires.squirrelly = require('squirrelly'));
  2649. try {
  2650. for (var partial in options.partials) {
  2651. engine.definePartial(partial, options.partials[partial]);
  2652. }
  2653. for (var helper in options.helpers) {
  2654. engine.defineHelper(helper, options.helpers[helper]);
  2655. }
  2656. var tmpl = cache(options) || cache(options, engine.Compile(str, options));
  2657. cb(null, tmpl(options, engine));
  2658. } catch (err) {
  2659. cb(err);
  2660. }
  2661. });
  2662. };
  2663. /**
  2664. * Twing support.
  2665. */
  2666. exports.twing = fromStringRenderer('twing');
  2667. /**
  2668. * Twing string support.
  2669. */
  2670. exports.twing.render = function(str, options, cb) {
  2671. return promisify(cb, function(cb) {
  2672. var engine = requires.twing || (requires.twing = require('twing'));
  2673. try {
  2674. new engine.TwingEnvironment(new engine.TwingLoaderNull()).createTemplate(str).then((twingTemplate) => {
  2675. twingTemplate.render(options).then((rendTmpl) => {
  2676. var tmpl = cache(options) || cache(options, rendTmpl);
  2677. cb(null, tmpl);
  2678. });
  2679. });
  2680. } catch (err) {
  2681. cb(err);
  2682. }
  2683. });
  2684. };
  2685. /**
  2686. * expose the instance of the engine
  2687. */
  2688. exports.requires = requires;
  2689. } (consolidate$1, consolidate$1.exports));
  2690. (function (module) {
  2691. module.exports = consolidate$1.exports;
  2692. } (consolidate$2));
  2693. var consolidate = /*@__PURE__*/getDefaultExportFromCjs(consolidate$2.exports);
  2694. const hasWarned = {};
  2695. function warnOnce(msg) {
  2696. const isNodeProd = typeof process !== 'undefined' && process.env.NODE_ENV === 'production';
  2697. if (!isNodeProd && !false && !hasWarned[msg]) {
  2698. hasWarned[msg] = true;
  2699. warn(msg);
  2700. }
  2701. }
  2702. function warn(msg) {
  2703. console.warn(`\x1b[1m\x1b[33m[@vue/compiler-sfc]\x1b[0m\x1b[33m ${msg}\x1b[0m\n`);
  2704. }
  2705. function preprocess$1({ source, filename, preprocessOptions }, preprocessor) {
  2706. // Consolidate exposes a callback based API, but the callback is in fact
  2707. // called synchronously for most templating engines. In our case, we have to
  2708. // expose a synchronous API so that it is usable in Jest transforms (which
  2709. // have to be sync because they are applied via Node.js require hooks)
  2710. let res = '';
  2711. let err = null;
  2712. preprocessor.render(source, { filename, ...preprocessOptions }, (_err, _res) => {
  2713. if (_err)
  2714. err = _err;
  2715. res = _res;
  2716. });
  2717. if (err)
  2718. throw err;
  2719. return res;
  2720. }
  2721. function compileTemplate(options) {
  2722. const { preprocessLang, preprocessCustomRequire } = options;
  2723. const preprocessor = preprocessLang
  2724. ? preprocessCustomRequire
  2725. ? preprocessCustomRequire(preprocessLang)
  2726. : consolidate[preprocessLang]
  2727. : false;
  2728. if (preprocessor) {
  2729. try {
  2730. return doCompileTemplate({
  2731. ...options,
  2732. source: preprocess$1(options, preprocessor)
  2733. });
  2734. }
  2735. catch (e) {
  2736. return {
  2737. code: `export default function render() {}`,
  2738. source: options.source,
  2739. tips: [],
  2740. errors: [e]
  2741. };
  2742. }
  2743. }
  2744. else if (preprocessLang) {
  2745. return {
  2746. code: `export default function render() {}`,
  2747. source: options.source,
  2748. tips: [
  2749. `Component ${options.filename} uses lang ${preprocessLang} for template. Please install the language preprocessor.`
  2750. ],
  2751. errors: [
  2752. `Component ${options.filename} uses lang ${preprocessLang} for template, however it is not installed.`
  2753. ]
  2754. };
  2755. }
  2756. else {
  2757. return doCompileTemplate(options);
  2758. }
  2759. }
  2760. function doCompileTemplate({ filename, id, scoped, slotted, inMap, source, ssr = false, ssrCssVars, isProd = false, compiler = ssr ? CompilerSSR__namespace : CompilerDOM__namespace, compilerOptions = {}, transformAssetUrls }) {
  2761. const errors = [];
  2762. const warnings = [];
  2763. let nodeTransforms = [];
  2764. if (shared.isObject(transformAssetUrls)) {
  2765. const assetOptions = normalizeOptions(transformAssetUrls);
  2766. nodeTransforms = [
  2767. createAssetUrlTransformWithOptions(assetOptions),
  2768. createSrcsetTransformWithOptions(assetOptions)
  2769. ];
  2770. }
  2771. else if (transformAssetUrls !== false) {
  2772. nodeTransforms = [transformAssetUrl, transformSrcset];
  2773. }
  2774. if (ssr && !ssrCssVars) {
  2775. warnOnce(`compileTemplate is called with \`ssr: true\` but no ` +
  2776. `corresponding \`cssVars\` option.\`.`);
  2777. }
  2778. if (!id) {
  2779. warnOnce(`compileTemplate now requires the \`id\` option.\`.`);
  2780. id = '';
  2781. }
  2782. const shortId = id.replace(/^data-v-/, '');
  2783. const longId = `data-v-${shortId}`;
  2784. let { code, ast, preamble, map } = compiler.compile(source, {
  2785. mode: 'module',
  2786. prefixIdentifiers: true,
  2787. hoistStatic: true,
  2788. cacheHandlers: true,
  2789. ssrCssVars: ssr && ssrCssVars && ssrCssVars.length
  2790. ? genCssVarsFromList(ssrCssVars, shortId, isProd, true)
  2791. : '',
  2792. scopeId: scoped ? longId : undefined,
  2793. slotted,
  2794. sourceMap: true,
  2795. ...compilerOptions,
  2796. nodeTransforms: nodeTransforms.concat(compilerOptions.nodeTransforms || []),
  2797. filename,
  2798. onError: e => errors.push(e),
  2799. onWarn: w => warnings.push(w)
  2800. });
  2801. // inMap should be the map produced by ./parse.ts which is a simple line-only
  2802. // mapping. If it is present, we need to adjust the final map and errors to
  2803. // reflect the original line numbers.
  2804. if (inMap) {
  2805. if (map) {
  2806. map = mapLines(inMap, map);
  2807. }
  2808. if (errors.length) {
  2809. patchErrors(errors, source, inMap);
  2810. }
  2811. }
  2812. const tips = warnings.map(w => {
  2813. let msg = w.message;
  2814. if (w.loc) {
  2815. msg += `\n${shared.generateCodeFrame(source, w.loc.start.offset, w.loc.end.offset)}`;
  2816. }
  2817. return msg;
  2818. });
  2819. return { code, ast, preamble, source, errors, tips, map };
  2820. }
  2821. function mapLines(oldMap, newMap) {
  2822. if (!oldMap)
  2823. return newMap;
  2824. if (!newMap)
  2825. return oldMap;
  2826. const oldMapConsumer = new require$$0$2.SourceMapConsumer(oldMap);
  2827. const newMapConsumer = new require$$0$2.SourceMapConsumer(newMap);
  2828. const mergedMapGenerator = new require$$0$2.SourceMapGenerator();
  2829. newMapConsumer.eachMapping(m => {
  2830. if (m.originalLine == null) {
  2831. return;
  2832. }
  2833. const origPosInOldMap = oldMapConsumer.originalPositionFor({
  2834. line: m.originalLine,
  2835. column: m.originalColumn
  2836. });
  2837. if (origPosInOldMap.source == null) {
  2838. return;
  2839. }
  2840. mergedMapGenerator.addMapping({
  2841. generated: {
  2842. line: m.generatedLine,
  2843. column: m.generatedColumn
  2844. },
  2845. original: {
  2846. line: origPosInOldMap.line,
  2847. // use current column, since the oldMap produced by @vue/compiler-sfc
  2848. // does not
  2849. column: m.originalColumn
  2850. },
  2851. source: origPosInOldMap.source,
  2852. name: origPosInOldMap.name
  2853. });
  2854. });
  2855. // source-map's type definition is incomplete
  2856. const generator = mergedMapGenerator;
  2857. oldMapConsumer.sources.forEach((sourceFile) => {
  2858. generator._sources.add(sourceFile);
  2859. const sourceContent = oldMapConsumer.sourceContentFor(sourceFile);
  2860. if (sourceContent != null) {
  2861. mergedMapGenerator.setSourceContent(sourceFile, sourceContent);
  2862. }
  2863. });
  2864. generator._sourceRoot = oldMap.sourceRoot;
  2865. generator._file = oldMap.file;
  2866. return generator.toJSON();
  2867. }
  2868. function patchErrors(errors, source, inMap) {
  2869. const originalSource = inMap.sourcesContent[0];
  2870. const offset = originalSource.indexOf(source);
  2871. const lineOffset = originalSource.slice(0, offset).split(/\r?\n/).length - 1;
  2872. errors.forEach(err => {
  2873. if (err.loc) {
  2874. err.loc.start.line += lineOffset;
  2875. err.loc.start.offset += offset;
  2876. if (err.loc.end !== err.loc.start) {
  2877. err.loc.end.line += lineOffset;
  2878. err.loc.end.offset += offset;
  2879. }
  2880. }
  2881. });
  2882. }
  2883. const defaultExportRE = /((?:^|\n|;)\s*)export(\s*)default/;
  2884. const namedDefaultExportRE = /((?:^|\n|;)\s*)export(.+)(?:as)?(\s*)default/s;
  2885. const exportDefaultClassRE = /((?:^|\n|;)\s*)export\s+default\s+class\s+([\w$]+)/;
  2886. /**
  2887. * Utility for rewriting `export default` in a script block into a variable
  2888. * declaration so that we can inject things into it
  2889. */
  2890. function rewriteDefault(input, as, parserPlugins) {
  2891. if (!hasDefaultExport(input)) {
  2892. return input + `\nconst ${as} = {}`;
  2893. }
  2894. let replaced;
  2895. const classMatch = input.match(exportDefaultClassRE);
  2896. if (classMatch) {
  2897. replaced =
  2898. input.replace(exportDefaultClassRE, '$1class $2') +
  2899. `\nconst ${as} = ${classMatch[2]}`;
  2900. }
  2901. else {
  2902. replaced = input.replace(defaultExportRE, `$1const ${as} =`);
  2903. }
  2904. if (!hasDefaultExport(replaced)) {
  2905. return replaced;
  2906. }
  2907. // if the script somehow still contains `default export`, it probably has
  2908. // multi-line comments or template strings. fallback to a full parse.
  2909. const s = new MagicString(input);
  2910. const ast = parser$2.parse(input, {
  2911. sourceType: 'module',
  2912. plugins: parserPlugins
  2913. }).program.body;
  2914. ast.forEach(node => {
  2915. if (node.type === 'ExportDefaultDeclaration') {
  2916. if (node.declaration.type === 'ClassDeclaration') {
  2917. s.overwrite(node.start, node.declaration.id.start, `class `);
  2918. s.append(`\nconst ${as} = ${node.declaration.id.name}`);
  2919. }
  2920. else {
  2921. s.overwrite(node.start, node.declaration.start, `const ${as} = `);
  2922. }
  2923. }
  2924. if (node.type === 'ExportNamedDeclaration') {
  2925. for (const specifier of node.specifiers) {
  2926. if (specifier.type === 'ExportSpecifier' &&
  2927. specifier.exported.type === 'Identifier' &&
  2928. specifier.exported.name === 'default') {
  2929. if (node.source) {
  2930. if (specifier.local.name === 'default') {
  2931. const end = specifierEnd(input, specifier.local.end, node.end);
  2932. s.prepend(`import { default as __VUE_DEFAULT__ } from '${node.source.value}'\n`);
  2933. s.overwrite(specifier.start, end, ``);
  2934. s.append(`\nconst ${as} = __VUE_DEFAULT__`);
  2935. continue;
  2936. }
  2937. else {
  2938. const end = specifierEnd(input, specifier.exported.end, node.end);
  2939. s.prepend(`import { ${input.slice(specifier.local.start, specifier.local.end)} } from '${node.source.value}'\n`);
  2940. s.overwrite(specifier.start, end, ``);
  2941. s.append(`\nconst ${as} = ${specifier.local.name}`);
  2942. continue;
  2943. }
  2944. }
  2945. const end = specifierEnd(input, specifier.end, node.end);
  2946. s.overwrite(specifier.start, end, ``);
  2947. s.append(`\nconst ${as} = ${specifier.local.name}`);
  2948. }
  2949. }
  2950. }
  2951. });
  2952. return s.toString();
  2953. }
  2954. function hasDefaultExport(input) {
  2955. return defaultExportRE.test(input) || namedDefaultExportRE.test(input);
  2956. }
  2957. function specifierEnd(input, end, nodeEnd) {
  2958. // export { default , foo } ...
  2959. let hasCommas = false;
  2960. let oldEnd = end;
  2961. while (end < nodeEnd) {
  2962. if (/\s/.test(input.charAt(end))) {
  2963. end++;
  2964. }
  2965. else if (input.charAt(end) === ',') {
  2966. end++;
  2967. hasCommas = true;
  2968. break;
  2969. }
  2970. else if (input.charAt(end) === '}') {
  2971. break;
  2972. }
  2973. }
  2974. return hasCommas ? end : oldEnd;
  2975. }
  2976. // Special compiler macros
  2977. const DEFINE_PROPS = 'defineProps';
  2978. const DEFINE_EMITS = 'defineEmits';
  2979. const DEFINE_EXPOSE = 'defineExpose';
  2980. const WITH_DEFAULTS = 'withDefaults';
  2981. // constants
  2982. const DEFAULT_VAR = `__default__`;
  2983. const isBuiltInDir = shared.makeMap(`once,memo,if,for,else,else-if,slot,text,html,on,bind,model,show,cloak,is`);
  2984. /**
  2985. * Compile `<script setup>`
  2986. * It requires the whole SFC descriptor because we need to handle and merge
  2987. * normal `<script>` + `<script setup>` if both are present.
  2988. */
  2989. function compileScript(sfc, options) {
  2990. var _a;
  2991. let { script, scriptSetup, source, filename } = sfc;
  2992. // feature flags
  2993. // TODO remove support for deprecated options when out of experimental
  2994. const enableReactivityTransform = !!options.reactivityTransform ||
  2995. !!options.refSugar ||
  2996. !!options.refTransform;
  2997. const enablePropsTransform = !!options.reactivityTransform || !!options.propsDestructureTransform;
  2998. const isProd = !!options.isProd;
  2999. const genSourceMap = options.sourceMap !== false;
  3000. let refBindings;
  3001. if (!options.id) {
  3002. warnOnce(`compileScript now requires passing the \`id\` option.\n` +
  3003. `Upgrade your vite or vue-loader version for compatibility with ` +
  3004. `the latest experimental proposals.`);
  3005. }
  3006. const scopeId = options.id ? options.id.replace(/^data-v-/, '') : '';
  3007. const cssVars = sfc.cssVars;
  3008. const scriptLang = script && script.lang;
  3009. const scriptSetupLang = scriptSetup && scriptSetup.lang;
  3010. const isTS = scriptLang === 'ts' ||
  3011. scriptLang === 'tsx' ||
  3012. scriptSetupLang === 'ts' ||
  3013. scriptSetupLang === 'tsx';
  3014. // resolve parser plugins
  3015. const plugins = [];
  3016. if (!isTS || scriptLang === 'tsx' || scriptSetupLang === 'tsx') {
  3017. plugins.push('jsx');
  3018. }
  3019. else {
  3020. // If don't match the case of adding jsx, should remove the jsx from the babelParserPlugins
  3021. if (options.babelParserPlugins)
  3022. options.babelParserPlugins = options.babelParserPlugins.filter(n => n !== 'jsx');
  3023. }
  3024. if (options.babelParserPlugins)
  3025. plugins.push(...options.babelParserPlugins);
  3026. if (isTS) {
  3027. plugins.push('typescript');
  3028. if (!plugins.includes('decorators')) {
  3029. plugins.push('decorators-legacy');
  3030. }
  3031. }
  3032. if (!scriptSetup) {
  3033. if (!script) {
  3034. throw new Error(`[@vue/compiler-sfc] SFC contains no <script> tags.`);
  3035. }
  3036. if (scriptLang && !isTS && scriptLang !== 'jsx') {
  3037. // do not process non js/ts script blocks
  3038. return script;
  3039. }
  3040. try {
  3041. let content = script.content;
  3042. let map = script.map;
  3043. const scriptAst = parser$2.parse(content, {
  3044. plugins,
  3045. sourceType: 'module'
  3046. }).program;
  3047. const bindings = analyzeScriptBindings(scriptAst.body);
  3048. if (enableReactivityTransform && reactivityTransform.shouldTransform(content)) {
  3049. const s = new MagicString(source);
  3050. const startOffset = script.loc.start.offset;
  3051. const endOffset = script.loc.end.offset;
  3052. const { importedHelpers } = reactivityTransform.transformAST(scriptAst, s, startOffset);
  3053. if (importedHelpers.length) {
  3054. s.prepend(`import { ${importedHelpers
  3055. .map(h => `${h} as _${h}`)
  3056. .join(', ')} } from 'vue'\n`);
  3057. }
  3058. s.remove(0, startOffset);
  3059. s.remove(endOffset, source.length);
  3060. content = s.toString();
  3061. if (genSourceMap) {
  3062. map = s.generateMap({
  3063. source: filename,
  3064. hires: true,
  3065. includeContent: true
  3066. });
  3067. }
  3068. }
  3069. if (cssVars.length) {
  3070. content = rewriteDefault(content, DEFAULT_VAR, plugins);
  3071. content += genNormalScriptCssVarsCode(cssVars, bindings, scopeId, isProd);
  3072. content += `\nexport default ${DEFAULT_VAR}`;
  3073. }
  3074. return {
  3075. ...script,
  3076. content,
  3077. map,
  3078. bindings,
  3079. scriptAst: scriptAst.body
  3080. };
  3081. }
  3082. catch (e) {
  3083. // silently fallback if parse fails since user may be using custom
  3084. // babel syntax
  3085. return script;
  3086. }
  3087. }
  3088. if (script && scriptLang !== scriptSetupLang) {
  3089. throw new Error(`[@vue/compiler-sfc] <script> and <script setup> must have the same ` +
  3090. `language type.`);
  3091. }
  3092. if (scriptSetupLang && !isTS && scriptSetupLang !== 'jsx') {
  3093. // do not process non js/ts script blocks
  3094. return scriptSetup;
  3095. }
  3096. // metadata that needs to be returned
  3097. const bindingMetadata = {};
  3098. const helperImports = new Set();
  3099. const userImports = Object.create(null);
  3100. const scriptBindings = Object.create(null);
  3101. const setupBindings = Object.create(null);
  3102. let defaultExport;
  3103. let hasDefinePropsCall = false;
  3104. let hasDefineEmitCall = false;
  3105. let hasDefineExposeCall = false;
  3106. let hasDefaultExportName = false;
  3107. let hasDefaultExportRender = false;
  3108. let propsRuntimeDecl;
  3109. let propsRuntimeDefaults;
  3110. let propsDestructureDecl;
  3111. let propsDestructureRestId;
  3112. let propsTypeDecl;
  3113. let propsTypeDeclRaw;
  3114. let propsIdentifier;
  3115. let emitsRuntimeDecl;
  3116. let emitsTypeDecl;
  3117. let emitsTypeDeclRaw;
  3118. let emitIdentifier;
  3119. let hasAwait = false;
  3120. let hasInlinedSsrRenderFn = false;
  3121. // props/emits declared via types
  3122. const typeDeclaredProps = {};
  3123. const typeDeclaredEmits = new Set();
  3124. // record declared types for runtime props type generation
  3125. const declaredTypes = {};
  3126. // props destructure data
  3127. const propsDestructuredBindings = Object.create(null);
  3128. // magic-string state
  3129. const s = new MagicString(source);
  3130. const startOffset = scriptSetup.loc.start.offset;
  3131. const endOffset = scriptSetup.loc.end.offset;
  3132. const scriptStartOffset = script && script.loc.start.offset;
  3133. const scriptEndOffset = script && script.loc.end.offset;
  3134. function helper(key) {
  3135. helperImports.add(key);
  3136. return `_${key}`;
  3137. }
  3138. function parse(input, options, offset) {
  3139. try {
  3140. return parser$2.parse(input, options).program;
  3141. }
  3142. catch (e) {
  3143. e.message = `[@vue/compiler-sfc] ${e.message}\n\n${sfc.filename}\n${shared.generateCodeFrame(source, e.pos + offset, e.pos + offset + 1)}`;
  3144. throw e;
  3145. }
  3146. }
  3147. function error(msg, node, end = node.end + startOffset) {
  3148. throw new Error(`[@vue/compiler-sfc] ${msg}\n\n${sfc.filename}\n${shared.generateCodeFrame(source, node.start + startOffset, end)}`);
  3149. }
  3150. function hoistNode(node) {
  3151. const start = node.start + startOffset;
  3152. let end = node.end + startOffset;
  3153. // locate comment
  3154. if (node.trailingComments && node.trailingComments.length > 0) {
  3155. const lastCommentNode = node.trailingComments[node.trailingComments.length - 1];
  3156. end = lastCommentNode.end + startOffset;
  3157. }
  3158. // locate the end of whitespace between this statement and the next
  3159. while (end <= source.length) {
  3160. if (!/\s/.test(source.charAt(end))) {
  3161. break;
  3162. }
  3163. end++;
  3164. }
  3165. s.move(start, end, 0);
  3166. }
  3167. function registerUserImport(source, local, imported, isType, isFromSetup, needTemplateUsageCheck) {
  3168. // template usage check is only needed in non-inline mode, so we can skip
  3169. // the work if inlineTemplate is true.
  3170. let isUsedInTemplate = needTemplateUsageCheck;
  3171. if (needTemplateUsageCheck &&
  3172. isTS &&
  3173. sfc.template &&
  3174. !sfc.template.src &&
  3175. !sfc.template.lang) {
  3176. isUsedInTemplate = isImportUsed(local, sfc);
  3177. }
  3178. userImports[local] = {
  3179. isType,
  3180. imported: imported || 'default',
  3181. local,
  3182. source,
  3183. isFromSetup,
  3184. isUsedInTemplate
  3185. };
  3186. }
  3187. function processDefineProps(node, declId, declKind) {
  3188. if (!isCallOf(node, DEFINE_PROPS)) {
  3189. return false;
  3190. }
  3191. if (hasDefinePropsCall) {
  3192. error(`duplicate ${DEFINE_PROPS}() call`, node);
  3193. }
  3194. hasDefinePropsCall = true;
  3195. propsRuntimeDecl = node.arguments[0];
  3196. // call has type parameters - infer runtime types from it
  3197. if (node.typeParameters) {
  3198. if (propsRuntimeDecl) {
  3199. error(`${DEFINE_PROPS}() cannot accept both type and non-type arguments ` +
  3200. `at the same time. Use one or the other.`, node);
  3201. }
  3202. propsTypeDeclRaw = node.typeParameters.params[0];
  3203. propsTypeDecl = resolveQualifiedType(propsTypeDeclRaw, node => node.type === 'TSTypeLiteral');
  3204. if (!propsTypeDecl) {
  3205. error(`type argument passed to ${DEFINE_PROPS}() must be a literal type, ` +
  3206. `or a reference to an interface or literal type.`, propsTypeDeclRaw);
  3207. }
  3208. }
  3209. if (declId) {
  3210. const isConst = declKind === 'const';
  3211. if (enablePropsTransform && declId.type === 'ObjectPattern') {
  3212. propsDestructureDecl = declId;
  3213. // props destructure - handle compilation sugar
  3214. for (const prop of declId.properties) {
  3215. if (prop.type === 'ObjectProperty') {
  3216. const propKey = resolveObjectKey(prop.key, prop.computed);
  3217. if (!propKey) {
  3218. error(`${DEFINE_PROPS}() destructure cannot use computed key.`, prop.key);
  3219. }
  3220. if (prop.value.type === 'AssignmentPattern') {
  3221. // default value { foo = 123 }
  3222. const { left, right } = prop.value;
  3223. if (left.type !== 'Identifier') {
  3224. error(`${DEFINE_PROPS}() destructure does not support nested patterns.`, left);
  3225. }
  3226. // store default value
  3227. propsDestructuredBindings[propKey] = {
  3228. local: left.name,
  3229. default: right,
  3230. isConst
  3231. };
  3232. }
  3233. else if (prop.value.type === 'Identifier') {
  3234. // simple destructure
  3235. propsDestructuredBindings[propKey] = {
  3236. local: prop.value.name,
  3237. isConst
  3238. };
  3239. }
  3240. else {
  3241. error(`${DEFINE_PROPS}() destructure does not support nested patterns.`, prop.value);
  3242. }
  3243. }
  3244. else {
  3245. // rest spread
  3246. propsDestructureRestId = prop.argument.name;
  3247. }
  3248. }
  3249. }
  3250. else {
  3251. propsIdentifier = scriptSetup.content.slice(declId.start, declId.end);
  3252. }
  3253. }
  3254. return true;
  3255. }
  3256. function processWithDefaults(node, declId, declKind) {
  3257. if (!isCallOf(node, WITH_DEFAULTS)) {
  3258. return false;
  3259. }
  3260. if (processDefineProps(node.arguments[0], declId, declKind)) {
  3261. if (propsRuntimeDecl) {
  3262. error(`${WITH_DEFAULTS} can only be used with type-based ` +
  3263. `${DEFINE_PROPS} declaration.`, node);
  3264. }
  3265. if (propsDestructureDecl) {
  3266. error(`${WITH_DEFAULTS}() is unnecessary when using destructure with ${DEFINE_PROPS}().\n` +
  3267. `Prefer using destructure default values, e.g. const { foo = 1 } = defineProps(...).`, node.callee);
  3268. }
  3269. propsRuntimeDefaults = node.arguments[1];
  3270. if (!propsRuntimeDefaults ||
  3271. propsRuntimeDefaults.type !== 'ObjectExpression') {
  3272. error(`The 2nd argument of ${WITH_DEFAULTS} must be an object literal.`, propsRuntimeDefaults || node);
  3273. }
  3274. }
  3275. else {
  3276. error(`${WITH_DEFAULTS}' first argument must be a ${DEFINE_PROPS} call.`, node.arguments[0] || node);
  3277. }
  3278. return true;
  3279. }
  3280. function processDefineEmits(node, declId) {
  3281. if (!isCallOf(node, DEFINE_EMITS)) {
  3282. return false;
  3283. }
  3284. if (hasDefineEmitCall) {
  3285. error(`duplicate ${DEFINE_EMITS}() call`, node);
  3286. }
  3287. hasDefineEmitCall = true;
  3288. emitsRuntimeDecl = node.arguments[0];
  3289. if (node.typeParameters) {
  3290. if (emitsRuntimeDecl) {
  3291. error(`${DEFINE_EMITS}() cannot accept both type and non-type arguments ` +
  3292. `at the same time. Use one or the other.`, node);
  3293. }
  3294. emitsTypeDeclRaw = node.typeParameters.params[0];
  3295. emitsTypeDecl = resolveQualifiedType(emitsTypeDeclRaw, node => node.type === 'TSFunctionType' || node.type === 'TSTypeLiteral');
  3296. if (!emitsTypeDecl) {
  3297. error(`type argument passed to ${DEFINE_EMITS}() must be a function type, ` +
  3298. `a literal type with call signatures, or a reference to the above types.`, emitsTypeDeclRaw);
  3299. }
  3300. }
  3301. if (declId) {
  3302. emitIdentifier =
  3303. declId.type === 'Identifier'
  3304. ? declId.name
  3305. : scriptSetup.content.slice(declId.start, declId.end);
  3306. }
  3307. return true;
  3308. }
  3309. function getAstBody() {
  3310. return scriptAst
  3311. ? [...scriptSetupAst.body, ...scriptAst.body]
  3312. : scriptSetupAst.body;
  3313. }
  3314. function resolveExtendsType(node, qualifier, cache = []) {
  3315. if (node.type === 'TSInterfaceDeclaration' && node.extends) {
  3316. node.extends.forEach(extend => {
  3317. if (extend.type === 'TSExpressionWithTypeArguments' &&
  3318. extend.expression.type === 'Identifier') {
  3319. const body = getAstBody();
  3320. for (const node of body) {
  3321. const qualified = isQualifiedType(node, qualifier, extend.expression.name);
  3322. if (qualified) {
  3323. cache.push(qualified);
  3324. resolveExtendsType(node, qualifier, cache);
  3325. return cache;
  3326. }
  3327. }
  3328. }
  3329. });
  3330. }
  3331. return cache;
  3332. }
  3333. function isQualifiedType(node, qualifier, refName) {
  3334. if (node.type === 'TSInterfaceDeclaration' && node.id.name === refName) {
  3335. return node.body;
  3336. }
  3337. else if (node.type === 'TSTypeAliasDeclaration' &&
  3338. node.id.name === refName &&
  3339. qualifier(node.typeAnnotation)) {
  3340. return node.typeAnnotation;
  3341. }
  3342. else if (node.type === 'ExportNamedDeclaration' && node.declaration) {
  3343. return isQualifiedType(node.declaration, qualifier, refName);
  3344. }
  3345. }
  3346. // filter all extends types to keep the override declaration
  3347. function filterExtendsType(extendsTypes, bodies) {
  3348. extendsTypes.forEach(extend => {
  3349. const body = extend.body;
  3350. body.forEach(newBody => {
  3351. if (newBody.type === 'TSPropertySignature' &&
  3352. newBody.key.type === 'Identifier') {
  3353. const name = newBody.key.name;
  3354. const hasOverride = bodies.some(seenBody => seenBody.type === 'TSPropertySignature' &&
  3355. seenBody.key.type === 'Identifier' &&
  3356. seenBody.key.name === name);
  3357. if (!hasOverride)
  3358. bodies.push(newBody);
  3359. }
  3360. });
  3361. });
  3362. }
  3363. function resolveQualifiedType(node, qualifier) {
  3364. if (qualifier(node)) {
  3365. return node;
  3366. }
  3367. if (node.type === 'TSTypeReference' &&
  3368. node.typeName.type === 'Identifier') {
  3369. const refName = node.typeName.name;
  3370. const body = getAstBody();
  3371. for (let i = 0; i < body.length; i++) {
  3372. const node = body[i];
  3373. let qualified = isQualifiedType(node, qualifier, refName);
  3374. if (qualified) {
  3375. const extendsTypes = resolveExtendsType(node, qualifier);
  3376. if (extendsTypes.length) {
  3377. const bodies = [...qualified.body];
  3378. filterExtendsType(extendsTypes, bodies);
  3379. qualified.body = bodies;
  3380. }
  3381. qualified.__fromNormalScript =
  3382. scriptAst && i >= scriptSetupAst.body.length;
  3383. return qualified;
  3384. }
  3385. }
  3386. }
  3387. }
  3388. function processDefineExpose(node) {
  3389. if (isCallOf(node, DEFINE_EXPOSE)) {
  3390. if (hasDefineExposeCall) {
  3391. error(`duplicate ${DEFINE_EXPOSE}() call`, node);
  3392. }
  3393. hasDefineExposeCall = true;
  3394. return true;
  3395. }
  3396. return false;
  3397. }
  3398. function checkInvalidScopeReference(node, method) {
  3399. if (!node)
  3400. return;
  3401. CompilerDOM.walkIdentifiers(node, id => {
  3402. if (setupBindings[id.name]) {
  3403. error(`\`${method}()\` in <script setup> cannot reference locally ` +
  3404. `declared variables because it will be hoisted outside of the ` +
  3405. `setup() function. If your component options require initialization ` +
  3406. `in the module scope, use a separate normal <script> to export ` +
  3407. `the options instead.`, id);
  3408. }
  3409. });
  3410. }
  3411. /**
  3412. * await foo()
  3413. * -->
  3414. * ;(
  3415. * ([__temp,__restore] = withAsyncContext(() => foo())),
  3416. * await __temp,
  3417. * __restore()
  3418. * )
  3419. *
  3420. * const a = await foo()
  3421. * -->
  3422. * const a = (
  3423. * ([__temp, __restore] = withAsyncContext(() => foo())),
  3424. * __temp = await __temp,
  3425. * __restore(),
  3426. * __temp
  3427. * )
  3428. */
  3429. function processAwait(node, needSemi, isStatement) {
  3430. const argumentStart = node.argument.extra && node.argument.extra.parenthesized
  3431. ? node.argument.extra.parenStart
  3432. : node.argument.start;
  3433. const argumentStr = source.slice(argumentStart + startOffset, node.argument.end + startOffset);
  3434. const containsNestedAwait = /\bawait\b/.test(argumentStr);
  3435. s.overwrite(node.start + startOffset, argumentStart + startOffset, `${needSemi ? `;` : ``}(\n ([__temp,__restore] = ${helper(`withAsyncContext`)}(${containsNestedAwait ? `async ` : ``}() => `);
  3436. s.appendLeft(node.end + startOffset, `)),\n ${isStatement ? `` : `__temp = `}await __temp,\n __restore()${isStatement ? `` : `,\n __temp`}\n)`);
  3437. }
  3438. /**
  3439. * check defaults. If the default object is an object literal with only
  3440. * static properties, we can directly generate more optimized default
  3441. * declarations. Otherwise we will have to fallback to runtime merging.
  3442. */
  3443. function hasStaticWithDefaults() {
  3444. return (propsRuntimeDefaults &&
  3445. propsRuntimeDefaults.type === 'ObjectExpression' &&
  3446. propsRuntimeDefaults.properties.every(node => (node.type === 'ObjectProperty' &&
  3447. (!node.computed || node.key.type.endsWith('Literal'))) ||
  3448. node.type === 'ObjectMethod'));
  3449. }
  3450. function genRuntimeProps(props) {
  3451. const keys = Object.keys(props);
  3452. if (!keys.length) {
  3453. return ``;
  3454. }
  3455. const hasStaticDefaults = hasStaticWithDefaults();
  3456. const scriptSetupSource = scriptSetup.content;
  3457. let propsDecls = `{
  3458. ${keys
  3459. .map(key => {
  3460. let defaultString;
  3461. const destructured = genDestructuredDefaultValue(key);
  3462. if (destructured) {
  3463. defaultString = `default: ${destructured}`;
  3464. }
  3465. else if (hasStaticDefaults) {
  3466. const prop = propsRuntimeDefaults.properties.find(node => {
  3467. if (node.type === 'SpreadElement')
  3468. return false;
  3469. return resolveObjectKey(node.key, node.computed) === key;
  3470. });
  3471. if (prop) {
  3472. if (prop.type === 'ObjectProperty') {
  3473. // prop has corresponding static default value
  3474. defaultString = `default: ${scriptSetupSource.slice(prop.value.start, prop.value.end)}`;
  3475. }
  3476. else {
  3477. defaultString = `${prop.async ? 'async ' : ''}${prop.kind !== 'method' ? `${prop.kind} ` : ''}default() ${scriptSetupSource.slice(prop.body.start, prop.body.end)}`;
  3478. }
  3479. }
  3480. }
  3481. const { type, required } = props[key];
  3482. if (!isProd) {
  3483. return `${key}: { type: ${toRuntimeTypeString(type)}, required: ${required}${defaultString ? `, ${defaultString}` : ``} }`;
  3484. }
  3485. else if (type.some(el => el === 'Boolean' ||
  3486. ((!hasStaticDefaults || defaultString) && el === 'Function'))) {
  3487. // #4783 for boolean, should keep the type
  3488. // #7111 for function, if default value exists or it's not static, should keep it
  3489. // in production
  3490. return `${key}: { type: ${toRuntimeTypeString(type)}${defaultString ? `, ${defaultString}` : ``} }`;
  3491. }
  3492. else {
  3493. // production: checks are useless
  3494. return `${key}: ${defaultString ? `{ ${defaultString} }` : 'null'}`;
  3495. }
  3496. })
  3497. .join(',\n ')}\n }`;
  3498. if (propsRuntimeDefaults && !hasStaticDefaults) {
  3499. propsDecls = `${helper('mergeDefaults')}(${propsDecls}, ${source.slice(propsRuntimeDefaults.start + startOffset, propsRuntimeDefaults.end + startOffset)})`;
  3500. }
  3501. return `\n props: ${propsDecls},`;
  3502. }
  3503. function genDestructuredDefaultValue(key) {
  3504. const destructured = propsDestructuredBindings[key];
  3505. if (destructured && destructured.default) {
  3506. const value = scriptSetup.content.slice(destructured.default.start, destructured.default.end);
  3507. const isLiteral = destructured.default.type.endsWith('Literal');
  3508. return isLiteral ? value : `() => (${value})`;
  3509. }
  3510. }
  3511. function genSetupPropsType(node) {
  3512. const scriptSource = node.__fromNormalScript
  3513. ? script.content
  3514. : scriptSetup.content;
  3515. if (hasStaticWithDefaults()) {
  3516. // if withDefaults() is used, we need to remove the optional flags
  3517. // on props that have default values
  3518. let res = `{ `;
  3519. const members = node.type === 'TSTypeLiteral' ? node.members : node.body;
  3520. for (const m of members) {
  3521. if ((m.type === 'TSPropertySignature' ||
  3522. m.type === 'TSMethodSignature') &&
  3523. m.typeAnnotation &&
  3524. m.key.type === 'Identifier') {
  3525. if (propsRuntimeDefaults.properties.some(p => {
  3526. if (p.type === 'SpreadElement')
  3527. return false;
  3528. return (resolveObjectKey(p.key, p.computed) ===
  3529. m.key.name);
  3530. })) {
  3531. res +=
  3532. m.key.name +
  3533. (m.type === 'TSMethodSignature' ? '()' : '') +
  3534. scriptSource.slice(m.typeAnnotation.start, m.typeAnnotation.end) +
  3535. ', ';
  3536. }
  3537. else {
  3538. res += scriptSource.slice(m.start, m.typeAnnotation.end) + `, `;
  3539. }
  3540. }
  3541. }
  3542. return (res.length ? res.slice(0, -2) : res) + ` }`;
  3543. }
  3544. else {
  3545. return scriptSource.slice(node.start, node.end);
  3546. }
  3547. }
  3548. // 0. parse both <script> and <script setup> blocks
  3549. const scriptAst = script &&
  3550. parse(script.content, {
  3551. plugins,
  3552. sourceType: 'module'
  3553. }, scriptStartOffset);
  3554. const scriptSetupAst = parse(scriptSetup.content, {
  3555. plugins: [
  3556. ...plugins,
  3557. // allow top level await but only inside <script setup>
  3558. 'topLevelAwait'
  3559. ],
  3560. sourceType: 'module'
  3561. }, startOffset);
  3562. // 1.1 walk import delcarations of <script>
  3563. if (scriptAst) {
  3564. for (const node of scriptAst.body) {
  3565. if (node.type === 'ImportDeclaration') {
  3566. // record imports for dedupe
  3567. for (const specifier of node.specifiers) {
  3568. const imported = specifier.type === 'ImportSpecifier' &&
  3569. specifier.imported.type === 'Identifier' &&
  3570. specifier.imported.name;
  3571. registerUserImport(node.source.value, specifier.local.name, imported, node.importKind === 'type' ||
  3572. (specifier.type === 'ImportSpecifier' &&
  3573. specifier.importKind === 'type'), false, !options.inlineTemplate);
  3574. }
  3575. }
  3576. }
  3577. }
  3578. // 1.2 walk import declarations of <script setup>
  3579. for (const node of scriptSetupAst.body) {
  3580. if (node.type === 'ImportDeclaration') {
  3581. // import declarations are moved to top
  3582. hoistNode(node);
  3583. // dedupe imports
  3584. let removed = 0;
  3585. const removeSpecifier = (i) => {
  3586. const removeLeft = i > removed;
  3587. removed++;
  3588. const current = node.specifiers[i];
  3589. const next = node.specifiers[i + 1];
  3590. s.remove(removeLeft
  3591. ? node.specifiers[i - 1].end + startOffset
  3592. : current.start + startOffset, next && !removeLeft
  3593. ? next.start + startOffset
  3594. : current.end + startOffset);
  3595. };
  3596. for (let i = 0; i < node.specifiers.length; i++) {
  3597. const specifier = node.specifiers[i];
  3598. const local = specifier.local.name;
  3599. let imported = specifier.type === 'ImportSpecifier' &&
  3600. specifier.imported.type === 'Identifier' &&
  3601. specifier.imported.name;
  3602. if (specifier.type === 'ImportNamespaceSpecifier') {
  3603. imported = '*';
  3604. }
  3605. const source = node.source.value;
  3606. const existing = userImports[local];
  3607. if (source === 'vue' &&
  3608. (imported === DEFINE_PROPS ||
  3609. imported === DEFINE_EMITS ||
  3610. imported === DEFINE_EXPOSE)) {
  3611. warnOnce(`\`${imported}\` is a compiler macro and no longer needs to be imported.`);
  3612. removeSpecifier(i);
  3613. }
  3614. else if (existing) {
  3615. if (existing.source === source && existing.imported === imported) {
  3616. // already imported in <script setup>, dedupe
  3617. removeSpecifier(i);
  3618. }
  3619. else {
  3620. error(`different imports aliased to same local name.`, specifier);
  3621. }
  3622. }
  3623. else {
  3624. registerUserImport(source, local, imported, node.importKind === 'type' ||
  3625. (specifier.type === 'ImportSpecifier' &&
  3626. specifier.importKind === 'type'), true, !options.inlineTemplate);
  3627. }
  3628. }
  3629. if (node.specifiers.length && removed === node.specifiers.length) {
  3630. s.remove(node.start + startOffset, node.end + startOffset);
  3631. }
  3632. }
  3633. }
  3634. // 1.3 resolve possible user import alias of `ref` and `reactive`
  3635. const vueImportAliases = {};
  3636. for (const key in userImports) {
  3637. const { source, imported, local } = userImports[key];
  3638. if (source === 'vue')
  3639. vueImportAliases[imported] = local;
  3640. }
  3641. // 2.1 process normal <script> body
  3642. if (script && scriptAst) {
  3643. for (const node of scriptAst.body) {
  3644. if (node.type === 'ExportDefaultDeclaration') {
  3645. // export default
  3646. defaultExport = node;
  3647. // check if user has manually specified `name` or 'render` option in
  3648. // export default
  3649. // if has name, skip name inference
  3650. // if has render and no template, generate return object instead of
  3651. // empty render function (#4980)
  3652. let optionProperties;
  3653. if (defaultExport.declaration.type === 'ObjectExpression') {
  3654. optionProperties = defaultExport.declaration.properties;
  3655. }
  3656. else if (defaultExport.declaration.type === 'CallExpression' &&
  3657. defaultExport.declaration.arguments[0].type === 'ObjectExpression') {
  3658. optionProperties = defaultExport.declaration.arguments[0].properties;
  3659. }
  3660. if (optionProperties) {
  3661. for (const s of optionProperties) {
  3662. if (s.type === 'ObjectProperty' &&
  3663. s.key.type === 'Identifier' &&
  3664. s.key.name === 'name') {
  3665. hasDefaultExportName = true;
  3666. }
  3667. if ((s.type === 'ObjectMethod' || s.type === 'ObjectProperty') &&
  3668. s.key.type === 'Identifier' &&
  3669. s.key.name === 'render') {
  3670. // TODO warn when we provide a better way to do it?
  3671. hasDefaultExportRender = true;
  3672. }
  3673. }
  3674. }
  3675. // export default { ... } --> const __default__ = { ... }
  3676. const start = node.start + scriptStartOffset;
  3677. const end = node.declaration.start + scriptStartOffset;
  3678. s.overwrite(start, end, `const ${DEFAULT_VAR} = `);
  3679. }
  3680. else if (node.type === 'ExportNamedDeclaration') {
  3681. const defaultSpecifier = node.specifiers.find(s => s.exported.type === 'Identifier' && s.exported.name === 'default');
  3682. if (defaultSpecifier) {
  3683. defaultExport = node;
  3684. // 1. remove specifier
  3685. if (node.specifiers.length > 1) {
  3686. s.remove(defaultSpecifier.start + scriptStartOffset, defaultSpecifier.end + scriptStartOffset);
  3687. }
  3688. else {
  3689. s.remove(node.start + scriptStartOffset, node.end + scriptStartOffset);
  3690. }
  3691. if (node.source) {
  3692. // export { x as default } from './x'
  3693. // rewrite to `import { x as __default__ } from './x'` and
  3694. // add to top
  3695. s.prepend(`import { ${defaultSpecifier.local.name} as ${DEFAULT_VAR} } from '${node.source.value}'\n`);
  3696. }
  3697. else {
  3698. // export { x as default }
  3699. // rewrite to `const __default__ = x` and move to end
  3700. s.appendLeft(scriptEndOffset, `\nconst ${DEFAULT_VAR} = ${defaultSpecifier.local.name}\n`);
  3701. }
  3702. }
  3703. if (node.declaration) {
  3704. walkDeclaration(node.declaration, scriptBindings, vueImportAliases);
  3705. }
  3706. }
  3707. else if ((node.type === 'VariableDeclaration' ||
  3708. node.type === 'FunctionDeclaration' ||
  3709. node.type === 'ClassDeclaration' ||
  3710. node.type === 'TSEnumDeclaration') &&
  3711. !node.declare) {
  3712. walkDeclaration(node, scriptBindings, vueImportAliases);
  3713. }
  3714. }
  3715. // apply reactivity transform
  3716. if (enableReactivityTransform && reactivityTransform.shouldTransform(script.content)) {
  3717. const { rootRefs, importedHelpers } = reactivityTransform.transformAST(scriptAst, s, scriptStartOffset);
  3718. refBindings = rootRefs;
  3719. for (const h of importedHelpers) {
  3720. helperImports.add(h);
  3721. }
  3722. }
  3723. // <script> after <script setup>
  3724. // we need to move the block up so that `const __default__` is
  3725. // declared before being used in the actual component definition
  3726. if (scriptStartOffset > startOffset) {
  3727. // if content doesn't end with newline, add one
  3728. if (!/\n$/.test(script.content.trim())) {
  3729. s.appendLeft(scriptEndOffset, `\n`);
  3730. }
  3731. s.move(scriptStartOffset, scriptEndOffset, 0);
  3732. }
  3733. }
  3734. // 2.2 process <script setup> body
  3735. for (const node of scriptSetupAst.body) {
  3736. // (Dropped) `ref: x` bindings
  3737. // TODO remove when out of experimental
  3738. if (node.type === 'LabeledStatement' &&
  3739. node.label.name === 'ref' &&
  3740. node.body.type === 'ExpressionStatement') {
  3741. error(`ref sugar using the label syntax was an experimental proposal and ` +
  3742. `has been dropped based on community feedback. Please check out ` +
  3743. `the new proposal at https://github.com/vuejs/rfcs/discussions/369`, node);
  3744. }
  3745. if (node.type === 'ExpressionStatement') {
  3746. // process `defineProps` and `defineEmit(s)` calls
  3747. if (processDefineProps(node.expression) ||
  3748. processDefineEmits(node.expression) ||
  3749. processWithDefaults(node.expression)) {
  3750. s.remove(node.start + startOffset, node.end + startOffset);
  3751. }
  3752. else if (processDefineExpose(node.expression)) {
  3753. // defineExpose({}) -> expose({})
  3754. const callee = node.expression.callee;
  3755. s.overwrite(callee.start + startOffset, callee.end + startOffset, 'expose');
  3756. }
  3757. }
  3758. if (node.type === 'VariableDeclaration' && !node.declare) {
  3759. const total = node.declarations.length;
  3760. let left = total;
  3761. for (let i = 0; i < total; i++) {
  3762. const decl = node.declarations[i];
  3763. if (decl.init) {
  3764. // defineProps / defineEmits
  3765. const isDefineProps = processDefineProps(decl.init, decl.id, node.kind) ||
  3766. processWithDefaults(decl.init, decl.id, node.kind);
  3767. const isDefineEmits = processDefineEmits(decl.init, decl.id);
  3768. if (isDefineProps || isDefineEmits) {
  3769. if (left === 1) {
  3770. s.remove(node.start + startOffset, node.end + startOffset);
  3771. }
  3772. else {
  3773. let start = decl.start + startOffset;
  3774. let end = decl.end + startOffset;
  3775. if (i === 0) {
  3776. // first one, locate the start of the next
  3777. end = node.declarations[i + 1].start + startOffset;
  3778. }
  3779. else {
  3780. // not first one, locate the end of the prev
  3781. start = node.declarations[i - 1].end + startOffset;
  3782. }
  3783. s.remove(start, end);
  3784. left--;
  3785. }
  3786. }
  3787. }
  3788. }
  3789. }
  3790. // walk declarations to record declared bindings
  3791. if ((node.type === 'VariableDeclaration' ||
  3792. node.type === 'FunctionDeclaration' ||
  3793. node.type === 'ClassDeclaration') &&
  3794. !node.declare) {
  3795. walkDeclaration(node, setupBindings, vueImportAliases);
  3796. }
  3797. // walk statements & named exports / variable declarations for top level
  3798. // await
  3799. if ((node.type === 'VariableDeclaration' && !node.declare) ||
  3800. node.type.endsWith('Statement')) {
  3801. const scope = [scriptSetupAst.body];
  3802. estreeWalker.walk(node, {
  3803. enter(child, parent) {
  3804. if (CompilerDOM.isFunctionType(child)) {
  3805. this.skip();
  3806. }
  3807. if (child.type === 'BlockStatement') {
  3808. scope.push(child.body);
  3809. }
  3810. if (child.type === 'AwaitExpression') {
  3811. hasAwait = true;
  3812. // if the await expression is an expression statement and
  3813. // - is in the root scope
  3814. // - or is not the first statement in a nested block scope
  3815. // then it needs a semicolon before the generated code.
  3816. const currentScope = scope[scope.length - 1];
  3817. const needsSemi = currentScope.some((n, i) => {
  3818. return ((scope.length === 1 || i > 0) &&
  3819. n.type === 'ExpressionStatement' &&
  3820. n.start === child.start);
  3821. });
  3822. processAwait(child, needsSemi, parent.type === 'ExpressionStatement');
  3823. }
  3824. },
  3825. exit(node) {
  3826. if (node.type === 'BlockStatement')
  3827. scope.pop();
  3828. }
  3829. });
  3830. }
  3831. if ((node.type === 'ExportNamedDeclaration' && node.exportKind !== 'type') ||
  3832. node.type === 'ExportAllDeclaration' ||
  3833. node.type === 'ExportDefaultDeclaration') {
  3834. error(`<script setup> cannot contain ES module exports. ` +
  3835. `If you are using a previous version of <script setup>, please ` +
  3836. `consult the updated RFC at https://github.com/vuejs/rfcs/pull/227.`, node);
  3837. }
  3838. if (isTS) {
  3839. // runtime enum
  3840. if (node.type === 'TSEnumDeclaration') {
  3841. registerBinding(setupBindings, node.id, "setup-const" /* BindingTypes.SETUP_CONST */);
  3842. }
  3843. // move all Type declarations to outer scope
  3844. if (node.type.startsWith('TS') ||
  3845. (node.type === 'ExportNamedDeclaration' &&
  3846. node.exportKind === 'type') ||
  3847. (node.type === 'VariableDeclaration' && node.declare)) {
  3848. recordType(node, declaredTypes);
  3849. hoistNode(node);
  3850. }
  3851. }
  3852. }
  3853. // 3. Apply reactivity transform
  3854. if ((enableReactivityTransform &&
  3855. // normal <script> had ref bindings that maybe used in <script setup>
  3856. (refBindings || reactivityTransform.shouldTransform(scriptSetup.content))) ||
  3857. propsDestructureDecl) {
  3858. const { rootRefs, importedHelpers } = reactivityTransform.transformAST(scriptSetupAst, s, startOffset, refBindings, propsDestructuredBindings);
  3859. refBindings = refBindings ? [...refBindings, ...rootRefs] : rootRefs;
  3860. for (const h of importedHelpers) {
  3861. helperImports.add(h);
  3862. }
  3863. }
  3864. // 4. extract runtime props/emits code from setup context type
  3865. if (propsTypeDecl) {
  3866. extractRuntimeProps(propsTypeDecl, typeDeclaredProps, declaredTypes);
  3867. }
  3868. if (emitsTypeDecl) {
  3869. extractRuntimeEmits(emitsTypeDecl, typeDeclaredEmits);
  3870. }
  3871. // 5. check useOptions args to make sure it doesn't reference setup scope
  3872. // variables
  3873. checkInvalidScopeReference(propsRuntimeDecl, DEFINE_PROPS);
  3874. checkInvalidScopeReference(propsRuntimeDefaults, DEFINE_PROPS);
  3875. checkInvalidScopeReference(propsDestructureDecl, DEFINE_PROPS);
  3876. checkInvalidScopeReference(emitsRuntimeDecl, DEFINE_EMITS);
  3877. // 6. remove non-script content
  3878. if (script) {
  3879. if (startOffset < scriptStartOffset) {
  3880. // <script setup> before <script>
  3881. s.remove(0, startOffset);
  3882. s.remove(endOffset, scriptStartOffset);
  3883. s.remove(scriptEndOffset, source.length);
  3884. }
  3885. else {
  3886. // <script> before <script setup>
  3887. s.remove(0, scriptStartOffset);
  3888. s.remove(scriptEndOffset, startOffset);
  3889. s.remove(endOffset, source.length);
  3890. }
  3891. }
  3892. else {
  3893. // only <script setup>
  3894. s.remove(0, startOffset);
  3895. s.remove(endOffset, source.length);
  3896. }
  3897. // 7. analyze binding metadata
  3898. if (scriptAst) {
  3899. Object.assign(bindingMetadata, analyzeScriptBindings(scriptAst.body));
  3900. }
  3901. if (propsRuntimeDecl) {
  3902. for (const key of getObjectOrArrayExpressionKeys(propsRuntimeDecl)) {
  3903. bindingMetadata[key] = "props" /* BindingTypes.PROPS */;
  3904. }
  3905. }
  3906. for (const key in typeDeclaredProps) {
  3907. bindingMetadata[key] = "props" /* BindingTypes.PROPS */;
  3908. }
  3909. // props aliases
  3910. if (propsDestructureDecl) {
  3911. if (propsDestructureRestId) {
  3912. bindingMetadata[propsDestructureRestId] =
  3913. "setup-reactive-const" /* BindingTypes.SETUP_REACTIVE_CONST */;
  3914. }
  3915. for (const key in propsDestructuredBindings) {
  3916. const { local } = propsDestructuredBindings[key];
  3917. if (local !== key) {
  3918. bindingMetadata[local] = "props-aliased" /* BindingTypes.PROPS_ALIASED */;
  3919. (bindingMetadata.__propsAliases ||
  3920. (bindingMetadata.__propsAliases = {}))[local] = key;
  3921. }
  3922. }
  3923. }
  3924. for (const [key, { isType, imported, source }] of Object.entries(userImports)) {
  3925. if (isType)
  3926. continue;
  3927. bindingMetadata[key] =
  3928. imported === '*' ||
  3929. (imported === 'default' && source.endsWith('.vue')) ||
  3930. source === 'vue'
  3931. ? "setup-const" /* BindingTypes.SETUP_CONST */
  3932. : "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */;
  3933. }
  3934. for (const key in scriptBindings) {
  3935. bindingMetadata[key] = scriptBindings[key];
  3936. }
  3937. for (const key in setupBindings) {
  3938. bindingMetadata[key] = setupBindings[key];
  3939. }
  3940. // known ref bindings
  3941. if (refBindings) {
  3942. for (const key of refBindings) {
  3943. bindingMetadata[key] = "setup-ref" /* BindingTypes.SETUP_REF */;
  3944. }
  3945. }
  3946. // 8. inject `useCssVars` calls
  3947. if (cssVars.length &&
  3948. // no need to do this when targeting SSR
  3949. !(options.inlineTemplate && ((_a = options.templateOptions) === null || _a === void 0 ? void 0 : _a.ssr))) {
  3950. helperImports.add(CSS_VARS_HELPER);
  3951. helperImports.add('unref');
  3952. s.prependRight(startOffset, `\n${genCssVarsCode(cssVars, bindingMetadata, scopeId, isProd)}\n`);
  3953. }
  3954. // 9. finalize setup() argument signature
  3955. let args = `__props`;
  3956. if (propsTypeDecl) {
  3957. // mark as any and only cast on assignment
  3958. // since the user defined complex types may be incompatible with the
  3959. // inferred type from generated runtime declarations
  3960. args += `: any`;
  3961. }
  3962. // inject user assignment of props
  3963. // we use a default __props so that template expressions referencing props
  3964. // can use it directly
  3965. if (propsIdentifier) {
  3966. s.prependLeft(startOffset, `\nconst ${propsIdentifier} = __props${propsTypeDecl ? ` as ${genSetupPropsType(propsTypeDecl)}` : ``};\n`);
  3967. }
  3968. if (propsDestructureRestId) {
  3969. s.prependLeft(startOffset, `\nconst ${propsDestructureRestId} = ${helper(`createPropsRestProxy`)}(__props, ${JSON.stringify(Object.keys(propsDestructuredBindings))});\n`);
  3970. }
  3971. // inject temp variables for async context preservation
  3972. if (hasAwait) {
  3973. const any = isTS ? `: any` : ``;
  3974. s.prependLeft(startOffset, `\nlet __temp${any}, __restore${any}\n`);
  3975. }
  3976. const destructureElements = hasDefineExposeCall || !options.inlineTemplate ? [`expose`] : [];
  3977. if (emitIdentifier) {
  3978. destructureElements.push(emitIdentifier === `emit` ? `emit` : `emit: ${emitIdentifier}`);
  3979. }
  3980. if (destructureElements.length) {
  3981. args += `, { ${destructureElements.join(', ')} }`;
  3982. if (emitsTypeDecl) {
  3983. const content = emitsTypeDecl.__fromNormalScript
  3984. ? script.content
  3985. : scriptSetup.content;
  3986. args += `: { emit: (${content.slice(emitsTypeDecl.start, emitsTypeDecl.end)}), expose: any, slots: any, attrs: any }`;
  3987. }
  3988. }
  3989. // 10. generate return statement
  3990. let returned;
  3991. if (!options.inlineTemplate || (!sfc.template && hasDefaultExportRender)) {
  3992. // non-inline mode, or has manual render in normal <script>
  3993. // return bindings from script and script setup
  3994. const allBindings = {
  3995. ...scriptBindings,
  3996. ...setupBindings
  3997. };
  3998. for (const key in userImports) {
  3999. if (!userImports[key].isType && userImports[key].isUsedInTemplate) {
  4000. allBindings[key] = true;
  4001. }
  4002. }
  4003. returned = `{ `;
  4004. for (const key in allBindings) {
  4005. if (allBindings[key] === true &&
  4006. userImports[key].source !== 'vue' &&
  4007. !userImports[key].source.endsWith('.vue')) {
  4008. // generate getter for import bindings
  4009. // skip vue imports since we know they will never change
  4010. returned += `get ${key}() { return ${key} }, `;
  4011. }
  4012. else if (bindingMetadata[key] === "setup-let" /* BindingTypes.SETUP_LET */) {
  4013. // local let binding, also add setter
  4014. const setArg = key === 'v' ? `_v` : `v`;
  4015. returned +=
  4016. `get ${key}() { return ${key} }, ` +
  4017. `set ${key}(${setArg}) { ${key} = ${setArg} }, `;
  4018. }
  4019. else {
  4020. returned += `${key}, `;
  4021. }
  4022. }
  4023. returned = returned.replace(/, $/, '') + ` }`;
  4024. }
  4025. else {
  4026. // inline mode
  4027. if (sfc.template && !sfc.template.src) {
  4028. if (options.templateOptions && options.templateOptions.ssr) {
  4029. hasInlinedSsrRenderFn = true;
  4030. }
  4031. // inline render function mode - we are going to compile the template and
  4032. // inline it right here
  4033. const { code, ast, preamble, tips, errors } = compileTemplate({
  4034. filename,
  4035. source: sfc.template.content,
  4036. inMap: sfc.template.map,
  4037. ...options.templateOptions,
  4038. id: scopeId,
  4039. scoped: sfc.styles.some(s => s.scoped),
  4040. isProd: options.isProd,
  4041. ssrCssVars: sfc.cssVars,
  4042. compilerOptions: {
  4043. ...(options.templateOptions &&
  4044. options.templateOptions.compilerOptions),
  4045. inline: true,
  4046. isTS,
  4047. bindingMetadata
  4048. }
  4049. });
  4050. if (tips.length) {
  4051. tips.forEach(warnOnce);
  4052. }
  4053. const err = errors[0];
  4054. if (typeof err === 'string') {
  4055. throw new Error(err);
  4056. }
  4057. else if (err) {
  4058. if (err.loc) {
  4059. err.message +=
  4060. `\n\n` +
  4061. sfc.filename +
  4062. '\n' +
  4063. shared.generateCodeFrame(source, err.loc.start.offset, err.loc.end.offset) +
  4064. `\n`;
  4065. }
  4066. throw err;
  4067. }
  4068. if (preamble) {
  4069. s.prepend(preamble);
  4070. }
  4071. // avoid duplicated unref import
  4072. // as this may get injected by the render function preamble OR the
  4073. // css vars codegen
  4074. if (ast && ast.helpers.has(CompilerDOM.UNREF)) {
  4075. helperImports.delete('unref');
  4076. }
  4077. returned = code;
  4078. }
  4079. else {
  4080. returned = `() => {}`;
  4081. }
  4082. }
  4083. if (!options.inlineTemplate && !false) {
  4084. // in non-inline mode, the `__isScriptSetup: true` flag is used by
  4085. // componentPublicInstance proxy to allow properties that start with $ or _
  4086. s.appendRight(endOffset, `\nconst __returned__ = ${returned}\n` +
  4087. `Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })\n` +
  4088. `return __returned__` +
  4089. `\n}\n\n`);
  4090. }
  4091. else {
  4092. s.appendRight(endOffset, `\nreturn ${returned}\n}\n\n`);
  4093. }
  4094. // 11. finalize default export
  4095. let runtimeOptions = ``;
  4096. if (!hasDefaultExportName && filename && filename !== DEFAULT_FILENAME) {
  4097. const match = filename.match(/([^/\\]+)\.\w+$/);
  4098. if (match) {
  4099. runtimeOptions += `\n __name: '${match[1]}',`;
  4100. }
  4101. }
  4102. if (hasInlinedSsrRenderFn) {
  4103. runtimeOptions += `\n __ssrInlineRender: true,`;
  4104. }
  4105. if (propsRuntimeDecl) {
  4106. let declCode = scriptSetup.content
  4107. .slice(propsRuntimeDecl.start, propsRuntimeDecl.end)
  4108. .trim();
  4109. if (propsDestructureDecl) {
  4110. const defaults = [];
  4111. for (const key in propsDestructuredBindings) {
  4112. const d = genDestructuredDefaultValue(key);
  4113. if (d)
  4114. defaults.push(`${key}: ${d}`);
  4115. }
  4116. if (defaults.length) {
  4117. declCode = `${helper(`mergeDefaults`)}(${declCode}, {\n ${defaults.join(',\n ')}\n})`;
  4118. }
  4119. }
  4120. runtimeOptions += `\n props: ${declCode},`;
  4121. }
  4122. else if (propsTypeDecl) {
  4123. runtimeOptions += genRuntimeProps(typeDeclaredProps);
  4124. }
  4125. if (emitsRuntimeDecl) {
  4126. runtimeOptions += `\n emits: ${scriptSetup.content
  4127. .slice(emitsRuntimeDecl.start, emitsRuntimeDecl.end)
  4128. .trim()},`;
  4129. }
  4130. else if (emitsTypeDecl) {
  4131. runtimeOptions += genRuntimeEmits(typeDeclaredEmits);
  4132. }
  4133. // <script setup> components are closed by default. If the user did not
  4134. // explicitly call `defineExpose`, call expose() with no args.
  4135. const exposeCall = hasDefineExposeCall || options.inlineTemplate ? `` : ` expose();\n`;
  4136. // wrap setup code with function.
  4137. if (isTS) {
  4138. // for TS, make sure the exported type is still valid type with
  4139. // correct props information
  4140. // we have to use object spread for types to be merged properly
  4141. // user's TS setting should compile it down to proper targets
  4142. // export default defineComponent({ ...__default__, ... })
  4143. const def = defaultExport ? `\n ...${DEFAULT_VAR},` : ``;
  4144. s.prependLeft(startOffset, `\nexport default /*#__PURE__*/${helper(`defineComponent`)}({${def}${runtimeOptions}\n ${hasAwait ? `async ` : ``}setup(${args}) {\n${exposeCall}`);
  4145. s.appendRight(endOffset, `})`);
  4146. }
  4147. else {
  4148. if (defaultExport) {
  4149. // without TS, can't rely on rest spread, so we use Object.assign
  4150. // export default Object.assign(__default__, { ... })
  4151. s.prependLeft(startOffset, `\nexport default /*#__PURE__*/Object.assign(${DEFAULT_VAR}, {${runtimeOptions}\n ` +
  4152. `${hasAwait ? `async ` : ``}setup(${args}) {\n${exposeCall}`);
  4153. s.appendRight(endOffset, `})`);
  4154. }
  4155. else {
  4156. s.prependLeft(startOffset, `\nexport default {${runtimeOptions}\n ` +
  4157. `${hasAwait ? `async ` : ``}setup(${args}) {\n${exposeCall}`);
  4158. s.appendRight(endOffset, `}`);
  4159. }
  4160. }
  4161. // 12. finalize Vue helper imports
  4162. if (helperImports.size > 0) {
  4163. s.prepend(`import { ${[...helperImports]
  4164. .map(h => `${h} as _${h}`)
  4165. .join(', ')} } from 'vue'\n`);
  4166. }
  4167. s.trim();
  4168. return {
  4169. ...scriptSetup,
  4170. bindings: bindingMetadata,
  4171. imports: userImports,
  4172. content: s.toString(),
  4173. map: genSourceMap
  4174. ? s.generateMap({
  4175. source: filename,
  4176. hires: true,
  4177. includeContent: true
  4178. })
  4179. : undefined,
  4180. scriptAst: scriptAst === null || scriptAst === void 0 ? void 0 : scriptAst.body,
  4181. scriptSetupAst: scriptSetupAst === null || scriptSetupAst === void 0 ? void 0 : scriptSetupAst.body
  4182. };
  4183. }
  4184. function registerBinding(bindings, node, type) {
  4185. bindings[node.name] = type;
  4186. }
  4187. function walkDeclaration(node, bindings, userImportAliases) {
  4188. if (node.type === 'VariableDeclaration') {
  4189. const isConst = node.kind === 'const';
  4190. // export const foo = ...
  4191. for (const { id, init } of node.declarations) {
  4192. const isDefineCall = !!(isConst &&
  4193. isCallOf(init, c => c === DEFINE_PROPS || c === DEFINE_EMITS || c === WITH_DEFAULTS));
  4194. if (id.type === 'Identifier') {
  4195. let bindingType;
  4196. const userReactiveBinding = userImportAliases['reactive'];
  4197. if (isCallOf(init, userReactiveBinding)) {
  4198. // treat reactive() calls as let since it's meant to be mutable
  4199. bindingType = isConst
  4200. ? "setup-reactive-const" /* BindingTypes.SETUP_REACTIVE_CONST */
  4201. : "setup-let" /* BindingTypes.SETUP_LET */;
  4202. }
  4203. else if (
  4204. // if a declaration is a const literal, we can mark it so that
  4205. // the generated render fn code doesn't need to unref() it
  4206. isDefineCall ||
  4207. (isConst && canNeverBeRef(init, userReactiveBinding))) {
  4208. bindingType = isCallOf(init, DEFINE_PROPS)
  4209. ? "setup-reactive-const" /* BindingTypes.SETUP_REACTIVE_CONST */
  4210. : "setup-const" /* BindingTypes.SETUP_CONST */;
  4211. }
  4212. else if (isConst) {
  4213. if (isCallOf(init, userImportAliases['ref'])) {
  4214. bindingType = "setup-ref" /* BindingTypes.SETUP_REF */;
  4215. }
  4216. else {
  4217. bindingType = "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */;
  4218. }
  4219. }
  4220. else {
  4221. bindingType = "setup-let" /* BindingTypes.SETUP_LET */;
  4222. }
  4223. registerBinding(bindings, id, bindingType);
  4224. }
  4225. else {
  4226. if (isCallOf(init, DEFINE_PROPS)) {
  4227. continue;
  4228. }
  4229. if (id.type === 'ObjectPattern') {
  4230. walkObjectPattern(id, bindings, isConst, isDefineCall);
  4231. }
  4232. else if (id.type === 'ArrayPattern') {
  4233. walkArrayPattern(id, bindings, isConst, isDefineCall);
  4234. }
  4235. }
  4236. }
  4237. }
  4238. else if (node.type === 'TSEnumDeclaration' ||
  4239. node.type === 'FunctionDeclaration' ||
  4240. node.type === 'ClassDeclaration') {
  4241. // export function foo() {} / export class Foo {}
  4242. // export declarations must be named.
  4243. bindings[node.id.name] = "setup-const" /* BindingTypes.SETUP_CONST */;
  4244. }
  4245. }
  4246. function walkObjectPattern(node, bindings, isConst, isDefineCall = false) {
  4247. for (const p of node.properties) {
  4248. if (p.type === 'ObjectProperty') {
  4249. if (p.key.type === 'Identifier' && p.key === p.value) {
  4250. // shorthand: const { x } = ...
  4251. const type = isDefineCall
  4252. ? "setup-const" /* BindingTypes.SETUP_CONST */
  4253. : isConst
  4254. ? "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */
  4255. : "setup-let" /* BindingTypes.SETUP_LET */;
  4256. registerBinding(bindings, p.key, type);
  4257. }
  4258. else {
  4259. walkPattern(p.value, bindings, isConst, isDefineCall);
  4260. }
  4261. }
  4262. else {
  4263. // ...rest
  4264. // argument can only be identifier when destructuring
  4265. const type = isConst ? "setup-const" /* BindingTypes.SETUP_CONST */ : "setup-let" /* BindingTypes.SETUP_LET */;
  4266. registerBinding(bindings, p.argument, type);
  4267. }
  4268. }
  4269. }
  4270. function walkArrayPattern(node, bindings, isConst, isDefineCall = false) {
  4271. for (const e of node.elements) {
  4272. e && walkPattern(e, bindings, isConst, isDefineCall);
  4273. }
  4274. }
  4275. function walkPattern(node, bindings, isConst, isDefineCall = false) {
  4276. if (node.type === 'Identifier') {
  4277. const type = isDefineCall
  4278. ? "setup-const" /* BindingTypes.SETUP_CONST */
  4279. : isConst
  4280. ? "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */
  4281. : "setup-let" /* BindingTypes.SETUP_LET */;
  4282. registerBinding(bindings, node, type);
  4283. }
  4284. else if (node.type === 'RestElement') {
  4285. // argument can only be identifier when destructuring
  4286. const type = isConst ? "setup-const" /* BindingTypes.SETUP_CONST */ : "setup-let" /* BindingTypes.SETUP_LET */;
  4287. registerBinding(bindings, node.argument, type);
  4288. }
  4289. else if (node.type === 'ObjectPattern') {
  4290. walkObjectPattern(node, bindings, isConst);
  4291. }
  4292. else if (node.type === 'ArrayPattern') {
  4293. walkArrayPattern(node, bindings, isConst);
  4294. }
  4295. else if (node.type === 'AssignmentPattern') {
  4296. if (node.left.type === 'Identifier') {
  4297. const type = isDefineCall
  4298. ? "setup-const" /* BindingTypes.SETUP_CONST */
  4299. : isConst
  4300. ? "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */
  4301. : "setup-let" /* BindingTypes.SETUP_LET */;
  4302. registerBinding(bindings, node.left, type);
  4303. }
  4304. else {
  4305. walkPattern(node.left, bindings, isConst);
  4306. }
  4307. }
  4308. }
  4309. function recordType(node, declaredTypes) {
  4310. if (node.type === 'TSInterfaceDeclaration') {
  4311. declaredTypes[node.id.name] = [`Object`];
  4312. }
  4313. else if (node.type === 'TSTypeAliasDeclaration') {
  4314. declaredTypes[node.id.name] = inferRuntimeType(node.typeAnnotation, declaredTypes);
  4315. }
  4316. else if (node.type === 'ExportNamedDeclaration' && node.declaration) {
  4317. recordType(node.declaration, declaredTypes);
  4318. }
  4319. }
  4320. function extractRuntimeProps(node, props, declaredTypes, isProd) {
  4321. const members = node.type === 'TSTypeLiteral' ? node.members : node.body;
  4322. for (const m of members) {
  4323. if ((m.type === 'TSPropertySignature' || m.type === 'TSMethodSignature') &&
  4324. m.key.type === 'Identifier') {
  4325. let type;
  4326. if (m.type === 'TSMethodSignature') {
  4327. type = ['Function'];
  4328. }
  4329. else if (m.typeAnnotation) {
  4330. type = inferRuntimeType(m.typeAnnotation.typeAnnotation, declaredTypes);
  4331. }
  4332. props[m.key.name] = {
  4333. key: m.key.name,
  4334. required: !m.optional,
  4335. type: type || [`null`]
  4336. };
  4337. }
  4338. }
  4339. }
  4340. function inferRuntimeType(node, declaredTypes) {
  4341. switch (node.type) {
  4342. case 'TSStringKeyword':
  4343. return ['String'];
  4344. case 'TSNumberKeyword':
  4345. return ['Number'];
  4346. case 'TSBooleanKeyword':
  4347. return ['Boolean'];
  4348. case 'TSObjectKeyword':
  4349. return ['Object'];
  4350. case 'TSTypeLiteral':
  4351. // TODO (nice to have) generate runtime property validation
  4352. return ['Object'];
  4353. case 'TSFunctionType':
  4354. return ['Function'];
  4355. case 'TSArrayType':
  4356. case 'TSTupleType':
  4357. // TODO (nice to have) generate runtime element type/length checks
  4358. return ['Array'];
  4359. case 'TSLiteralType':
  4360. switch (node.literal.type) {
  4361. case 'StringLiteral':
  4362. return ['String'];
  4363. case 'BooleanLiteral':
  4364. return ['Boolean'];
  4365. case 'NumericLiteral':
  4366. case 'BigIntLiteral':
  4367. return ['Number'];
  4368. default:
  4369. return [`null`];
  4370. }
  4371. case 'TSTypeReference':
  4372. if (node.typeName.type === 'Identifier') {
  4373. if (declaredTypes[node.typeName.name]) {
  4374. return declaredTypes[node.typeName.name];
  4375. }
  4376. switch (node.typeName.name) {
  4377. case 'Array':
  4378. case 'Function':
  4379. case 'Object':
  4380. case 'Set':
  4381. case 'Map':
  4382. case 'WeakSet':
  4383. case 'WeakMap':
  4384. case 'Date':
  4385. case 'Promise':
  4386. return [node.typeName.name];
  4387. case 'Record':
  4388. case 'Partial':
  4389. case 'Readonly':
  4390. case 'Pick':
  4391. case 'Omit':
  4392. case 'Exclude':
  4393. case 'Extract':
  4394. case 'Required':
  4395. case 'InstanceType':
  4396. return ['Object'];
  4397. }
  4398. }
  4399. return [`null`];
  4400. case 'TSParenthesizedType':
  4401. return inferRuntimeType(node.typeAnnotation, declaredTypes);
  4402. case 'TSUnionType':
  4403. return [
  4404. ...new Set([].concat(...node.types.map(t => inferRuntimeType(t, declaredTypes))))
  4405. ];
  4406. case 'TSIntersectionType':
  4407. return ['Object'];
  4408. case 'TSSymbolKeyword':
  4409. return ['Symbol'];
  4410. default:
  4411. return [`null`]; // no runtime check
  4412. }
  4413. }
  4414. function toRuntimeTypeString(types) {
  4415. return types.length > 1 ? `[${types.join(', ')}]` : types[0];
  4416. }
  4417. function extractRuntimeEmits(node, emits) {
  4418. if (node.type === 'TSTypeLiteral' || node.type === 'TSInterfaceBody') {
  4419. const members = node.type === 'TSTypeLiteral' ? node.members : node.body;
  4420. for (let t of members) {
  4421. if (t.type === 'TSCallSignatureDeclaration') {
  4422. extractEventNames(t.parameters[0], emits);
  4423. }
  4424. }
  4425. return;
  4426. }
  4427. else {
  4428. extractEventNames(node.parameters[0], emits);
  4429. }
  4430. }
  4431. function extractEventNames(eventName, emits) {
  4432. if (eventName.type === 'Identifier' &&
  4433. eventName.typeAnnotation &&
  4434. eventName.typeAnnotation.type === 'TSTypeAnnotation') {
  4435. const typeNode = eventName.typeAnnotation.typeAnnotation;
  4436. if (typeNode.type === 'TSLiteralType') {
  4437. if (typeNode.literal.type !== 'UnaryExpression') {
  4438. emits.add(String(typeNode.literal.value));
  4439. }
  4440. }
  4441. else if (typeNode.type === 'TSUnionType') {
  4442. for (const t of typeNode.types) {
  4443. if (t.type === 'TSLiteralType' &&
  4444. t.literal.type !== 'UnaryExpression') {
  4445. emits.add(String(t.literal.value));
  4446. }
  4447. }
  4448. }
  4449. }
  4450. }
  4451. function genRuntimeEmits(emits) {
  4452. return emits.size
  4453. ? `\n emits: [${Array.from(emits)
  4454. .map(p => JSON.stringify(p))
  4455. .join(', ')}],`
  4456. : ``;
  4457. }
  4458. function isCallOf(node, test) {
  4459. return !!(node &&
  4460. test &&
  4461. node.type === 'CallExpression' &&
  4462. node.callee.type === 'Identifier' &&
  4463. (typeof test === 'string'
  4464. ? node.callee.name === test
  4465. : test(node.callee.name)));
  4466. }
  4467. function canNeverBeRef(node, userReactiveImport) {
  4468. if (isCallOf(node, userReactiveImport)) {
  4469. return true;
  4470. }
  4471. switch (node.type) {
  4472. case 'UnaryExpression':
  4473. case 'BinaryExpression':
  4474. case 'ArrayExpression':
  4475. case 'ObjectExpression':
  4476. case 'FunctionExpression':
  4477. case 'ArrowFunctionExpression':
  4478. case 'UpdateExpression':
  4479. case 'ClassExpression':
  4480. case 'TaggedTemplateExpression':
  4481. return true;
  4482. case 'SequenceExpression':
  4483. return canNeverBeRef(node.expressions[node.expressions.length - 1], userReactiveImport);
  4484. default:
  4485. if (node.type.endsWith('Literal')) {
  4486. return true;
  4487. }
  4488. return false;
  4489. }
  4490. }
  4491. /**
  4492. * Analyze bindings in normal `<script>`
  4493. * Note that `compileScriptSetup` already analyzes bindings as part of its
  4494. * compilation process so this should only be used on single `<script>` SFCs.
  4495. */
  4496. function analyzeScriptBindings(ast) {
  4497. for (const node of ast) {
  4498. if (node.type === 'ExportDefaultDeclaration' &&
  4499. node.declaration.type === 'ObjectExpression') {
  4500. return analyzeBindingsFromOptions(node.declaration);
  4501. }
  4502. }
  4503. return {};
  4504. }
  4505. function analyzeBindingsFromOptions(node) {
  4506. const bindings = {};
  4507. // #3270, #3275
  4508. // mark non-script-setup so we don't resolve components/directives from these
  4509. Object.defineProperty(bindings, '__isScriptSetup', {
  4510. enumerable: false,
  4511. value: false
  4512. });
  4513. for (const property of node.properties) {
  4514. if (property.type === 'ObjectProperty' &&
  4515. !property.computed &&
  4516. property.key.type === 'Identifier') {
  4517. // props
  4518. if (property.key.name === 'props') {
  4519. // props: ['foo']
  4520. // props: { foo: ... }
  4521. for (const key of getObjectOrArrayExpressionKeys(property.value)) {
  4522. bindings[key] = "props" /* BindingTypes.PROPS */;
  4523. }
  4524. }
  4525. // inject
  4526. else if (property.key.name === 'inject') {
  4527. // inject: ['foo']
  4528. // inject: { foo: {} }
  4529. for (const key of getObjectOrArrayExpressionKeys(property.value)) {
  4530. bindings[key] = "options" /* BindingTypes.OPTIONS */;
  4531. }
  4532. }
  4533. // computed & methods
  4534. else if (property.value.type === 'ObjectExpression' &&
  4535. (property.key.name === 'computed' || property.key.name === 'methods')) {
  4536. // methods: { foo() {} }
  4537. // computed: { foo() {} }
  4538. for (const key of getObjectExpressionKeys(property.value)) {
  4539. bindings[key] = "options" /* BindingTypes.OPTIONS */;
  4540. }
  4541. }
  4542. }
  4543. // setup & data
  4544. else if (property.type === 'ObjectMethod' &&
  4545. property.key.type === 'Identifier' &&
  4546. (property.key.name === 'setup' || property.key.name === 'data')) {
  4547. for (const bodyItem of property.body.body) {
  4548. // setup() {
  4549. // return {
  4550. // foo: null
  4551. // }
  4552. // }
  4553. if (bodyItem.type === 'ReturnStatement' &&
  4554. bodyItem.argument &&
  4555. bodyItem.argument.type === 'ObjectExpression') {
  4556. for (const key of getObjectExpressionKeys(bodyItem.argument)) {
  4557. bindings[key] =
  4558. property.key.name === 'setup'
  4559. ? "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */
  4560. : "data" /* BindingTypes.DATA */;
  4561. }
  4562. }
  4563. }
  4564. }
  4565. }
  4566. return bindings;
  4567. }
  4568. function getObjectExpressionKeys(node) {
  4569. const keys = [];
  4570. for (const prop of node.properties) {
  4571. if (prop.type === 'SpreadElement')
  4572. continue;
  4573. const key = resolveObjectKey(prop.key, prop.computed);
  4574. if (key)
  4575. keys.push(String(key));
  4576. }
  4577. return keys;
  4578. }
  4579. function getArrayExpressionKeys(node) {
  4580. const keys = [];
  4581. for (const element of node.elements) {
  4582. if (element && element.type === 'StringLiteral') {
  4583. keys.push(element.value);
  4584. }
  4585. }
  4586. return keys;
  4587. }
  4588. function getObjectOrArrayExpressionKeys(value) {
  4589. if (value.type === 'ArrayExpression') {
  4590. return getArrayExpressionKeys(value);
  4591. }
  4592. if (value.type === 'ObjectExpression') {
  4593. return getObjectExpressionKeys(value);
  4594. }
  4595. return [];
  4596. }
  4597. const templateUsageCheckCache = createCache();
  4598. function resolveTemplateUsageCheckString(sfc) {
  4599. const { content, ast } = sfc.template;
  4600. const cached = templateUsageCheckCache.get(content);
  4601. if (cached) {
  4602. return cached;
  4603. }
  4604. let code = '';
  4605. CompilerDOM.transform(CompilerDOM.createRoot([ast]), {
  4606. nodeTransforms: [
  4607. node => {
  4608. if (node.type === 1 /* NodeTypes.ELEMENT */) {
  4609. if (!CompilerDOM.parserOptions.isNativeTag(node.tag) &&
  4610. !CompilerDOM.parserOptions.isBuiltInComponent(node.tag)) {
  4611. code += `,${shared.camelize(node.tag)},${shared.capitalize(shared.camelize(node.tag))}`;
  4612. }
  4613. for (let i = 0; i < node.props.length; i++) {
  4614. const prop = node.props[i];
  4615. if (prop.type === 7 /* NodeTypes.DIRECTIVE */) {
  4616. if (!isBuiltInDir(prop.name)) {
  4617. code += `,v${shared.capitalize(shared.camelize(prop.name))}`;
  4618. }
  4619. if (prop.exp) {
  4620. code += `,${processExp(prop.exp.content, prop.name)}`;
  4621. }
  4622. }
  4623. }
  4624. }
  4625. else if (node.type === 5 /* NodeTypes.INTERPOLATION */) {
  4626. code += `,${processExp(node.content.content)}`;
  4627. }
  4628. }
  4629. ]
  4630. });
  4631. code += ';';
  4632. templateUsageCheckCache.set(content, code);
  4633. return code;
  4634. }
  4635. const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  4636. function processExp(exp, dir) {
  4637. if (/ as\s+\w|<.*>|:/.test(exp)) {
  4638. if (dir === 'slot') {
  4639. exp = `(${exp})=>{}`;
  4640. }
  4641. else if (dir === 'on') {
  4642. exp = `()=>{return ${exp}}`;
  4643. }
  4644. else if (dir === 'for') {
  4645. const inMatch = exp.match(forAliasRE);
  4646. if (inMatch) {
  4647. const [, LHS, RHS] = inMatch;
  4648. return processExp(`(${LHS})=>{}`) + processExp(RHS);
  4649. }
  4650. }
  4651. let ret = '';
  4652. // has potential type cast or generic arguments that uses types
  4653. const ast = parser$2.parseExpression(exp, { plugins: ['typescript'] });
  4654. CompilerDOM.walkIdentifiers(ast, node => {
  4655. ret += `,` + node.name;
  4656. });
  4657. return ret;
  4658. }
  4659. return stripStrings(exp);
  4660. }
  4661. function stripStrings(exp) {
  4662. return exp
  4663. .replace(/'[^']*'|"[^"]*"/g, '')
  4664. .replace(/`[^`]+`/g, stripTemplateString);
  4665. }
  4666. function stripTemplateString(str) {
  4667. const interpMatch = str.match(/\${[^}]+}/g);
  4668. if (interpMatch) {
  4669. return interpMatch.map(m => m.slice(2, -1)).join(',');
  4670. }
  4671. return '';
  4672. }
  4673. function isImportUsed(local, sfc) {
  4674. return new RegExp(
  4675. // #4274 escape $ since it's a special char in regex
  4676. // (and is the only regex special char that is valid in identifiers)
  4677. `[^\\w$_]${local.replace(/\$/g, '\\$')}[^\\w$_]`).test(resolveTemplateUsageCheckString(sfc));
  4678. }
  4679. /**
  4680. * Note: this comparison assumes the prev/next script are already identical,
  4681. * and only checks the special case where <script setup lang="ts"> unused import
  4682. * pruning result changes due to template changes.
  4683. */
  4684. function hmrShouldReload(prevImports, next) {
  4685. if (!next.scriptSetup ||
  4686. (next.scriptSetup.lang !== 'ts' && next.scriptSetup.lang !== 'tsx')) {
  4687. return false;
  4688. }
  4689. // for each previous import, check if its used status remain the same based on
  4690. // the next descriptor's template
  4691. for (const key in prevImports) {
  4692. // if an import was previous unused, but now is used, we need to force
  4693. // reload so that the script now includes that import.
  4694. if (!prevImports[key].isUsedInTemplate && isImportUsed(key, next)) {
  4695. return true;
  4696. }
  4697. }
  4698. return false;
  4699. }
  4700. function resolveObjectKey(node, computed) {
  4701. switch (node.type) {
  4702. case 'StringLiteral':
  4703. case 'NumericLiteral':
  4704. return node.value;
  4705. case 'Identifier':
  4706. if (!computed)
  4707. return node.name;
  4708. }
  4709. return undefined;
  4710. }
  4711. const DEFAULT_FILENAME = 'anonymous.vue';
  4712. const sourceToSFC = createCache();
  4713. function parse$4(source, { sourceMap = true, filename = DEFAULT_FILENAME, sourceRoot = '', pad = false, ignoreEmpty = true, compiler = CompilerDOM__namespace } = {}) {
  4714. const sourceKey = source + sourceMap + filename + sourceRoot + pad + compiler.parse;
  4715. const cache = sourceToSFC.get(sourceKey);
  4716. if (cache) {
  4717. return cache;
  4718. }
  4719. const descriptor = {
  4720. filename,
  4721. source,
  4722. template: null,
  4723. script: null,
  4724. scriptSetup: null,
  4725. styles: [],
  4726. customBlocks: [],
  4727. cssVars: [],
  4728. slotted: false,
  4729. shouldForceReload: prevImports => hmrShouldReload(prevImports, descriptor)
  4730. };
  4731. const errors = [];
  4732. const ast = compiler.parse(source, {
  4733. // there are no components at SFC parsing level
  4734. isNativeTag: () => true,
  4735. // preserve all whitespaces
  4736. isPreTag: () => true,
  4737. getTextMode: ({ tag, props }, parent) => {
  4738. // all top level elements except <template> are parsed as raw text
  4739. // containers
  4740. if ((!parent && tag !== 'template') ||
  4741. // <template lang="xxx"> should also be treated as raw text
  4742. (tag === 'template' &&
  4743. props.some(p => p.type === 6 /* NodeTypes.ATTRIBUTE */ &&
  4744. p.name === 'lang' &&
  4745. p.value &&
  4746. p.value.content &&
  4747. p.value.content !== 'html'))) {
  4748. return 2 /* TextModes.RAWTEXT */;
  4749. }
  4750. else {
  4751. return 0 /* TextModes.DATA */;
  4752. }
  4753. },
  4754. onError: e => {
  4755. errors.push(e);
  4756. }
  4757. });
  4758. ast.children.forEach(node => {
  4759. if (node.type !== 1 /* NodeTypes.ELEMENT */) {
  4760. return;
  4761. }
  4762. // we only want to keep the nodes that are not empty (when the tag is not a template)
  4763. if (ignoreEmpty &&
  4764. node.tag !== 'template' &&
  4765. isEmpty(node) &&
  4766. !hasSrc(node)) {
  4767. return;
  4768. }
  4769. switch (node.tag) {
  4770. case 'template':
  4771. if (!descriptor.template) {
  4772. const templateBlock = (descriptor.template = createBlock(node, source, false));
  4773. templateBlock.ast = node;
  4774. // warn against 2.x <template functional>
  4775. if (templateBlock.attrs.functional) {
  4776. const err = new SyntaxError(`<template functional> is no longer supported in Vue 3, since ` +
  4777. `functional components no longer have significant performance ` +
  4778. `difference from stateful ones. Just use a normal <template> ` +
  4779. `instead.`);
  4780. err.loc = node.props.find(p => p.name === 'functional').loc;
  4781. errors.push(err);
  4782. }
  4783. }
  4784. else {
  4785. errors.push(createDuplicateBlockError(node));
  4786. }
  4787. break;
  4788. case 'script':
  4789. const scriptBlock = createBlock(node, source, pad);
  4790. const isSetup = !!scriptBlock.attrs.setup;
  4791. if (isSetup && !descriptor.scriptSetup) {
  4792. descriptor.scriptSetup = scriptBlock;
  4793. break;
  4794. }
  4795. if (!isSetup && !descriptor.script) {
  4796. descriptor.script = scriptBlock;
  4797. break;
  4798. }
  4799. errors.push(createDuplicateBlockError(node, isSetup));
  4800. break;
  4801. case 'style':
  4802. const styleBlock = createBlock(node, source, pad);
  4803. if (styleBlock.attrs.vars) {
  4804. errors.push(new SyntaxError(`<style vars> has been replaced by a new proposal: ` +
  4805. `https://github.com/vuejs/rfcs/pull/231`));
  4806. }
  4807. descriptor.styles.push(styleBlock);
  4808. break;
  4809. default:
  4810. descriptor.customBlocks.push(createBlock(node, source, pad));
  4811. break;
  4812. }
  4813. });
  4814. if (!descriptor.template && !descriptor.script && !descriptor.scriptSetup) {
  4815. errors.push(new SyntaxError(`At least one <template> or <script> is required in a single file component.`));
  4816. }
  4817. if (descriptor.scriptSetup) {
  4818. if (descriptor.scriptSetup.src) {
  4819. errors.push(new SyntaxError(`<script setup> cannot use the "src" attribute because ` +
  4820. `its syntax will be ambiguous outside of the component.`));
  4821. descriptor.scriptSetup = null;
  4822. }
  4823. if (descriptor.script && descriptor.script.src) {
  4824. errors.push(new SyntaxError(`<script> cannot use the "src" attribute when <script setup> is ` +
  4825. `also present because they must be processed together.`));
  4826. descriptor.script = null;
  4827. }
  4828. }
  4829. if (sourceMap) {
  4830. const genMap = (block) => {
  4831. if (block && !block.src) {
  4832. block.map = generateSourceMap(filename, source, block.content, sourceRoot, !pad || block.type === 'template' ? block.loc.start.line - 1 : 0);
  4833. }
  4834. };
  4835. genMap(descriptor.template);
  4836. genMap(descriptor.script);
  4837. descriptor.styles.forEach(genMap);
  4838. descriptor.customBlocks.forEach(genMap);
  4839. }
  4840. // parse CSS vars
  4841. descriptor.cssVars = parseCssVars(descriptor);
  4842. // check if the SFC uses :slotted
  4843. const slottedRE = /(?:::v-|:)slotted\(/;
  4844. descriptor.slotted = descriptor.styles.some(s => s.scoped && slottedRE.test(s.content));
  4845. const result = {
  4846. descriptor,
  4847. errors
  4848. };
  4849. sourceToSFC.set(sourceKey, result);
  4850. return result;
  4851. }
  4852. function createDuplicateBlockError(node, isScriptSetup = false) {
  4853. const err = new SyntaxError(`Single file component can contain only one <${node.tag}${isScriptSetup ? ` setup` : ``}> element`);
  4854. err.loc = node.loc;
  4855. return err;
  4856. }
  4857. function createBlock(node, source, pad) {
  4858. const type = node.tag;
  4859. let { start, end } = node.loc;
  4860. let content = '';
  4861. if (node.children.length) {
  4862. start = node.children[0].loc.start;
  4863. end = node.children[node.children.length - 1].loc.end;
  4864. content = source.slice(start.offset, end.offset);
  4865. }
  4866. else {
  4867. const offset = node.loc.source.indexOf(`</`);
  4868. if (offset > -1) {
  4869. start = {
  4870. line: start.line,
  4871. column: start.column + offset,
  4872. offset: start.offset + offset
  4873. };
  4874. }
  4875. end = { ...start };
  4876. }
  4877. const loc = {
  4878. source: content,
  4879. start,
  4880. end
  4881. };
  4882. const attrs = {};
  4883. const block = {
  4884. type,
  4885. content,
  4886. loc,
  4887. attrs
  4888. };
  4889. if (pad) {
  4890. block.content = padContent(source, block, pad) + block.content;
  4891. }
  4892. node.props.forEach(p => {
  4893. if (p.type === 6 /* NodeTypes.ATTRIBUTE */) {
  4894. attrs[p.name] = p.value ? p.value.content || true : true;
  4895. if (p.name === 'lang') {
  4896. block.lang = p.value && p.value.content;
  4897. }
  4898. else if (p.name === 'src') {
  4899. block.src = p.value && p.value.content;
  4900. }
  4901. else if (type === 'style') {
  4902. if (p.name === 'scoped') {
  4903. block.scoped = true;
  4904. }
  4905. else if (p.name === 'module') {
  4906. block.module = attrs[p.name];
  4907. }
  4908. }
  4909. else if (type === 'script' && p.name === 'setup') {
  4910. block.setup = attrs.setup;
  4911. }
  4912. }
  4913. });
  4914. return block;
  4915. }
  4916. const splitRE = /\r?\n/g;
  4917. const emptyRE = /^(?:\/\/)?\s*$/;
  4918. const replaceRE = /./g;
  4919. function generateSourceMap(filename, source, generated, sourceRoot, lineOffset) {
  4920. const map = new require$$0$2.SourceMapGenerator({
  4921. file: filename.replace(/\\/g, '/'),
  4922. sourceRoot: sourceRoot.replace(/\\/g, '/')
  4923. });
  4924. map.setSourceContent(filename, source);
  4925. generated.split(splitRE).forEach((line, index) => {
  4926. if (!emptyRE.test(line)) {
  4927. const originalLine = index + 1 + lineOffset;
  4928. const generatedLine = index + 1;
  4929. for (let i = 0; i < line.length; i++) {
  4930. if (!/\s/.test(line[i])) {
  4931. map.addMapping({
  4932. source: filename,
  4933. original: {
  4934. line: originalLine,
  4935. column: i
  4936. },
  4937. generated: {
  4938. line: generatedLine,
  4939. column: i
  4940. }
  4941. });
  4942. }
  4943. }
  4944. }
  4945. });
  4946. return JSON.parse(map.toString());
  4947. }
  4948. function padContent(content, block, pad) {
  4949. content = content.slice(0, block.loc.start.offset);
  4950. if (pad === 'space') {
  4951. return content.replace(replaceRE, ' ');
  4952. }
  4953. else {
  4954. const offset = content.split(splitRE).length;
  4955. const padChar = block.type === 'script' && !block.lang ? '//\n' : '\n';
  4956. return Array(offset).join(padChar);
  4957. }
  4958. }
  4959. function hasSrc(node) {
  4960. return node.props.some(p => {
  4961. if (p.type !== 6 /* NodeTypes.ATTRIBUTE */) {
  4962. return false;
  4963. }
  4964. return p.name === 'src';
  4965. });
  4966. }
  4967. /**
  4968. * Returns true if the node has no children
  4969. * once the empty text nodes (trimmed content) have been filtered out.
  4970. */
  4971. function isEmpty(node) {
  4972. for (let i = 0; i < node.children.length; i++) {
  4973. const child = node.children[i];
  4974. if (child.type !== 2 /* NodeTypes.TEXT */ || child.content.trim() !== '') {
  4975. return false;
  4976. }
  4977. }
  4978. return true;
  4979. }
  4980. const trimPlugin = () => {
  4981. return {
  4982. postcssPlugin: 'vue-sfc-trim',
  4983. Once(root) {
  4984. root.walk(({ type, raws }) => {
  4985. if (type === 'rule' || type === 'atrule') {
  4986. if (raws.before)
  4987. raws.before = '\n';
  4988. if ('after' in raws && raws.after)
  4989. raws.after = '\n';
  4990. }
  4991. });
  4992. }
  4993. };
  4994. };
  4995. trimPlugin.postcss = true;
  4996. var trimPlugin$1 = trimPlugin;
  4997. var dist = {exports: {}};
  4998. var processor = {exports: {}};
  4999. var parser$1 = {exports: {}};
  5000. var root$2 = {exports: {}};
  5001. var container = {exports: {}};
  5002. var node$1 = {exports: {}};
  5003. var util$1 = {};
  5004. var unesc = {exports: {}};
  5005. (function (module, exports) {
  5006. exports.__esModule = true;
  5007. exports["default"] = unesc;
  5008. // Many thanks for this post which made this migration much easier.
  5009. // https://mathiasbynens.be/notes/css-escapes
  5010. /**
  5011. *
  5012. * @param {string} str
  5013. * @returns {[string, number]|undefined}
  5014. */
  5015. function gobbleHex(str) {
  5016. var lower = str.toLowerCase();
  5017. var hex = '';
  5018. var spaceTerminated = false;
  5019. for (var i = 0; i < 6 && lower[i] !== undefined; i++) {
  5020. var code = lower.charCodeAt(i); // check to see if we are dealing with a valid hex char [a-f|0-9]
  5021. var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point
  5022. spaceTerminated = code === 32;
  5023. if (!valid) {
  5024. break;
  5025. }
  5026. hex += lower[i];
  5027. }
  5028. if (hex.length === 0) {
  5029. return undefined;
  5030. }
  5031. var codePoint = parseInt(hex, 16);
  5032. var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF; // Add special case for
  5033. // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point"
  5034. // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point
  5035. if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) {
  5036. return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)];
  5037. }
  5038. return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)];
  5039. }
  5040. var CONTAINS_ESCAPE = /\\/;
  5041. function unesc(str) {
  5042. var needToProcess = CONTAINS_ESCAPE.test(str);
  5043. if (!needToProcess) {
  5044. return str;
  5045. }
  5046. var ret = "";
  5047. for (var i = 0; i < str.length; i++) {
  5048. if (str[i] === "\\") {
  5049. var gobbled = gobbleHex(str.slice(i + 1, i + 7));
  5050. if (gobbled !== undefined) {
  5051. ret += gobbled[0];
  5052. i += gobbled[1];
  5053. continue;
  5054. } // Retain a pair of \\ if double escaped `\\\\`
  5055. // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e
  5056. if (str[i + 1] === "\\") {
  5057. ret += "\\";
  5058. i++;
  5059. continue;
  5060. } // if \\ is at the end of the string retain it
  5061. // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb
  5062. if (str.length === i + 1) {
  5063. ret += str[i];
  5064. }
  5065. continue;
  5066. }
  5067. ret += str[i];
  5068. }
  5069. return ret;
  5070. }
  5071. module.exports = exports.default;
  5072. } (unesc, unesc.exports));
  5073. var getProp = {exports: {}};
  5074. (function (module, exports) {
  5075. exports.__esModule = true;
  5076. exports["default"] = getProp;
  5077. function getProp(obj) {
  5078. for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  5079. props[_key - 1] = arguments[_key];
  5080. }
  5081. while (props.length > 0) {
  5082. var prop = props.shift();
  5083. if (!obj[prop]) {
  5084. return undefined;
  5085. }
  5086. obj = obj[prop];
  5087. }
  5088. return obj;
  5089. }
  5090. module.exports = exports.default;
  5091. } (getProp, getProp.exports));
  5092. var ensureObject = {exports: {}};
  5093. (function (module, exports) {
  5094. exports.__esModule = true;
  5095. exports["default"] = ensureObject;
  5096. function ensureObject(obj) {
  5097. for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  5098. props[_key - 1] = arguments[_key];
  5099. }
  5100. while (props.length > 0) {
  5101. var prop = props.shift();
  5102. if (!obj[prop]) {
  5103. obj[prop] = {};
  5104. }
  5105. obj = obj[prop];
  5106. }
  5107. }
  5108. module.exports = exports.default;
  5109. } (ensureObject, ensureObject.exports));
  5110. var stripComments = {exports: {}};
  5111. (function (module, exports) {
  5112. exports.__esModule = true;
  5113. exports["default"] = stripComments;
  5114. function stripComments(str) {
  5115. var s = "";
  5116. var commentStart = str.indexOf("/*");
  5117. var lastEnd = 0;
  5118. while (commentStart >= 0) {
  5119. s = s + str.slice(lastEnd, commentStart);
  5120. var commentEnd = str.indexOf("*/", commentStart + 2);
  5121. if (commentEnd < 0) {
  5122. return s;
  5123. }
  5124. lastEnd = commentEnd + 2;
  5125. commentStart = str.indexOf("/*", lastEnd);
  5126. }
  5127. s = s + str.slice(lastEnd);
  5128. return s;
  5129. }
  5130. module.exports = exports.default;
  5131. } (stripComments, stripComments.exports));
  5132. util$1.__esModule = true;
  5133. util$1.stripComments = util$1.ensureObject = util$1.getProp = util$1.unesc = void 0;
  5134. var _unesc = _interopRequireDefault$6(unesc.exports);
  5135. util$1.unesc = _unesc["default"];
  5136. var _getProp = _interopRequireDefault$6(getProp.exports);
  5137. util$1.getProp = _getProp["default"];
  5138. var _ensureObject = _interopRequireDefault$6(ensureObject.exports);
  5139. util$1.ensureObject = _ensureObject["default"];
  5140. var _stripComments = _interopRequireDefault$6(stripComments.exports);
  5141. util$1.stripComments = _stripComments["default"];
  5142. function _interopRequireDefault$6(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5143. (function (module, exports) {
  5144. exports.__esModule = true;
  5145. exports["default"] = void 0;
  5146. var _util = util$1;
  5147. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5148. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5149. var cloneNode = function cloneNode(obj, parent) {
  5150. if (typeof obj !== 'object' || obj === null) {
  5151. return obj;
  5152. }
  5153. var cloned = new obj.constructor();
  5154. for (var i in obj) {
  5155. if (!obj.hasOwnProperty(i)) {
  5156. continue;
  5157. }
  5158. var value = obj[i];
  5159. var type = typeof value;
  5160. if (i === 'parent' && type === 'object') {
  5161. if (parent) {
  5162. cloned[i] = parent;
  5163. }
  5164. } else if (value instanceof Array) {
  5165. cloned[i] = value.map(function (j) {
  5166. return cloneNode(j, cloned);
  5167. });
  5168. } else {
  5169. cloned[i] = cloneNode(value, cloned);
  5170. }
  5171. }
  5172. return cloned;
  5173. };
  5174. var Node = /*#__PURE__*/function () {
  5175. function Node(opts) {
  5176. if (opts === void 0) {
  5177. opts = {};
  5178. }
  5179. Object.assign(this, opts);
  5180. this.spaces = this.spaces || {};
  5181. this.spaces.before = this.spaces.before || '';
  5182. this.spaces.after = this.spaces.after || '';
  5183. }
  5184. var _proto = Node.prototype;
  5185. _proto.remove = function remove() {
  5186. if (this.parent) {
  5187. this.parent.removeChild(this);
  5188. }
  5189. this.parent = undefined;
  5190. return this;
  5191. };
  5192. _proto.replaceWith = function replaceWith() {
  5193. if (this.parent) {
  5194. for (var index in arguments) {
  5195. this.parent.insertBefore(this, arguments[index]);
  5196. }
  5197. this.remove();
  5198. }
  5199. return this;
  5200. };
  5201. _proto.next = function next() {
  5202. return this.parent.at(this.parent.index(this) + 1);
  5203. };
  5204. _proto.prev = function prev() {
  5205. return this.parent.at(this.parent.index(this) - 1);
  5206. };
  5207. _proto.clone = function clone(overrides) {
  5208. if (overrides === void 0) {
  5209. overrides = {};
  5210. }
  5211. var cloned = cloneNode(this);
  5212. for (var name in overrides) {
  5213. cloned[name] = overrides[name];
  5214. }
  5215. return cloned;
  5216. }
  5217. /**
  5218. * Some non-standard syntax doesn't follow normal escaping rules for css.
  5219. * This allows non standard syntax to be appended to an existing property
  5220. * by specifying the escaped value. By specifying the escaped value,
  5221. * illegal characters are allowed to be directly inserted into css output.
  5222. * @param {string} name the property to set
  5223. * @param {any} value the unescaped value of the property
  5224. * @param {string} valueEscaped optional. the escaped value of the property.
  5225. */
  5226. ;
  5227. _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) {
  5228. if (!this.raws) {
  5229. this.raws = {};
  5230. }
  5231. var originalValue = this[name];
  5232. var originalEscaped = this.raws[name];
  5233. this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first.
  5234. if (originalEscaped || valueEscaped !== value) {
  5235. this.raws[name] = (originalEscaped || originalValue) + valueEscaped;
  5236. } else {
  5237. delete this.raws[name]; // delete any escaped value that was created by the setter.
  5238. }
  5239. }
  5240. /**
  5241. * Some non-standard syntax doesn't follow normal escaping rules for css.
  5242. * This allows the escaped value to be specified directly, allowing illegal
  5243. * characters to be directly inserted into css output.
  5244. * @param {string} name the property to set
  5245. * @param {any} value the unescaped value of the property
  5246. * @param {string} valueEscaped the escaped value of the property.
  5247. */
  5248. ;
  5249. _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) {
  5250. if (!this.raws) {
  5251. this.raws = {};
  5252. }
  5253. this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
  5254. this.raws[name] = valueEscaped;
  5255. }
  5256. /**
  5257. * When you want a value to passed through to CSS directly. This method
  5258. * deletes the corresponding raw value causing the stringifier to fallback
  5259. * to the unescaped value.
  5260. * @param {string} name the property to set.
  5261. * @param {any} value The value that is both escaped and unescaped.
  5262. */
  5263. ;
  5264. _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) {
  5265. this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
  5266. if (this.raws) {
  5267. delete this.raws[name];
  5268. }
  5269. }
  5270. /**
  5271. *
  5272. * @param {number} line The number (starting with 1)
  5273. * @param {number} column The column number (starting with 1)
  5274. */
  5275. ;
  5276. _proto.isAtPosition = function isAtPosition(line, column) {
  5277. if (this.source && this.source.start && this.source.end) {
  5278. if (this.source.start.line > line) {
  5279. return false;
  5280. }
  5281. if (this.source.end.line < line) {
  5282. return false;
  5283. }
  5284. if (this.source.start.line === line && this.source.start.column > column) {
  5285. return false;
  5286. }
  5287. if (this.source.end.line === line && this.source.end.column < column) {
  5288. return false;
  5289. }
  5290. return true;
  5291. }
  5292. return undefined;
  5293. };
  5294. _proto.stringifyProperty = function stringifyProperty(name) {
  5295. return this.raws && this.raws[name] || this[name];
  5296. };
  5297. _proto.valueToString = function valueToString() {
  5298. return String(this.stringifyProperty("value"));
  5299. };
  5300. _proto.toString = function toString() {
  5301. return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join('');
  5302. };
  5303. _createClass(Node, [{
  5304. key: "rawSpaceBefore",
  5305. get: function get() {
  5306. var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;
  5307. if (rawSpace === undefined) {
  5308. rawSpace = this.spaces && this.spaces.before;
  5309. }
  5310. return rawSpace || "";
  5311. },
  5312. set: function set(raw) {
  5313. (0, _util.ensureObject)(this, "raws", "spaces");
  5314. this.raws.spaces.before = raw;
  5315. }
  5316. }, {
  5317. key: "rawSpaceAfter",
  5318. get: function get() {
  5319. var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;
  5320. if (rawSpace === undefined) {
  5321. rawSpace = this.spaces.after;
  5322. }
  5323. return rawSpace || "";
  5324. },
  5325. set: function set(raw) {
  5326. (0, _util.ensureObject)(this, "raws", "spaces");
  5327. this.raws.spaces.after = raw;
  5328. }
  5329. }]);
  5330. return Node;
  5331. }();
  5332. exports["default"] = Node;
  5333. module.exports = exports.default;
  5334. } (node$1, node$1.exports));
  5335. var types = {};
  5336. types.__esModule = true;
  5337. types.UNIVERSAL = types.ATTRIBUTE = types.CLASS = types.COMBINATOR = types.COMMENT = types.ID = types.NESTING = types.PSEUDO = types.ROOT = types.SELECTOR = types.STRING = types.TAG = void 0;
  5338. var TAG = 'tag';
  5339. types.TAG = TAG;
  5340. var STRING = 'string';
  5341. types.STRING = STRING;
  5342. var SELECTOR = 'selector';
  5343. types.SELECTOR = SELECTOR;
  5344. var ROOT = 'root';
  5345. types.ROOT = ROOT;
  5346. var PSEUDO = 'pseudo';
  5347. types.PSEUDO = PSEUDO;
  5348. var NESTING = 'nesting';
  5349. types.NESTING = NESTING;
  5350. var ID = 'id';
  5351. types.ID = ID;
  5352. var COMMENT = 'comment';
  5353. types.COMMENT = COMMENT;
  5354. var COMBINATOR = 'combinator';
  5355. types.COMBINATOR = COMBINATOR;
  5356. var CLASS = 'class';
  5357. types.CLASS = CLASS;
  5358. var ATTRIBUTE = 'attribute';
  5359. types.ATTRIBUTE = ATTRIBUTE;
  5360. var UNIVERSAL = 'universal';
  5361. types.UNIVERSAL = UNIVERSAL;
  5362. (function (module, exports) {
  5363. exports.__esModule = true;
  5364. exports["default"] = void 0;
  5365. var _node = _interopRequireDefault(node$1.exports);
  5366. var types$1 = _interopRequireWildcard(types);
  5367. function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
  5368. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  5369. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5370. function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }
  5371. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  5372. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  5373. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5374. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5375. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  5376. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5377. var Container = /*#__PURE__*/function (_Node) {
  5378. _inheritsLoose(Container, _Node);
  5379. function Container(opts) {
  5380. var _this;
  5381. _this = _Node.call(this, opts) || this;
  5382. if (!_this.nodes) {
  5383. _this.nodes = [];
  5384. }
  5385. return _this;
  5386. }
  5387. var _proto = Container.prototype;
  5388. _proto.append = function append(selector) {
  5389. selector.parent = this;
  5390. this.nodes.push(selector);
  5391. return this;
  5392. };
  5393. _proto.prepend = function prepend(selector) {
  5394. selector.parent = this;
  5395. this.nodes.unshift(selector);
  5396. return this;
  5397. };
  5398. _proto.at = function at(index) {
  5399. return this.nodes[index];
  5400. };
  5401. _proto.index = function index(child) {
  5402. if (typeof child === 'number') {
  5403. return child;
  5404. }
  5405. return this.nodes.indexOf(child);
  5406. };
  5407. _proto.removeChild = function removeChild(child) {
  5408. child = this.index(child);
  5409. this.at(child).parent = undefined;
  5410. this.nodes.splice(child, 1);
  5411. var index;
  5412. for (var id in this.indexes) {
  5413. index = this.indexes[id];
  5414. if (index >= child) {
  5415. this.indexes[id] = index - 1;
  5416. }
  5417. }
  5418. return this;
  5419. };
  5420. _proto.removeAll = function removeAll() {
  5421. for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) {
  5422. var node = _step.value;
  5423. node.parent = undefined;
  5424. }
  5425. this.nodes = [];
  5426. return this;
  5427. };
  5428. _proto.empty = function empty() {
  5429. return this.removeAll();
  5430. };
  5431. _proto.insertAfter = function insertAfter(oldNode, newNode) {
  5432. newNode.parent = this;
  5433. var oldIndex = this.index(oldNode);
  5434. this.nodes.splice(oldIndex + 1, 0, newNode);
  5435. newNode.parent = this;
  5436. var index;
  5437. for (var id in this.indexes) {
  5438. index = this.indexes[id];
  5439. if (oldIndex <= index) {
  5440. this.indexes[id] = index + 1;
  5441. }
  5442. }
  5443. return this;
  5444. };
  5445. _proto.insertBefore = function insertBefore(oldNode, newNode) {
  5446. newNode.parent = this;
  5447. var oldIndex = this.index(oldNode);
  5448. this.nodes.splice(oldIndex, 0, newNode);
  5449. newNode.parent = this;
  5450. var index;
  5451. for (var id in this.indexes) {
  5452. index = this.indexes[id];
  5453. if (index <= oldIndex) {
  5454. this.indexes[id] = index + 1;
  5455. }
  5456. }
  5457. return this;
  5458. };
  5459. _proto._findChildAtPosition = function _findChildAtPosition(line, col) {
  5460. var found = undefined;
  5461. this.each(function (node) {
  5462. if (node.atPosition) {
  5463. var foundChild = node.atPosition(line, col);
  5464. if (foundChild) {
  5465. found = foundChild;
  5466. return false;
  5467. }
  5468. } else if (node.isAtPosition(line, col)) {
  5469. found = node;
  5470. return false;
  5471. }
  5472. });
  5473. return found;
  5474. }
  5475. /**
  5476. * Return the most specific node at the line and column number given.
  5477. * The source location is based on the original parsed location, locations aren't
  5478. * updated as selector nodes are mutated.
  5479. *
  5480. * Note that this location is relative to the location of the first character
  5481. * of the selector, and not the location of the selector in the overall document
  5482. * when used in conjunction with postcss.
  5483. *
  5484. * If not found, returns undefined.
  5485. * @param {number} line The line number of the node to find. (1-based index)
  5486. * @param {number} col The column number of the node to find. (1-based index)
  5487. */
  5488. ;
  5489. _proto.atPosition = function atPosition(line, col) {
  5490. if (this.isAtPosition(line, col)) {
  5491. return this._findChildAtPosition(line, col) || this;
  5492. } else {
  5493. return undefined;
  5494. }
  5495. };
  5496. _proto._inferEndPosition = function _inferEndPosition() {
  5497. if (this.last && this.last.source && this.last.source.end) {
  5498. this.source = this.source || {};
  5499. this.source.end = this.source.end || {};
  5500. Object.assign(this.source.end, this.last.source.end);
  5501. }
  5502. };
  5503. _proto.each = function each(callback) {
  5504. if (!this.lastEach) {
  5505. this.lastEach = 0;
  5506. }
  5507. if (!this.indexes) {
  5508. this.indexes = {};
  5509. }
  5510. this.lastEach++;
  5511. var id = this.lastEach;
  5512. this.indexes[id] = 0;
  5513. if (!this.length) {
  5514. return undefined;
  5515. }
  5516. var index, result;
  5517. while (this.indexes[id] < this.length) {
  5518. index = this.indexes[id];
  5519. result = callback(this.at(index), index);
  5520. if (result === false) {
  5521. break;
  5522. }
  5523. this.indexes[id] += 1;
  5524. }
  5525. delete this.indexes[id];
  5526. if (result === false) {
  5527. return false;
  5528. }
  5529. };
  5530. _proto.walk = function walk(callback) {
  5531. return this.each(function (node, i) {
  5532. var result = callback(node, i);
  5533. if (result !== false && node.length) {
  5534. result = node.walk(callback);
  5535. }
  5536. if (result === false) {
  5537. return false;
  5538. }
  5539. });
  5540. };
  5541. _proto.walkAttributes = function walkAttributes(callback) {
  5542. var _this2 = this;
  5543. return this.walk(function (selector) {
  5544. if (selector.type === types$1.ATTRIBUTE) {
  5545. return callback.call(_this2, selector);
  5546. }
  5547. });
  5548. };
  5549. _proto.walkClasses = function walkClasses(callback) {
  5550. var _this3 = this;
  5551. return this.walk(function (selector) {
  5552. if (selector.type === types$1.CLASS) {
  5553. return callback.call(_this3, selector);
  5554. }
  5555. });
  5556. };
  5557. _proto.walkCombinators = function walkCombinators(callback) {
  5558. var _this4 = this;
  5559. return this.walk(function (selector) {
  5560. if (selector.type === types$1.COMBINATOR) {
  5561. return callback.call(_this4, selector);
  5562. }
  5563. });
  5564. };
  5565. _proto.walkComments = function walkComments(callback) {
  5566. var _this5 = this;
  5567. return this.walk(function (selector) {
  5568. if (selector.type === types$1.COMMENT) {
  5569. return callback.call(_this5, selector);
  5570. }
  5571. });
  5572. };
  5573. _proto.walkIds = function walkIds(callback) {
  5574. var _this6 = this;
  5575. return this.walk(function (selector) {
  5576. if (selector.type === types$1.ID) {
  5577. return callback.call(_this6, selector);
  5578. }
  5579. });
  5580. };
  5581. _proto.walkNesting = function walkNesting(callback) {
  5582. var _this7 = this;
  5583. return this.walk(function (selector) {
  5584. if (selector.type === types$1.NESTING) {
  5585. return callback.call(_this7, selector);
  5586. }
  5587. });
  5588. };
  5589. _proto.walkPseudos = function walkPseudos(callback) {
  5590. var _this8 = this;
  5591. return this.walk(function (selector) {
  5592. if (selector.type === types$1.PSEUDO) {
  5593. return callback.call(_this8, selector);
  5594. }
  5595. });
  5596. };
  5597. _proto.walkTags = function walkTags(callback) {
  5598. var _this9 = this;
  5599. return this.walk(function (selector) {
  5600. if (selector.type === types$1.TAG) {
  5601. return callback.call(_this9, selector);
  5602. }
  5603. });
  5604. };
  5605. _proto.walkUniversals = function walkUniversals(callback) {
  5606. var _this10 = this;
  5607. return this.walk(function (selector) {
  5608. if (selector.type === types$1.UNIVERSAL) {
  5609. return callback.call(_this10, selector);
  5610. }
  5611. });
  5612. };
  5613. _proto.split = function split(callback) {
  5614. var _this11 = this;
  5615. var current = [];
  5616. return this.reduce(function (memo, node, index) {
  5617. var split = callback.call(_this11, node);
  5618. current.push(node);
  5619. if (split) {
  5620. memo.push(current);
  5621. current = [];
  5622. } else if (index === _this11.length - 1) {
  5623. memo.push(current);
  5624. }
  5625. return memo;
  5626. }, []);
  5627. };
  5628. _proto.map = function map(callback) {
  5629. return this.nodes.map(callback);
  5630. };
  5631. _proto.reduce = function reduce(callback, memo) {
  5632. return this.nodes.reduce(callback, memo);
  5633. };
  5634. _proto.every = function every(callback) {
  5635. return this.nodes.every(callback);
  5636. };
  5637. _proto.some = function some(callback) {
  5638. return this.nodes.some(callback);
  5639. };
  5640. _proto.filter = function filter(callback) {
  5641. return this.nodes.filter(callback);
  5642. };
  5643. _proto.sort = function sort(callback) {
  5644. return this.nodes.sort(callback);
  5645. };
  5646. _proto.toString = function toString() {
  5647. return this.map(String).join('');
  5648. };
  5649. _createClass(Container, [{
  5650. key: "first",
  5651. get: function get() {
  5652. return this.at(0);
  5653. }
  5654. }, {
  5655. key: "last",
  5656. get: function get() {
  5657. return this.at(this.length - 1);
  5658. }
  5659. }, {
  5660. key: "length",
  5661. get: function get() {
  5662. return this.nodes.length;
  5663. }
  5664. }]);
  5665. return Container;
  5666. }(_node["default"]);
  5667. exports["default"] = Container;
  5668. module.exports = exports.default;
  5669. } (container, container.exports));
  5670. (function (module, exports) {
  5671. exports.__esModule = true;
  5672. exports["default"] = void 0;
  5673. var _container = _interopRequireDefault(container.exports);
  5674. var _types = types;
  5675. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5676. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5677. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5678. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  5679. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5680. var Root = /*#__PURE__*/function (_Container) {
  5681. _inheritsLoose(Root, _Container);
  5682. function Root(opts) {
  5683. var _this;
  5684. _this = _Container.call(this, opts) || this;
  5685. _this.type = _types.ROOT;
  5686. return _this;
  5687. }
  5688. var _proto = Root.prototype;
  5689. _proto.toString = function toString() {
  5690. var str = this.reduce(function (memo, selector) {
  5691. memo.push(String(selector));
  5692. return memo;
  5693. }, []).join(',');
  5694. return this.trailingComma ? str + ',' : str;
  5695. };
  5696. _proto.error = function error(message, options) {
  5697. if (this._error) {
  5698. return this._error(message, options);
  5699. } else {
  5700. return new Error(message);
  5701. }
  5702. };
  5703. _createClass(Root, [{
  5704. key: "errorGenerator",
  5705. set: function set(handler) {
  5706. this._error = handler;
  5707. }
  5708. }]);
  5709. return Root;
  5710. }(_container["default"]);
  5711. exports["default"] = Root;
  5712. module.exports = exports.default;
  5713. } (root$2, root$2.exports));
  5714. var selector$1 = {exports: {}};
  5715. (function (module, exports) {
  5716. exports.__esModule = true;
  5717. exports["default"] = void 0;
  5718. var _container = _interopRequireDefault(container.exports);
  5719. var _types = types;
  5720. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5721. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  5722. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5723. var Selector = /*#__PURE__*/function (_Container) {
  5724. _inheritsLoose(Selector, _Container);
  5725. function Selector(opts) {
  5726. var _this;
  5727. _this = _Container.call(this, opts) || this;
  5728. _this.type = _types.SELECTOR;
  5729. return _this;
  5730. }
  5731. return Selector;
  5732. }(_container["default"]);
  5733. exports["default"] = Selector;
  5734. module.exports = exports.default;
  5735. } (selector$1, selector$1.exports));
  5736. var className$1 = {exports: {}};
  5737. /*! https://mths.be/cssesc v3.0.0 by @mathias */
  5738. var object = {};
  5739. var hasOwnProperty$1 = object.hasOwnProperty;
  5740. var merge$2 = function merge(options, defaults) {
  5741. if (!options) {
  5742. return defaults;
  5743. }
  5744. var result = {};
  5745. for (var key in defaults) {
  5746. // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since
  5747. // only recognized option names are used.
  5748. result[key] = hasOwnProperty$1.call(options, key) ? options[key] : defaults[key];
  5749. }
  5750. return result;
  5751. };
  5752. var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/;
  5753. var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/;
  5754. var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
  5755. // https://mathiasbynens.be/notes/css-escapes#css
  5756. var cssesc = function cssesc(string, options) {
  5757. options = merge$2(options, cssesc.options);
  5758. if (options.quotes != 'single' && options.quotes != 'double') {
  5759. options.quotes = 'single';
  5760. }
  5761. var quote = options.quotes == 'double' ? '"' : '\'';
  5762. var isIdentifier = options.isIdentifier;
  5763. var firstChar = string.charAt(0);
  5764. var output = '';
  5765. var counter = 0;
  5766. var length = string.length;
  5767. while (counter < length) {
  5768. var character = string.charAt(counter++);
  5769. var codePoint = character.charCodeAt();
  5770. var value = void 0;
  5771. // If it’s not a printable ASCII character…
  5772. if (codePoint < 0x20 || codePoint > 0x7E) {
  5773. if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) {
  5774. // It’s a high surrogate, and there is a next character.
  5775. var extra = string.charCodeAt(counter++);
  5776. if ((extra & 0xFC00) == 0xDC00) {
  5777. // next character is low surrogate
  5778. codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;
  5779. } else {
  5780. // It’s an unmatched surrogate; only append this code unit, in case
  5781. // the next code unit is the high surrogate of a surrogate pair.
  5782. counter--;
  5783. }
  5784. }
  5785. value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
  5786. } else {
  5787. if (options.escapeEverything) {
  5788. if (regexAnySingleEscape.test(character)) {
  5789. value = '\\' + character;
  5790. } else {
  5791. value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
  5792. }
  5793. } else if (/[\t\n\f\r\x0B]/.test(character)) {
  5794. value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
  5795. } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) {
  5796. value = '\\' + character;
  5797. } else {
  5798. value = character;
  5799. }
  5800. }
  5801. output += value;
  5802. }
  5803. if (isIdentifier) {
  5804. if (/^-[-\d]/.test(output)) {
  5805. output = '\\-' + output.slice(1);
  5806. } else if (/\d/.test(firstChar)) {
  5807. output = '\\3' + firstChar + ' ' + output.slice(1);
  5808. }
  5809. }
  5810. // Remove spaces after `\HEX` escapes that are not followed by a hex digit,
  5811. // since they’re redundant. Note that this is only possible if the escape
  5812. // sequence isn’t preceded by an odd number of backslashes.
  5813. output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {
  5814. if ($1 && $1.length % 2) {
  5815. // It’s not safe to remove the space, so don’t.
  5816. return $0;
  5817. }
  5818. // Strip the space.
  5819. return ($1 || '') + $2;
  5820. });
  5821. if (!isIdentifier && options.wrap) {
  5822. return quote + output + quote;
  5823. }
  5824. return output;
  5825. };
  5826. // Expose default options (so they can be overridden globally).
  5827. cssesc.options = {
  5828. 'escapeEverything': false,
  5829. 'isIdentifier': false,
  5830. 'quotes': 'single',
  5831. 'wrap': false
  5832. };
  5833. cssesc.version = '3.0.0';
  5834. var cssesc_1 = cssesc;
  5835. (function (module, exports) {
  5836. exports.__esModule = true;
  5837. exports["default"] = void 0;
  5838. var _cssesc = _interopRequireDefault(cssesc_1);
  5839. var _util = util$1;
  5840. var _node = _interopRequireDefault(node$1.exports);
  5841. var _types = types;
  5842. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5843. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5844. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5845. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  5846. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5847. var ClassName = /*#__PURE__*/function (_Node) {
  5848. _inheritsLoose(ClassName, _Node);
  5849. function ClassName(opts) {
  5850. var _this;
  5851. _this = _Node.call(this, opts) || this;
  5852. _this.type = _types.CLASS;
  5853. _this._constructed = true;
  5854. return _this;
  5855. }
  5856. var _proto = ClassName.prototype;
  5857. _proto.valueToString = function valueToString() {
  5858. return '.' + _Node.prototype.valueToString.call(this);
  5859. };
  5860. _createClass(ClassName, [{
  5861. key: "value",
  5862. get: function get() {
  5863. return this._value;
  5864. },
  5865. set: function set(v) {
  5866. if (this._constructed) {
  5867. var escaped = (0, _cssesc["default"])(v, {
  5868. isIdentifier: true
  5869. });
  5870. if (escaped !== v) {
  5871. (0, _util.ensureObject)(this, "raws");
  5872. this.raws.value = escaped;
  5873. } else if (this.raws) {
  5874. delete this.raws.value;
  5875. }
  5876. }
  5877. this._value = v;
  5878. }
  5879. }]);
  5880. return ClassName;
  5881. }(_node["default"]);
  5882. exports["default"] = ClassName;
  5883. module.exports = exports.default;
  5884. } (className$1, className$1.exports));
  5885. var comment$2 = {exports: {}};
  5886. (function (module, exports) {
  5887. exports.__esModule = true;
  5888. exports["default"] = void 0;
  5889. var _node = _interopRequireDefault(node$1.exports);
  5890. var _types = types;
  5891. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5892. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  5893. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5894. var Comment = /*#__PURE__*/function (_Node) {
  5895. _inheritsLoose(Comment, _Node);
  5896. function Comment(opts) {
  5897. var _this;
  5898. _this = _Node.call(this, opts) || this;
  5899. _this.type = _types.COMMENT;
  5900. return _this;
  5901. }
  5902. return Comment;
  5903. }(_node["default"]);
  5904. exports["default"] = Comment;
  5905. module.exports = exports.default;
  5906. } (comment$2, comment$2.exports));
  5907. var id$1 = {exports: {}};
  5908. (function (module, exports) {
  5909. exports.__esModule = true;
  5910. exports["default"] = void 0;
  5911. var _node = _interopRequireDefault(node$1.exports);
  5912. var _types = types;
  5913. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5914. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  5915. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5916. var ID = /*#__PURE__*/function (_Node) {
  5917. _inheritsLoose(ID, _Node);
  5918. function ID(opts) {
  5919. var _this;
  5920. _this = _Node.call(this, opts) || this;
  5921. _this.type = _types.ID;
  5922. return _this;
  5923. }
  5924. var _proto = ID.prototype;
  5925. _proto.valueToString = function valueToString() {
  5926. return '#' + _Node.prototype.valueToString.call(this);
  5927. };
  5928. return ID;
  5929. }(_node["default"]);
  5930. exports["default"] = ID;
  5931. module.exports = exports.default;
  5932. } (id$1, id$1.exports));
  5933. var tag$1 = {exports: {}};
  5934. var namespace = {exports: {}};
  5935. (function (module, exports) {
  5936. exports.__esModule = true;
  5937. exports["default"] = void 0;
  5938. var _cssesc = _interopRequireDefault(cssesc_1);
  5939. var _util = util$1;
  5940. var _node = _interopRequireDefault(node$1.exports);
  5941. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  5942. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  5943. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  5944. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  5945. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5946. var Namespace = /*#__PURE__*/function (_Node) {
  5947. _inheritsLoose(Namespace, _Node);
  5948. function Namespace() {
  5949. return _Node.apply(this, arguments) || this;
  5950. }
  5951. var _proto = Namespace.prototype;
  5952. _proto.qualifiedName = function qualifiedName(value) {
  5953. if (this.namespace) {
  5954. return this.namespaceString + "|" + value;
  5955. } else {
  5956. return value;
  5957. }
  5958. };
  5959. _proto.valueToString = function valueToString() {
  5960. return this.qualifiedName(_Node.prototype.valueToString.call(this));
  5961. };
  5962. _createClass(Namespace, [{
  5963. key: "namespace",
  5964. get: function get() {
  5965. return this._namespace;
  5966. },
  5967. set: function set(namespace) {
  5968. if (namespace === true || namespace === "*" || namespace === "&") {
  5969. this._namespace = namespace;
  5970. if (this.raws) {
  5971. delete this.raws.namespace;
  5972. }
  5973. return;
  5974. }
  5975. var escaped = (0, _cssesc["default"])(namespace, {
  5976. isIdentifier: true
  5977. });
  5978. this._namespace = namespace;
  5979. if (escaped !== namespace) {
  5980. (0, _util.ensureObject)(this, "raws");
  5981. this.raws.namespace = escaped;
  5982. } else if (this.raws) {
  5983. delete this.raws.namespace;
  5984. }
  5985. }
  5986. }, {
  5987. key: "ns",
  5988. get: function get() {
  5989. return this._namespace;
  5990. },
  5991. set: function set(namespace) {
  5992. this.namespace = namespace;
  5993. }
  5994. }, {
  5995. key: "namespaceString",
  5996. get: function get() {
  5997. if (this.namespace) {
  5998. var ns = this.stringifyProperty("namespace");
  5999. if (ns === true) {
  6000. return '';
  6001. } else {
  6002. return ns;
  6003. }
  6004. } else {
  6005. return '';
  6006. }
  6007. }
  6008. }]);
  6009. return Namespace;
  6010. }(_node["default"]);
  6011. exports["default"] = Namespace;
  6012. module.exports = exports.default;
  6013. } (namespace, namespace.exports));
  6014. (function (module, exports) {
  6015. exports.__esModule = true;
  6016. exports["default"] = void 0;
  6017. var _namespace = _interopRequireDefault(namespace.exports);
  6018. var _types = types;
  6019. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6020. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  6021. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6022. var Tag = /*#__PURE__*/function (_Namespace) {
  6023. _inheritsLoose(Tag, _Namespace);
  6024. function Tag(opts) {
  6025. var _this;
  6026. _this = _Namespace.call(this, opts) || this;
  6027. _this.type = _types.TAG;
  6028. return _this;
  6029. }
  6030. return Tag;
  6031. }(_namespace["default"]);
  6032. exports["default"] = Tag;
  6033. module.exports = exports.default;
  6034. } (tag$1, tag$1.exports));
  6035. var string$1 = {exports: {}};
  6036. (function (module, exports) {
  6037. exports.__esModule = true;
  6038. exports["default"] = void 0;
  6039. var _node = _interopRequireDefault(node$1.exports);
  6040. var _types = types;
  6041. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6042. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  6043. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6044. var String = /*#__PURE__*/function (_Node) {
  6045. _inheritsLoose(String, _Node);
  6046. function String(opts) {
  6047. var _this;
  6048. _this = _Node.call(this, opts) || this;
  6049. _this.type = _types.STRING;
  6050. return _this;
  6051. }
  6052. return String;
  6053. }(_node["default"]);
  6054. exports["default"] = String;
  6055. module.exports = exports.default;
  6056. } (string$1, string$1.exports));
  6057. var pseudo$1 = {exports: {}};
  6058. (function (module, exports) {
  6059. exports.__esModule = true;
  6060. exports["default"] = void 0;
  6061. var _container = _interopRequireDefault(container.exports);
  6062. var _types = types;
  6063. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6064. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  6065. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6066. var Pseudo = /*#__PURE__*/function (_Container) {
  6067. _inheritsLoose(Pseudo, _Container);
  6068. function Pseudo(opts) {
  6069. var _this;
  6070. _this = _Container.call(this, opts) || this;
  6071. _this.type = _types.PSEUDO;
  6072. return _this;
  6073. }
  6074. var _proto = Pseudo.prototype;
  6075. _proto.toString = function toString() {
  6076. var params = this.length ? '(' + this.map(String).join(',') + ')' : '';
  6077. return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join('');
  6078. };
  6079. return Pseudo;
  6080. }(_container["default"]);
  6081. exports["default"] = Pseudo;
  6082. module.exports = exports.default;
  6083. } (pseudo$1, pseudo$1.exports));
  6084. var attribute$1 = {};
  6085. /**
  6086. * For Node.js, simply re-export the core `util.deprecate` function.
  6087. */
  6088. var node = require$$2.deprecate;
  6089. (function (exports) {
  6090. exports.__esModule = true;
  6091. exports.unescapeValue = unescapeValue;
  6092. exports["default"] = void 0;
  6093. var _cssesc = _interopRequireDefault(cssesc_1);
  6094. var _unesc = _interopRequireDefault(unesc.exports);
  6095. var _namespace = _interopRequireDefault(namespace.exports);
  6096. var _types = types;
  6097. var _CSSESC_QUOTE_OPTIONS;
  6098. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6099. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6100. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6101. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  6102. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6103. var deprecate = node;
  6104. var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/;
  6105. var warnOfDeprecatedValueAssignment = deprecate(function () {}, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " + "Call attribute.setValue() instead.");
  6106. var warnOfDeprecatedQuotedAssignment = deprecate(function () {}, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead.");
  6107. var warnOfDeprecatedConstructor = deprecate(function () {}, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");
  6108. function unescapeValue(value) {
  6109. var deprecatedUsage = false;
  6110. var quoteMark = null;
  6111. var unescaped = value;
  6112. var m = unescaped.match(WRAPPED_IN_QUOTES);
  6113. if (m) {
  6114. quoteMark = m[1];
  6115. unescaped = m[2];
  6116. }
  6117. unescaped = (0, _unesc["default"])(unescaped);
  6118. if (unescaped !== value) {
  6119. deprecatedUsage = true;
  6120. }
  6121. return {
  6122. deprecatedUsage: deprecatedUsage,
  6123. unescaped: unescaped,
  6124. quoteMark: quoteMark
  6125. };
  6126. }
  6127. function handleDeprecatedContructorOpts(opts) {
  6128. if (opts.quoteMark !== undefined) {
  6129. return opts;
  6130. }
  6131. if (opts.value === undefined) {
  6132. return opts;
  6133. }
  6134. warnOfDeprecatedConstructor();
  6135. var _unescapeValue = unescapeValue(opts.value),
  6136. quoteMark = _unescapeValue.quoteMark,
  6137. unescaped = _unescapeValue.unescaped;
  6138. if (!opts.raws) {
  6139. opts.raws = {};
  6140. }
  6141. if (opts.raws.value === undefined) {
  6142. opts.raws.value = opts.value;
  6143. }
  6144. opts.value = unescaped;
  6145. opts.quoteMark = quoteMark;
  6146. return opts;
  6147. }
  6148. var Attribute = /*#__PURE__*/function (_Namespace) {
  6149. _inheritsLoose(Attribute, _Namespace);
  6150. function Attribute(opts) {
  6151. var _this;
  6152. if (opts === void 0) {
  6153. opts = {};
  6154. }
  6155. _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this;
  6156. _this.type = _types.ATTRIBUTE;
  6157. _this.raws = _this.raws || {};
  6158. Object.defineProperty(_this.raws, 'unquoted', {
  6159. get: deprecate(function () {
  6160. return _this.value;
  6161. }, "attr.raws.unquoted is deprecated. Call attr.value instead."),
  6162. set: deprecate(function () {
  6163. return _this.value;
  6164. }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.")
  6165. });
  6166. _this._constructed = true;
  6167. return _this;
  6168. }
  6169. /**
  6170. * Returns the Attribute's value quoted such that it would be legal to use
  6171. * in the value of a css file. The original value's quotation setting
  6172. * used for stringification is left unchanged. See `setValue(value, options)`
  6173. * if you want to control the quote settings of a new value for the attribute.
  6174. *
  6175. * You can also change the quotation used for the current value by setting quoteMark.
  6176. *
  6177. * Options:
  6178. * * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this
  6179. * option is not set, the original value for quoteMark will be used. If
  6180. * indeterminate, a double quote is used. The legal values are:
  6181. * * `null` - the value will be unquoted and characters will be escaped as necessary.
  6182. * * `'` - the value will be quoted with a single quote and single quotes are escaped.
  6183. * * `"` - the value will be quoted with a double quote and double quotes are escaped.
  6184. * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark
  6185. * over the quoteMark option value.
  6186. * * smart {boolean} - if true, will select a quote mark based on the value
  6187. * and the other options specified here. See the `smartQuoteMark()`
  6188. * method.
  6189. **/
  6190. var _proto = Attribute.prototype;
  6191. _proto.getQuotedValue = function getQuotedValue(options) {
  6192. if (options === void 0) {
  6193. options = {};
  6194. }
  6195. var quoteMark = this._determineQuoteMark(options);
  6196. var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark];
  6197. var escaped = (0, _cssesc["default"])(this._value, cssescopts);
  6198. return escaped;
  6199. };
  6200. _proto._determineQuoteMark = function _determineQuoteMark(options) {
  6201. return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options);
  6202. }
  6203. /**
  6204. * Set the unescaped value with the specified quotation options. The value
  6205. * provided must not include any wrapping quote marks -- those quotes will
  6206. * be interpreted as part of the value and escaped accordingly.
  6207. */
  6208. ;
  6209. _proto.setValue = function setValue(value, options) {
  6210. if (options === void 0) {
  6211. options = {};
  6212. }
  6213. this._value = value;
  6214. this._quoteMark = this._determineQuoteMark(options);
  6215. this._syncRawValue();
  6216. }
  6217. /**
  6218. * Intelligently select a quoteMark value based on the value's contents. If
  6219. * the value is a legal CSS ident, it will not be quoted. Otherwise a quote
  6220. * mark will be picked that minimizes the number of escapes.
  6221. *
  6222. * If there's no clear winner, the quote mark from these options is used,
  6223. * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is
  6224. * true). If the quoteMark is unspecified, a double quote is used.
  6225. *
  6226. * @param options This takes the quoteMark and preferCurrentQuoteMark options
  6227. * from the quoteValue method.
  6228. */
  6229. ;
  6230. _proto.smartQuoteMark = function smartQuoteMark(options) {
  6231. var v = this.value;
  6232. var numSingleQuotes = v.replace(/[^']/g, '').length;
  6233. var numDoubleQuotes = v.replace(/[^"]/g, '').length;
  6234. if (numSingleQuotes + numDoubleQuotes === 0) {
  6235. var escaped = (0, _cssesc["default"])(v, {
  6236. isIdentifier: true
  6237. });
  6238. if (escaped === v) {
  6239. return Attribute.NO_QUOTE;
  6240. } else {
  6241. var pref = this.preferredQuoteMark(options);
  6242. if (pref === Attribute.NO_QUOTE) {
  6243. // pick a quote mark that isn't none and see if it's smaller
  6244. var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE;
  6245. var opts = CSSESC_QUOTE_OPTIONS[quote];
  6246. var quoteValue = (0, _cssesc["default"])(v, opts);
  6247. if (quoteValue.length < escaped.length) {
  6248. return quote;
  6249. }
  6250. }
  6251. return pref;
  6252. }
  6253. } else if (numDoubleQuotes === numSingleQuotes) {
  6254. return this.preferredQuoteMark(options);
  6255. } else if (numDoubleQuotes < numSingleQuotes) {
  6256. return Attribute.DOUBLE_QUOTE;
  6257. } else {
  6258. return Attribute.SINGLE_QUOTE;
  6259. }
  6260. }
  6261. /**
  6262. * Selects the preferred quote mark based on the options and the current quote mark value.
  6263. * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)`
  6264. * instead.
  6265. */
  6266. ;
  6267. _proto.preferredQuoteMark = function preferredQuoteMark(options) {
  6268. var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark;
  6269. if (quoteMark === undefined) {
  6270. quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark;
  6271. }
  6272. if (quoteMark === undefined) {
  6273. quoteMark = Attribute.DOUBLE_QUOTE;
  6274. }
  6275. return quoteMark;
  6276. };
  6277. _proto._syncRawValue = function _syncRawValue() {
  6278. var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]);
  6279. if (rawValue === this._value) {
  6280. if (this.raws) {
  6281. delete this.raws.value;
  6282. }
  6283. } else {
  6284. this.raws.value = rawValue;
  6285. }
  6286. };
  6287. _proto._handleEscapes = function _handleEscapes(prop, value) {
  6288. if (this._constructed) {
  6289. var escaped = (0, _cssesc["default"])(value, {
  6290. isIdentifier: true
  6291. });
  6292. if (escaped !== value) {
  6293. this.raws[prop] = escaped;
  6294. } else {
  6295. delete this.raws[prop];
  6296. }
  6297. }
  6298. };
  6299. _proto._spacesFor = function _spacesFor(name) {
  6300. var attrSpaces = {
  6301. before: '',
  6302. after: ''
  6303. };
  6304. var spaces = this.spaces[name] || {};
  6305. var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {};
  6306. return Object.assign(attrSpaces, spaces, rawSpaces);
  6307. };
  6308. _proto._stringFor = function _stringFor(name, spaceName, concat) {
  6309. if (spaceName === void 0) {
  6310. spaceName = name;
  6311. }
  6312. if (concat === void 0) {
  6313. concat = defaultAttrConcat;
  6314. }
  6315. var attrSpaces = this._spacesFor(spaceName);
  6316. return concat(this.stringifyProperty(name), attrSpaces);
  6317. }
  6318. /**
  6319. * returns the offset of the attribute part specified relative to the
  6320. * start of the node of the output string.
  6321. *
  6322. * * "ns" - alias for "namespace"
  6323. * * "namespace" - the namespace if it exists.
  6324. * * "attribute" - the attribute name
  6325. * * "attributeNS" - the start of the attribute or its namespace
  6326. * * "operator" - the match operator of the attribute
  6327. * * "value" - The value (string or identifier)
  6328. * * "insensitive" - the case insensitivity flag;
  6329. * @param part One of the possible values inside an attribute.
  6330. * @returns -1 if the name is invalid or the value doesn't exist in this attribute.
  6331. */
  6332. ;
  6333. _proto.offsetOf = function offsetOf(name) {
  6334. var count = 1;
  6335. var attributeSpaces = this._spacesFor("attribute");
  6336. count += attributeSpaces.before.length;
  6337. if (name === "namespace" || name === "ns") {
  6338. return this.namespace ? count : -1;
  6339. }
  6340. if (name === "attributeNS") {
  6341. return count;
  6342. }
  6343. count += this.namespaceString.length;
  6344. if (this.namespace) {
  6345. count += 1;
  6346. }
  6347. if (name === "attribute") {
  6348. return count;
  6349. }
  6350. count += this.stringifyProperty("attribute").length;
  6351. count += attributeSpaces.after.length;
  6352. var operatorSpaces = this._spacesFor("operator");
  6353. count += operatorSpaces.before.length;
  6354. var operator = this.stringifyProperty("operator");
  6355. if (name === "operator") {
  6356. return operator ? count : -1;
  6357. }
  6358. count += operator.length;
  6359. count += operatorSpaces.after.length;
  6360. var valueSpaces = this._spacesFor("value");
  6361. count += valueSpaces.before.length;
  6362. var value = this.stringifyProperty("value");
  6363. if (name === "value") {
  6364. return value ? count : -1;
  6365. }
  6366. count += value.length;
  6367. count += valueSpaces.after.length;
  6368. var insensitiveSpaces = this._spacesFor("insensitive");
  6369. count += insensitiveSpaces.before.length;
  6370. if (name === "insensitive") {
  6371. return this.insensitive ? count : -1;
  6372. }
  6373. return -1;
  6374. };
  6375. _proto.toString = function toString() {
  6376. var _this2 = this;
  6377. var selector = [this.rawSpaceBefore, '['];
  6378. selector.push(this._stringFor('qualifiedAttribute', 'attribute'));
  6379. if (this.operator && (this.value || this.value === '')) {
  6380. selector.push(this._stringFor('operator'));
  6381. selector.push(this._stringFor('value'));
  6382. selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) {
  6383. if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) {
  6384. attrSpaces.before = " ";
  6385. }
  6386. return defaultAttrConcat(attrValue, attrSpaces);
  6387. }));
  6388. }
  6389. selector.push(']');
  6390. selector.push(this.rawSpaceAfter);
  6391. return selector.join('');
  6392. };
  6393. _createClass(Attribute, [{
  6394. key: "quoted",
  6395. get: function get() {
  6396. var qm = this.quoteMark;
  6397. return qm === "'" || qm === '"';
  6398. },
  6399. set: function set(value) {
  6400. warnOfDeprecatedQuotedAssignment();
  6401. }
  6402. /**
  6403. * returns a single (`'`) or double (`"`) quote character if the value is quoted.
  6404. * returns `null` if the value is not quoted.
  6405. * returns `undefined` if the quotation state is unknown (this can happen when
  6406. * the attribute is constructed without specifying a quote mark.)
  6407. */
  6408. }, {
  6409. key: "quoteMark",
  6410. get: function get() {
  6411. return this._quoteMark;
  6412. }
  6413. /**
  6414. * Set the quote mark to be used by this attribute's value.
  6415. * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute
  6416. * value is updated accordingly.
  6417. *
  6418. * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted.
  6419. */
  6420. ,
  6421. set: function set(quoteMark) {
  6422. if (!this._constructed) {
  6423. this._quoteMark = quoteMark;
  6424. return;
  6425. }
  6426. if (this._quoteMark !== quoteMark) {
  6427. this._quoteMark = quoteMark;
  6428. this._syncRawValue();
  6429. }
  6430. }
  6431. }, {
  6432. key: "qualifiedAttribute",
  6433. get: function get() {
  6434. return this.qualifiedName(this.raws.attribute || this.attribute);
  6435. }
  6436. }, {
  6437. key: "insensitiveFlag",
  6438. get: function get() {
  6439. return this.insensitive ? 'i' : '';
  6440. }
  6441. }, {
  6442. key: "value",
  6443. get: function get() {
  6444. return this._value;
  6445. }
  6446. /**
  6447. * Before 3.0, the value had to be set to an escaped value including any wrapped
  6448. * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value
  6449. * is unescaped during parsing and any quote marks are removed.
  6450. *
  6451. * Because the ambiguity of this semantic change, if you set `attr.value = newValue`,
  6452. * a deprecation warning is raised when the new value contains any characters that would
  6453. * require escaping (including if it contains wrapped quotes).
  6454. *
  6455. * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe
  6456. * how the new value is quoted.
  6457. */
  6458. ,
  6459. set: function set(v) {
  6460. if (this._constructed) {
  6461. var _unescapeValue2 = unescapeValue(v),
  6462. deprecatedUsage = _unescapeValue2.deprecatedUsage,
  6463. unescaped = _unescapeValue2.unescaped,
  6464. quoteMark = _unescapeValue2.quoteMark;
  6465. if (deprecatedUsage) {
  6466. warnOfDeprecatedValueAssignment();
  6467. }
  6468. if (unescaped === this._value && quoteMark === this._quoteMark) {
  6469. return;
  6470. }
  6471. this._value = unescaped;
  6472. this._quoteMark = quoteMark;
  6473. this._syncRawValue();
  6474. } else {
  6475. this._value = v;
  6476. }
  6477. }
  6478. }, {
  6479. key: "attribute",
  6480. get: function get() {
  6481. return this._attribute;
  6482. },
  6483. set: function set(name) {
  6484. this._handleEscapes("attribute", name);
  6485. this._attribute = name;
  6486. }
  6487. }]);
  6488. return Attribute;
  6489. }(_namespace["default"]);
  6490. exports["default"] = Attribute;
  6491. Attribute.NO_QUOTE = null;
  6492. Attribute.SINGLE_QUOTE = "'";
  6493. Attribute.DOUBLE_QUOTE = '"';
  6494. var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = {
  6495. "'": {
  6496. quotes: 'single',
  6497. wrap: true
  6498. },
  6499. '"': {
  6500. quotes: 'double',
  6501. wrap: true
  6502. }
  6503. }, _CSSESC_QUOTE_OPTIONS[null] = {
  6504. isIdentifier: true
  6505. }, _CSSESC_QUOTE_OPTIONS);
  6506. function defaultAttrConcat(attrValue, attrSpaces) {
  6507. return "" + attrSpaces.before + attrValue + attrSpaces.after;
  6508. }
  6509. } (attribute$1));
  6510. var universal$1 = {exports: {}};
  6511. (function (module, exports) {
  6512. exports.__esModule = true;
  6513. exports["default"] = void 0;
  6514. var _namespace = _interopRequireDefault(namespace.exports);
  6515. var _types = types;
  6516. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6517. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  6518. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6519. var Universal = /*#__PURE__*/function (_Namespace) {
  6520. _inheritsLoose(Universal, _Namespace);
  6521. function Universal(opts) {
  6522. var _this;
  6523. _this = _Namespace.call(this, opts) || this;
  6524. _this.type = _types.UNIVERSAL;
  6525. _this.value = '*';
  6526. return _this;
  6527. }
  6528. return Universal;
  6529. }(_namespace["default"]);
  6530. exports["default"] = Universal;
  6531. module.exports = exports.default;
  6532. } (universal$1, universal$1.exports));
  6533. var combinator$2 = {exports: {}};
  6534. (function (module, exports) {
  6535. exports.__esModule = true;
  6536. exports["default"] = void 0;
  6537. var _node = _interopRequireDefault(node$1.exports);
  6538. var _types = types;
  6539. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6540. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  6541. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6542. var Combinator = /*#__PURE__*/function (_Node) {
  6543. _inheritsLoose(Combinator, _Node);
  6544. function Combinator(opts) {
  6545. var _this;
  6546. _this = _Node.call(this, opts) || this;
  6547. _this.type = _types.COMBINATOR;
  6548. return _this;
  6549. }
  6550. return Combinator;
  6551. }(_node["default"]);
  6552. exports["default"] = Combinator;
  6553. module.exports = exports.default;
  6554. } (combinator$2, combinator$2.exports));
  6555. var nesting$1 = {exports: {}};
  6556. (function (module, exports) {
  6557. exports.__esModule = true;
  6558. exports["default"] = void 0;
  6559. var _node = _interopRequireDefault(node$1.exports);
  6560. var _types = types;
  6561. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6562. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
  6563. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  6564. var Nesting = /*#__PURE__*/function (_Node) {
  6565. _inheritsLoose(Nesting, _Node);
  6566. function Nesting(opts) {
  6567. var _this;
  6568. _this = _Node.call(this, opts) || this;
  6569. _this.type = _types.NESTING;
  6570. _this.value = '&';
  6571. return _this;
  6572. }
  6573. return Nesting;
  6574. }(_node["default"]);
  6575. exports["default"] = Nesting;
  6576. module.exports = exports.default;
  6577. } (nesting$1, nesting$1.exports));
  6578. var sortAscending = {exports: {}};
  6579. (function (module, exports) {
  6580. exports.__esModule = true;
  6581. exports["default"] = sortAscending;
  6582. function sortAscending(list) {
  6583. return list.sort(function (a, b) {
  6584. return a - b;
  6585. });
  6586. }
  6587. module.exports = exports.default;
  6588. } (sortAscending, sortAscending.exports));
  6589. var tokenize = {};
  6590. var tokenTypes = {};
  6591. tokenTypes.__esModule = true;
  6592. tokenTypes.combinator = tokenTypes.word = tokenTypes.comment = tokenTypes.str = tokenTypes.tab = tokenTypes.newline = tokenTypes.feed = tokenTypes.cr = tokenTypes.backslash = tokenTypes.bang = tokenTypes.slash = tokenTypes.doubleQuote = tokenTypes.singleQuote = tokenTypes.space = tokenTypes.greaterThan = tokenTypes.pipe = tokenTypes.equals = tokenTypes.plus = tokenTypes.caret = tokenTypes.tilde = tokenTypes.dollar = tokenTypes.closeSquare = tokenTypes.openSquare = tokenTypes.closeParenthesis = tokenTypes.openParenthesis = tokenTypes.semicolon = tokenTypes.colon = tokenTypes.comma = tokenTypes.at = tokenTypes.asterisk = tokenTypes.ampersand = void 0;
  6593. var ampersand = 38; // `&`.charCodeAt(0);
  6594. tokenTypes.ampersand = ampersand;
  6595. var asterisk = 42; // `*`.charCodeAt(0);
  6596. tokenTypes.asterisk = asterisk;
  6597. var at = 64; // `@`.charCodeAt(0);
  6598. tokenTypes.at = at;
  6599. var comma$1 = 44; // `,`.charCodeAt(0);
  6600. tokenTypes.comma = comma$1;
  6601. var colon$1 = 58; // `:`.charCodeAt(0);
  6602. tokenTypes.colon = colon$1;
  6603. var semicolon = 59; // `;`.charCodeAt(0);
  6604. tokenTypes.semicolon = semicolon;
  6605. var openParenthesis = 40; // `(`.charCodeAt(0);
  6606. tokenTypes.openParenthesis = openParenthesis;
  6607. var closeParenthesis = 41; // `)`.charCodeAt(0);
  6608. tokenTypes.closeParenthesis = closeParenthesis;
  6609. var openSquare = 91; // `[`.charCodeAt(0);
  6610. tokenTypes.openSquare = openSquare;
  6611. var closeSquare = 93; // `]`.charCodeAt(0);
  6612. tokenTypes.closeSquare = closeSquare;
  6613. var dollar = 36; // `$`.charCodeAt(0);
  6614. tokenTypes.dollar = dollar;
  6615. var tilde = 126; // `~`.charCodeAt(0);
  6616. tokenTypes.tilde = tilde;
  6617. var caret = 94; // `^`.charCodeAt(0);
  6618. tokenTypes.caret = caret;
  6619. var plus$1 = 43; // `+`.charCodeAt(0);
  6620. tokenTypes.plus = plus$1;
  6621. var equals = 61; // `=`.charCodeAt(0);
  6622. tokenTypes.equals = equals;
  6623. var pipe = 124; // `|`.charCodeAt(0);
  6624. tokenTypes.pipe = pipe;
  6625. var greaterThan = 62; // `>`.charCodeAt(0);
  6626. tokenTypes.greaterThan = greaterThan;
  6627. var space = 32; // ` `.charCodeAt(0);
  6628. tokenTypes.space = space;
  6629. var singleQuote$1 = 39; // `'`.charCodeAt(0);
  6630. tokenTypes.singleQuote = singleQuote$1;
  6631. var doubleQuote$1 = 34; // `"`.charCodeAt(0);
  6632. tokenTypes.doubleQuote = doubleQuote$1;
  6633. var slash$1 = 47; // `/`.charCodeAt(0);
  6634. tokenTypes.slash = slash$1;
  6635. var bang = 33; // `!`.charCodeAt(0);
  6636. tokenTypes.bang = bang;
  6637. var backslash$1 = 92; // '\\'.charCodeAt(0);
  6638. tokenTypes.backslash = backslash$1;
  6639. var cr = 13; // '\r'.charCodeAt(0);
  6640. tokenTypes.cr = cr;
  6641. var feed = 12; // '\f'.charCodeAt(0);
  6642. tokenTypes.feed = feed;
  6643. var newline = 10; // '\n'.charCodeAt(0);
  6644. tokenTypes.newline = newline;
  6645. var tab = 9; // '\t'.charCodeAt(0);
  6646. // Expose aliases primarily for readability.
  6647. tokenTypes.tab = tab;
  6648. var str = singleQuote$1; // No good single character representation!
  6649. tokenTypes.str = str;
  6650. var comment$1 = -1;
  6651. tokenTypes.comment = comment$1;
  6652. var word = -2;
  6653. tokenTypes.word = word;
  6654. var combinator$1 = -3;
  6655. tokenTypes.combinator = combinator$1;
  6656. (function (exports) {
  6657. exports.__esModule = true;
  6658. exports["default"] = tokenize;
  6659. exports.FIELDS = void 0;
  6660. var t = _interopRequireWildcard(tokenTypes);
  6661. var _unescapable, _wordDelimiters;
  6662. function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
  6663. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  6664. var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable);
  6665. var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters);
  6666. var hex = {};
  6667. var hexChars = "0123456789abcdefABCDEF";
  6668. for (var i = 0; i < hexChars.length; i++) {
  6669. hex[hexChars.charCodeAt(i)] = true;
  6670. }
  6671. /**
  6672. * Returns the last index of the bar css word
  6673. * @param {string} css The string in which the word begins
  6674. * @param {number} start The index into the string where word's first letter occurs
  6675. */
  6676. function consumeWord(css, start) {
  6677. var next = start;
  6678. var code;
  6679. do {
  6680. code = css.charCodeAt(next);
  6681. if (wordDelimiters[code]) {
  6682. return next - 1;
  6683. } else if (code === t.backslash) {
  6684. next = consumeEscape(css, next) + 1;
  6685. } else {
  6686. // All other characters are part of the word
  6687. next++;
  6688. }
  6689. } while (next < css.length);
  6690. return next - 1;
  6691. }
  6692. /**
  6693. * Returns the last index of the escape sequence
  6694. * @param {string} css The string in which the sequence begins
  6695. * @param {number} start The index into the string where escape character (`\`) occurs.
  6696. */
  6697. function consumeEscape(css, start) {
  6698. var next = start;
  6699. var code = css.charCodeAt(next + 1);
  6700. if (unescapable[code]) ; else if (hex[code]) {
  6701. var hexDigits = 0; // consume up to 6 hex chars
  6702. do {
  6703. next++;
  6704. hexDigits++;
  6705. code = css.charCodeAt(next + 1);
  6706. } while (hex[code] && hexDigits < 6); // if fewer than 6 hex chars, a trailing space ends the escape
  6707. if (hexDigits < 6 && code === t.space) {
  6708. next++;
  6709. }
  6710. } else {
  6711. // the next char is part of the current word
  6712. next++;
  6713. }
  6714. return next;
  6715. }
  6716. var FIELDS = {
  6717. TYPE: 0,
  6718. START_LINE: 1,
  6719. START_COL: 2,
  6720. END_LINE: 3,
  6721. END_COL: 4,
  6722. START_POS: 5,
  6723. END_POS: 6
  6724. };
  6725. exports.FIELDS = FIELDS;
  6726. function tokenize(input) {
  6727. var tokens = [];
  6728. var css = input.css.valueOf();
  6729. var _css = css,
  6730. length = _css.length;
  6731. var offset = -1;
  6732. var line = 1;
  6733. var start = 0;
  6734. var end = 0;
  6735. var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType;
  6736. function unclosed(what, fix) {
  6737. if (input.safe) {
  6738. // fyi: this is never set to true.
  6739. css += fix;
  6740. next = css.length - 1;
  6741. } else {
  6742. throw input.error('Unclosed ' + what, line, start - offset, start);
  6743. }
  6744. }
  6745. while (start < length) {
  6746. code = css.charCodeAt(start);
  6747. if (code === t.newline) {
  6748. offset = start;
  6749. line += 1;
  6750. }
  6751. switch (code) {
  6752. case t.space:
  6753. case t.tab:
  6754. case t.newline:
  6755. case t.cr:
  6756. case t.feed:
  6757. next = start;
  6758. do {
  6759. next += 1;
  6760. code = css.charCodeAt(next);
  6761. if (code === t.newline) {
  6762. offset = next;
  6763. line += 1;
  6764. }
  6765. } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed);
  6766. tokenType = t.space;
  6767. endLine = line;
  6768. endColumn = next - offset - 1;
  6769. end = next;
  6770. break;
  6771. case t.plus:
  6772. case t.greaterThan:
  6773. case t.tilde:
  6774. case t.pipe:
  6775. next = start;
  6776. do {
  6777. next += 1;
  6778. code = css.charCodeAt(next);
  6779. } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe);
  6780. tokenType = t.combinator;
  6781. endLine = line;
  6782. endColumn = start - offset;
  6783. end = next;
  6784. break;
  6785. // Consume these characters as single tokens.
  6786. case t.asterisk:
  6787. case t.ampersand:
  6788. case t.bang:
  6789. case t.comma:
  6790. case t.equals:
  6791. case t.dollar:
  6792. case t.caret:
  6793. case t.openSquare:
  6794. case t.closeSquare:
  6795. case t.colon:
  6796. case t.semicolon:
  6797. case t.openParenthesis:
  6798. case t.closeParenthesis:
  6799. next = start;
  6800. tokenType = code;
  6801. endLine = line;
  6802. endColumn = start - offset;
  6803. end = next + 1;
  6804. break;
  6805. case t.singleQuote:
  6806. case t.doubleQuote:
  6807. quote = code === t.singleQuote ? "'" : '"';
  6808. next = start;
  6809. do {
  6810. escaped = false;
  6811. next = css.indexOf(quote, next + 1);
  6812. if (next === -1) {
  6813. unclosed('quote', quote);
  6814. }
  6815. escapePos = next;
  6816. while (css.charCodeAt(escapePos - 1) === t.backslash) {
  6817. escapePos -= 1;
  6818. escaped = !escaped;
  6819. }
  6820. } while (escaped);
  6821. tokenType = t.str;
  6822. endLine = line;
  6823. endColumn = start - offset;
  6824. end = next + 1;
  6825. break;
  6826. default:
  6827. if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) {
  6828. next = css.indexOf('*/', start + 2) + 1;
  6829. if (next === 0) {
  6830. unclosed('comment', '*/');
  6831. }
  6832. content = css.slice(start, next + 1);
  6833. lines = content.split('\n');
  6834. last = lines.length - 1;
  6835. if (last > 0) {
  6836. nextLine = line + last;
  6837. nextOffset = next - lines[last].length;
  6838. } else {
  6839. nextLine = line;
  6840. nextOffset = offset;
  6841. }
  6842. tokenType = t.comment;
  6843. line = nextLine;
  6844. endLine = nextLine;
  6845. endColumn = next - nextOffset;
  6846. } else if (code === t.slash) {
  6847. next = start;
  6848. tokenType = code;
  6849. endLine = line;
  6850. endColumn = start - offset;
  6851. end = next + 1;
  6852. } else {
  6853. next = consumeWord(css, start);
  6854. tokenType = t.word;
  6855. endLine = line;
  6856. endColumn = next - offset;
  6857. }
  6858. end = next + 1;
  6859. break;
  6860. } // Ensure that the token structure remains consistent
  6861. tokens.push([tokenType, // [0] Token type
  6862. line, // [1] Starting line
  6863. start - offset, // [2] Starting column
  6864. endLine, // [3] Ending line
  6865. endColumn, // [4] Ending column
  6866. start, // [5] Start position / Source index
  6867. end // [6] End position
  6868. ]); // Reset offset for the next token
  6869. if (nextOffset) {
  6870. offset = nextOffset;
  6871. nextOffset = null;
  6872. }
  6873. start = end;
  6874. }
  6875. return tokens;
  6876. }
  6877. } (tokenize));
  6878. (function (module, exports) {
  6879. exports.__esModule = true;
  6880. exports["default"] = void 0;
  6881. var _root = _interopRequireDefault(root$2.exports);
  6882. var _selector = _interopRequireDefault(selector$1.exports);
  6883. var _className = _interopRequireDefault(className$1.exports);
  6884. var _comment = _interopRequireDefault(comment$2.exports);
  6885. var _id = _interopRequireDefault(id$1.exports);
  6886. var _tag = _interopRequireDefault(tag$1.exports);
  6887. var _string = _interopRequireDefault(string$1.exports);
  6888. var _pseudo = _interopRequireDefault(pseudo$1.exports);
  6889. var _attribute = _interopRequireWildcard(attribute$1);
  6890. var _universal = _interopRequireDefault(universal$1.exports);
  6891. var _combinator = _interopRequireDefault(combinator$2.exports);
  6892. var _nesting = _interopRequireDefault(nesting$1.exports);
  6893. var _sortAscending = _interopRequireDefault(sortAscending.exports);
  6894. var _tokenize = _interopRequireWildcard(tokenize);
  6895. var tokens = _interopRequireWildcard(tokenTypes);
  6896. var types$1 = _interopRequireWildcard(types);
  6897. var _util = util$1;
  6898. var _WHITESPACE_TOKENS, _Object$assign;
  6899. function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
  6900. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  6901. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  6902. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  6903. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  6904. var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS);
  6905. var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign));
  6906. function tokenStart(token) {
  6907. return {
  6908. line: token[_tokenize.FIELDS.START_LINE],
  6909. column: token[_tokenize.FIELDS.START_COL]
  6910. };
  6911. }
  6912. function tokenEnd(token) {
  6913. return {
  6914. line: token[_tokenize.FIELDS.END_LINE],
  6915. column: token[_tokenize.FIELDS.END_COL]
  6916. };
  6917. }
  6918. function getSource(startLine, startColumn, endLine, endColumn) {
  6919. return {
  6920. start: {
  6921. line: startLine,
  6922. column: startColumn
  6923. },
  6924. end: {
  6925. line: endLine,
  6926. column: endColumn
  6927. }
  6928. };
  6929. }
  6930. function getTokenSource(token) {
  6931. return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]);
  6932. }
  6933. function getTokenSourceSpan(startToken, endToken) {
  6934. if (!startToken) {
  6935. return undefined;
  6936. }
  6937. return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]);
  6938. }
  6939. function unescapeProp(node, prop) {
  6940. var value = node[prop];
  6941. if (typeof value !== "string") {
  6942. return;
  6943. }
  6944. if (value.indexOf("\\") !== -1) {
  6945. (0, _util.ensureObject)(node, 'raws');
  6946. node[prop] = (0, _util.unesc)(value);
  6947. if (node.raws[prop] === undefined) {
  6948. node.raws[prop] = value;
  6949. }
  6950. }
  6951. return node;
  6952. }
  6953. function indexesOf(array, item) {
  6954. var i = -1;
  6955. var indexes = [];
  6956. while ((i = array.indexOf(item, i + 1)) !== -1) {
  6957. indexes.push(i);
  6958. }
  6959. return indexes;
  6960. }
  6961. function uniqs() {
  6962. var list = Array.prototype.concat.apply([], arguments);
  6963. return list.filter(function (item, i) {
  6964. return i === list.indexOf(item);
  6965. });
  6966. }
  6967. var Parser = /*#__PURE__*/function () {
  6968. function Parser(rule, options) {
  6969. if (options === void 0) {
  6970. options = {};
  6971. }
  6972. this.rule = rule;
  6973. this.options = Object.assign({
  6974. lossy: false,
  6975. safe: false
  6976. }, options);
  6977. this.position = 0;
  6978. this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector;
  6979. this.tokens = (0, _tokenize["default"])({
  6980. css: this.css,
  6981. error: this._errorGenerator(),
  6982. safe: this.options.safe
  6983. });
  6984. var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]);
  6985. this.root = new _root["default"]({
  6986. source: rootSource
  6987. });
  6988. this.root.errorGenerator = this._errorGenerator();
  6989. var selector = new _selector["default"]({
  6990. source: {
  6991. start: {
  6992. line: 1,
  6993. column: 1
  6994. }
  6995. }
  6996. });
  6997. this.root.append(selector);
  6998. this.current = selector;
  6999. this.loop();
  7000. }
  7001. var _proto = Parser.prototype;
  7002. _proto._errorGenerator = function _errorGenerator() {
  7003. var _this = this;
  7004. return function (message, errorOptions) {
  7005. if (typeof _this.rule === 'string') {
  7006. return new Error(message);
  7007. }
  7008. return _this.rule.error(message, errorOptions);
  7009. };
  7010. };
  7011. _proto.attribute = function attribute() {
  7012. var attr = [];
  7013. var startingToken = this.currToken;
  7014. this.position++;
  7015. while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) {
  7016. attr.push(this.currToken);
  7017. this.position++;
  7018. }
  7019. if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) {
  7020. return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]);
  7021. }
  7022. var len = attr.length;
  7023. var node = {
  7024. source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]),
  7025. sourceIndex: startingToken[_tokenize.FIELDS.START_POS]
  7026. };
  7027. if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) {
  7028. return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]);
  7029. }
  7030. var pos = 0;
  7031. var spaceBefore = '';
  7032. var commentBefore = '';
  7033. var lastAdded = null;
  7034. var spaceAfterMeaningfulToken = false;
  7035. while (pos < len) {
  7036. var token = attr[pos];
  7037. var content = this.content(token);
  7038. var next = attr[pos + 1];
  7039. switch (token[_tokenize.FIELDS.TYPE]) {
  7040. case tokens.space:
  7041. // if (
  7042. // len === 1 ||
  7043. // pos === 0 && this.content(next) === '|'
  7044. // ) {
  7045. // return this.expected('attribute', token[TOKEN.START_POS], content);
  7046. // }
  7047. spaceAfterMeaningfulToken = true;
  7048. if (this.options.lossy) {
  7049. break;
  7050. }
  7051. if (lastAdded) {
  7052. (0, _util.ensureObject)(node, 'spaces', lastAdded);
  7053. var prevContent = node.spaces[lastAdded].after || '';
  7054. node.spaces[lastAdded].after = prevContent + content;
  7055. var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null;
  7056. if (existingComment) {
  7057. node.raws.spaces[lastAdded].after = existingComment + content;
  7058. }
  7059. } else {
  7060. spaceBefore = spaceBefore + content;
  7061. commentBefore = commentBefore + content;
  7062. }
  7063. break;
  7064. case tokens.asterisk:
  7065. if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
  7066. node.operator = content;
  7067. lastAdded = 'operator';
  7068. } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) {
  7069. if (spaceBefore) {
  7070. (0, _util.ensureObject)(node, 'spaces', 'attribute');
  7071. node.spaces.attribute.before = spaceBefore;
  7072. spaceBefore = '';
  7073. }
  7074. if (commentBefore) {
  7075. (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute');
  7076. node.raws.spaces.attribute.before = spaceBefore;
  7077. commentBefore = '';
  7078. }
  7079. node.namespace = (node.namespace || "") + content;
  7080. var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null;
  7081. if (rawValue) {
  7082. node.raws.namespace += content;
  7083. }
  7084. lastAdded = 'namespace';
  7085. }
  7086. spaceAfterMeaningfulToken = false;
  7087. break;
  7088. case tokens.dollar:
  7089. if (lastAdded === "value") {
  7090. var oldRawValue = (0, _util.getProp)(node, 'raws', 'value');
  7091. node.value += "$";
  7092. if (oldRawValue) {
  7093. node.raws.value = oldRawValue + "$";
  7094. }
  7095. break;
  7096. }
  7097. // Falls through
  7098. case tokens.caret:
  7099. if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
  7100. node.operator = content;
  7101. lastAdded = 'operator';
  7102. }
  7103. spaceAfterMeaningfulToken = false;
  7104. break;
  7105. case tokens.combinator:
  7106. if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) {
  7107. node.operator = content;
  7108. lastAdded = 'operator';
  7109. }
  7110. if (content !== '|') {
  7111. spaceAfterMeaningfulToken = false;
  7112. break;
  7113. }
  7114. if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {
  7115. node.operator = content;
  7116. lastAdded = 'operator';
  7117. } else if (!node.namespace && !node.attribute) {
  7118. node.namespace = true;
  7119. }
  7120. spaceAfterMeaningfulToken = false;
  7121. break;
  7122. case tokens.word:
  7123. if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && // this look-ahead probably fails with comment nodes involved.
  7124. !node.operator && !node.namespace) {
  7125. node.namespace = content;
  7126. lastAdded = 'namespace';
  7127. } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) {
  7128. if (spaceBefore) {
  7129. (0, _util.ensureObject)(node, 'spaces', 'attribute');
  7130. node.spaces.attribute.before = spaceBefore;
  7131. spaceBefore = '';
  7132. }
  7133. if (commentBefore) {
  7134. (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute');
  7135. node.raws.spaces.attribute.before = commentBefore;
  7136. commentBefore = '';
  7137. }
  7138. node.attribute = (node.attribute || "") + content;
  7139. var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null;
  7140. if (_rawValue) {
  7141. node.raws.attribute += content;
  7142. }
  7143. lastAdded = 'attribute';
  7144. } else if (!node.value && node.value !== "" || lastAdded === "value" && !spaceAfterMeaningfulToken) {
  7145. var _unescaped = (0, _util.unesc)(content);
  7146. var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || '';
  7147. var oldValue = node.value || '';
  7148. node.value = oldValue + _unescaped;
  7149. node.quoteMark = null;
  7150. if (_unescaped !== content || _oldRawValue) {
  7151. (0, _util.ensureObject)(node, 'raws');
  7152. node.raws.value = (_oldRawValue || oldValue) + content;
  7153. }
  7154. lastAdded = 'value';
  7155. } else {
  7156. var insensitive = content === 'i' || content === "I";
  7157. if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) {
  7158. node.insensitive = insensitive;
  7159. if (!insensitive || content === "I") {
  7160. (0, _util.ensureObject)(node, 'raws');
  7161. node.raws.insensitiveFlag = content;
  7162. }
  7163. lastAdded = 'insensitive';
  7164. if (spaceBefore) {
  7165. (0, _util.ensureObject)(node, 'spaces', 'insensitive');
  7166. node.spaces.insensitive.before = spaceBefore;
  7167. spaceBefore = '';
  7168. }
  7169. if (commentBefore) {
  7170. (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive');
  7171. node.raws.spaces.insensitive.before = commentBefore;
  7172. commentBefore = '';
  7173. }
  7174. } else if (node.value || node.value === '') {
  7175. lastAdded = 'value';
  7176. node.value += content;
  7177. if (node.raws.value) {
  7178. node.raws.value += content;
  7179. }
  7180. }
  7181. }
  7182. spaceAfterMeaningfulToken = false;
  7183. break;
  7184. case tokens.str:
  7185. if (!node.attribute || !node.operator) {
  7186. return this.error("Expected an attribute followed by an operator preceding the string.", {
  7187. index: token[_tokenize.FIELDS.START_POS]
  7188. });
  7189. }
  7190. var _unescapeValue = (0, _attribute.unescapeValue)(content),
  7191. unescaped = _unescapeValue.unescaped,
  7192. quoteMark = _unescapeValue.quoteMark;
  7193. node.value = unescaped;
  7194. node.quoteMark = quoteMark;
  7195. lastAdded = 'value';
  7196. (0, _util.ensureObject)(node, 'raws');
  7197. node.raws.value = content;
  7198. spaceAfterMeaningfulToken = false;
  7199. break;
  7200. case tokens.equals:
  7201. if (!node.attribute) {
  7202. return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content);
  7203. }
  7204. if (node.value) {
  7205. return this.error('Unexpected "=" found; an operator was already defined.', {
  7206. index: token[_tokenize.FIELDS.START_POS]
  7207. });
  7208. }
  7209. node.operator = node.operator ? node.operator + content : content;
  7210. lastAdded = 'operator';
  7211. spaceAfterMeaningfulToken = false;
  7212. break;
  7213. case tokens.comment:
  7214. if (lastAdded) {
  7215. if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') {
  7216. var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || '';
  7217. var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment;
  7218. (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded);
  7219. node.raws.spaces[lastAdded].after = rawLastComment + content;
  7220. } else {
  7221. var lastValue = node[lastAdded] || '';
  7222. var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue;
  7223. (0, _util.ensureObject)(node, 'raws');
  7224. node.raws[lastAdded] = rawLastValue + content;
  7225. }
  7226. } else {
  7227. commentBefore = commentBefore + content;
  7228. }
  7229. break;
  7230. default:
  7231. return this.error("Unexpected \"" + content + "\" found.", {
  7232. index: token[_tokenize.FIELDS.START_POS]
  7233. });
  7234. }
  7235. pos++;
  7236. }
  7237. unescapeProp(node, "attribute");
  7238. unescapeProp(node, "namespace");
  7239. this.newNode(new _attribute["default"](node));
  7240. this.position++;
  7241. }
  7242. /**
  7243. * return a node containing meaningless garbage up to (but not including) the specified token position.
  7244. * if the token position is negative, all remaining tokens are consumed.
  7245. *
  7246. * This returns an array containing a single string node if all whitespace,
  7247. * otherwise an array of comment nodes with space before and after.
  7248. *
  7249. * These tokens are not added to the current selector, the caller can add them or use them to amend
  7250. * a previous node's space metadata.
  7251. *
  7252. * In lossy mode, this returns only comments.
  7253. */
  7254. ;
  7255. _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) {
  7256. if (stopPosition < 0) {
  7257. stopPosition = this.tokens.length;
  7258. }
  7259. var startPosition = this.position;
  7260. var nodes = [];
  7261. var space = "";
  7262. var lastComment = undefined;
  7263. do {
  7264. if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) {
  7265. if (!this.options.lossy) {
  7266. space += this.content();
  7267. }
  7268. } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) {
  7269. var spaces = {};
  7270. if (space) {
  7271. spaces.before = space;
  7272. space = "";
  7273. }
  7274. lastComment = new _comment["default"]({
  7275. value: this.content(),
  7276. source: getTokenSource(this.currToken),
  7277. sourceIndex: this.currToken[_tokenize.FIELDS.START_POS],
  7278. spaces: spaces
  7279. });
  7280. nodes.push(lastComment);
  7281. }
  7282. } while (++this.position < stopPosition);
  7283. if (space) {
  7284. if (lastComment) {
  7285. lastComment.spaces.after = space;
  7286. } else if (!this.options.lossy) {
  7287. var firstToken = this.tokens[startPosition];
  7288. var lastToken = this.tokens[this.position - 1];
  7289. nodes.push(new _string["default"]({
  7290. value: '',
  7291. source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]),
  7292. sourceIndex: firstToken[_tokenize.FIELDS.START_POS],
  7293. spaces: {
  7294. before: space,
  7295. after: ''
  7296. }
  7297. }));
  7298. }
  7299. }
  7300. return nodes;
  7301. }
  7302. /**
  7303. *
  7304. * @param {*} nodes
  7305. */
  7306. ;
  7307. _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) {
  7308. var _this2 = this;
  7309. if (requiredSpace === void 0) {
  7310. requiredSpace = false;
  7311. }
  7312. var space = "";
  7313. var rawSpace = "";
  7314. nodes.forEach(function (n) {
  7315. var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace);
  7316. var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace);
  7317. space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0);
  7318. rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0);
  7319. });
  7320. if (rawSpace === space) {
  7321. rawSpace = undefined;
  7322. }
  7323. var result = {
  7324. space: space,
  7325. rawSpace: rawSpace
  7326. };
  7327. return result;
  7328. };
  7329. _proto.isNamedCombinator = function isNamedCombinator(position) {
  7330. if (position === void 0) {
  7331. position = this.position;
  7332. }
  7333. return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash;
  7334. };
  7335. _proto.namedCombinator = function namedCombinator() {
  7336. if (this.isNamedCombinator()) {
  7337. var nameRaw = this.content(this.tokens[this.position + 1]);
  7338. var name = (0, _util.unesc)(nameRaw).toLowerCase();
  7339. var raws = {};
  7340. if (name !== nameRaw) {
  7341. raws.value = "/" + nameRaw + "/";
  7342. }
  7343. var node = new _combinator["default"]({
  7344. value: "/" + name + "/",
  7345. source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]),
  7346. sourceIndex: this.currToken[_tokenize.FIELDS.START_POS],
  7347. raws: raws
  7348. });
  7349. this.position = this.position + 3;
  7350. return node;
  7351. } else {
  7352. this.unexpected();
  7353. }
  7354. };
  7355. _proto.combinator = function combinator() {
  7356. var _this3 = this;
  7357. if (this.content() === '|') {
  7358. return this.namespace();
  7359. } // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector.
  7360. var nextSigTokenPos = this.locateNextMeaningfulToken(this.position);
  7361. if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma) {
  7362. var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
  7363. if (nodes.length > 0) {
  7364. var last = this.current.last;
  7365. if (last) {
  7366. var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes),
  7367. space = _this$convertWhitespa.space,
  7368. rawSpace = _this$convertWhitespa.rawSpace;
  7369. if (rawSpace !== undefined) {
  7370. last.rawSpaceAfter += rawSpace;
  7371. }
  7372. last.spaces.after += space;
  7373. } else {
  7374. nodes.forEach(function (n) {
  7375. return _this3.newNode(n);
  7376. });
  7377. }
  7378. }
  7379. return;
  7380. }
  7381. var firstToken = this.currToken;
  7382. var spaceOrDescendantSelectorNodes = undefined;
  7383. if (nextSigTokenPos > this.position) {
  7384. spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
  7385. }
  7386. var node;
  7387. if (this.isNamedCombinator()) {
  7388. node = this.namedCombinator();
  7389. } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) {
  7390. node = new _combinator["default"]({
  7391. value: this.content(),
  7392. source: getTokenSource(this.currToken),
  7393. sourceIndex: this.currToken[_tokenize.FIELDS.START_POS]
  7394. });
  7395. this.position++;
  7396. } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) ; else if (!spaceOrDescendantSelectorNodes) {
  7397. this.unexpected();
  7398. }
  7399. if (node) {
  7400. if (spaceOrDescendantSelectorNodes) {
  7401. var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes),
  7402. _space = _this$convertWhitespa2.space,
  7403. _rawSpace = _this$convertWhitespa2.rawSpace;
  7404. node.spaces.before = _space;
  7405. node.rawSpaceBefore = _rawSpace;
  7406. }
  7407. } else {
  7408. // descendant combinator
  7409. var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true),
  7410. _space2 = _this$convertWhitespa3.space,
  7411. _rawSpace2 = _this$convertWhitespa3.rawSpace;
  7412. if (!_rawSpace2) {
  7413. _rawSpace2 = _space2;
  7414. }
  7415. var spaces = {};
  7416. var raws = {
  7417. spaces: {}
  7418. };
  7419. if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) {
  7420. spaces.before = _space2.slice(0, _space2.length - 1);
  7421. raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1);
  7422. } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) {
  7423. spaces.after = _space2.slice(1);
  7424. raws.spaces.after = _rawSpace2.slice(1);
  7425. } else {
  7426. raws.value = _rawSpace2;
  7427. }
  7428. node = new _combinator["default"]({
  7429. value: ' ',
  7430. source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]),
  7431. sourceIndex: firstToken[_tokenize.FIELDS.START_POS],
  7432. spaces: spaces,
  7433. raws: raws
  7434. });
  7435. }
  7436. if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) {
  7437. node.spaces.after = this.optionalSpace(this.content());
  7438. this.position++;
  7439. }
  7440. return this.newNode(node);
  7441. };
  7442. _proto.comma = function comma() {
  7443. if (this.position === this.tokens.length - 1) {
  7444. this.root.trailingComma = true;
  7445. this.position++;
  7446. return;
  7447. }
  7448. this.current._inferEndPosition();
  7449. var selector = new _selector["default"]({
  7450. source: {
  7451. start: tokenStart(this.tokens[this.position + 1])
  7452. }
  7453. });
  7454. this.current.parent.append(selector);
  7455. this.current = selector;
  7456. this.position++;
  7457. };
  7458. _proto.comment = function comment() {
  7459. var current = this.currToken;
  7460. this.newNode(new _comment["default"]({
  7461. value: this.content(),
  7462. source: getTokenSource(current),
  7463. sourceIndex: current[_tokenize.FIELDS.START_POS]
  7464. }));
  7465. this.position++;
  7466. };
  7467. _proto.error = function error(message, opts) {
  7468. throw this.root.error(message, opts);
  7469. };
  7470. _proto.missingBackslash = function missingBackslash() {
  7471. return this.error('Expected a backslash preceding the semicolon.', {
  7472. index: this.currToken[_tokenize.FIELDS.START_POS]
  7473. });
  7474. };
  7475. _proto.missingParenthesis = function missingParenthesis() {
  7476. return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]);
  7477. };
  7478. _proto.missingSquareBracket = function missingSquareBracket() {
  7479. return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]);
  7480. };
  7481. _proto.unexpected = function unexpected() {
  7482. return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]);
  7483. };
  7484. _proto.namespace = function namespace() {
  7485. var before = this.prevToken && this.content(this.prevToken) || true;
  7486. if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) {
  7487. this.position++;
  7488. return this.word(before);
  7489. } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) {
  7490. this.position++;
  7491. return this.universal(before);
  7492. }
  7493. };
  7494. _proto.nesting = function nesting() {
  7495. if (this.nextToken) {
  7496. var nextContent = this.content(this.nextToken);
  7497. if (nextContent === "|") {
  7498. this.position++;
  7499. return;
  7500. }
  7501. }
  7502. var current = this.currToken;
  7503. this.newNode(new _nesting["default"]({
  7504. value: this.content(),
  7505. source: getTokenSource(current),
  7506. sourceIndex: current[_tokenize.FIELDS.START_POS]
  7507. }));
  7508. this.position++;
  7509. };
  7510. _proto.parentheses = function parentheses() {
  7511. var last = this.current.last;
  7512. var unbalanced = 1;
  7513. this.position++;
  7514. if (last && last.type === types$1.PSEUDO) {
  7515. var selector = new _selector["default"]({
  7516. source: {
  7517. start: tokenStart(this.tokens[this.position - 1])
  7518. }
  7519. });
  7520. var cache = this.current;
  7521. last.append(selector);
  7522. this.current = selector;
  7523. while (this.position < this.tokens.length && unbalanced) {
  7524. if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
  7525. unbalanced++;
  7526. }
  7527. if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
  7528. unbalanced--;
  7529. }
  7530. if (unbalanced) {
  7531. this.parse();
  7532. } else {
  7533. this.current.source.end = tokenEnd(this.currToken);
  7534. this.current.parent.source.end = tokenEnd(this.currToken);
  7535. this.position++;
  7536. }
  7537. }
  7538. this.current = cache;
  7539. } else {
  7540. // I think this case should be an error. It's used to implement a basic parse of media queries
  7541. // but I don't think it's a good idea.
  7542. var parenStart = this.currToken;
  7543. var parenValue = "(";
  7544. var parenEnd;
  7545. while (this.position < this.tokens.length && unbalanced) {
  7546. if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
  7547. unbalanced++;
  7548. }
  7549. if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
  7550. unbalanced--;
  7551. }
  7552. parenEnd = this.currToken;
  7553. parenValue += this.parseParenthesisToken(this.currToken);
  7554. this.position++;
  7555. }
  7556. if (last) {
  7557. last.appendToPropertyAndEscape("value", parenValue, parenValue);
  7558. } else {
  7559. this.newNode(new _string["default"]({
  7560. value: parenValue,
  7561. source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]),
  7562. sourceIndex: parenStart[_tokenize.FIELDS.START_POS]
  7563. }));
  7564. }
  7565. }
  7566. if (unbalanced) {
  7567. return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]);
  7568. }
  7569. };
  7570. _proto.pseudo = function pseudo() {
  7571. var _this4 = this;
  7572. var pseudoStr = '';
  7573. var startingToken = this.currToken;
  7574. while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) {
  7575. pseudoStr += this.content();
  7576. this.position++;
  7577. }
  7578. if (!this.currToken) {
  7579. return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1);
  7580. }
  7581. if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) {
  7582. this.splitWord(false, function (first, length) {
  7583. pseudoStr += first;
  7584. _this4.newNode(new _pseudo["default"]({
  7585. value: pseudoStr,
  7586. source: getTokenSourceSpan(startingToken, _this4.currToken),
  7587. sourceIndex: startingToken[_tokenize.FIELDS.START_POS]
  7588. }));
  7589. if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {
  7590. _this4.error('Misplaced parenthesis.', {
  7591. index: _this4.nextToken[_tokenize.FIELDS.START_POS]
  7592. });
  7593. }
  7594. });
  7595. } else {
  7596. return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]);
  7597. }
  7598. };
  7599. _proto.space = function space() {
  7600. var content = this.content(); // Handle space before and after the selector
  7601. if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) {
  7602. return node.type === 'comment';
  7603. })) {
  7604. this.spaces = this.optionalSpace(content);
  7605. this.position++;
  7606. } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {
  7607. this.current.last.spaces.after = this.optionalSpace(content);
  7608. this.position++;
  7609. } else {
  7610. this.combinator();
  7611. }
  7612. };
  7613. _proto.string = function string() {
  7614. var current = this.currToken;
  7615. this.newNode(new _string["default"]({
  7616. value: this.content(),
  7617. source: getTokenSource(current),
  7618. sourceIndex: current[_tokenize.FIELDS.START_POS]
  7619. }));
  7620. this.position++;
  7621. };
  7622. _proto.universal = function universal(namespace) {
  7623. var nextToken = this.nextToken;
  7624. if (nextToken && this.content(nextToken) === '|') {
  7625. this.position++;
  7626. return this.namespace();
  7627. }
  7628. var current = this.currToken;
  7629. this.newNode(new _universal["default"]({
  7630. value: this.content(),
  7631. source: getTokenSource(current),
  7632. sourceIndex: current[_tokenize.FIELDS.START_POS]
  7633. }), namespace);
  7634. this.position++;
  7635. };
  7636. _proto.splitWord = function splitWord(namespace, firstCallback) {
  7637. var _this5 = this;
  7638. var nextToken = this.nextToken;
  7639. var word = this.content();
  7640. while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) {
  7641. this.position++;
  7642. var current = this.content();
  7643. word += current;
  7644. if (current.lastIndexOf('\\') === current.length - 1) {
  7645. var next = this.nextToken;
  7646. if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) {
  7647. word += this.requiredSpace(this.content(next));
  7648. this.position++;
  7649. }
  7650. }
  7651. nextToken = this.nextToken;
  7652. }
  7653. var hasClass = indexesOf(word, '.').filter(function (i) {
  7654. // Allow escaped dot within class name
  7655. var escapedDot = word[i - 1] === '\\'; // Allow decimal numbers percent in @keyframes
  7656. var isKeyframesPercent = /^\d+\.\d+%$/.test(word);
  7657. return !escapedDot && !isKeyframesPercent;
  7658. });
  7659. var hasId = indexesOf(word, '#').filter(function (i) {
  7660. return word[i - 1] !== '\\';
  7661. }); // Eliminate Sass interpolations from the list of id indexes
  7662. var interpolations = indexesOf(word, '#{');
  7663. if (interpolations.length) {
  7664. hasId = hasId.filter(function (hashIndex) {
  7665. return !~interpolations.indexOf(hashIndex);
  7666. });
  7667. }
  7668. var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId)));
  7669. indices.forEach(function (ind, i) {
  7670. var index = indices[i + 1] || word.length;
  7671. var value = word.slice(ind, index);
  7672. if (i === 0 && firstCallback) {
  7673. return firstCallback.call(_this5, value, indices.length);
  7674. }
  7675. var node;
  7676. var current = _this5.currToken;
  7677. var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i];
  7678. var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1));
  7679. if (~hasClass.indexOf(ind)) {
  7680. var classNameOpts = {
  7681. value: value.slice(1),
  7682. source: source,
  7683. sourceIndex: sourceIndex
  7684. };
  7685. node = new _className["default"](unescapeProp(classNameOpts, "value"));
  7686. } else if (~hasId.indexOf(ind)) {
  7687. var idOpts = {
  7688. value: value.slice(1),
  7689. source: source,
  7690. sourceIndex: sourceIndex
  7691. };
  7692. node = new _id["default"](unescapeProp(idOpts, "value"));
  7693. } else {
  7694. var tagOpts = {
  7695. value: value,
  7696. source: source,
  7697. sourceIndex: sourceIndex
  7698. };
  7699. unescapeProp(tagOpts, "value");
  7700. node = new _tag["default"](tagOpts);
  7701. }
  7702. _this5.newNode(node, namespace); // Ensure that the namespace is used only once
  7703. namespace = null;
  7704. });
  7705. this.position++;
  7706. };
  7707. _proto.word = function word(namespace) {
  7708. var nextToken = this.nextToken;
  7709. if (nextToken && this.content(nextToken) === '|') {
  7710. this.position++;
  7711. return this.namespace();
  7712. }
  7713. return this.splitWord(namespace);
  7714. };
  7715. _proto.loop = function loop() {
  7716. while (this.position < this.tokens.length) {
  7717. this.parse(true);
  7718. }
  7719. this.current._inferEndPosition();
  7720. return this.root;
  7721. };
  7722. _proto.parse = function parse(throwOnParenthesis) {
  7723. switch (this.currToken[_tokenize.FIELDS.TYPE]) {
  7724. case tokens.space:
  7725. this.space();
  7726. break;
  7727. case tokens.comment:
  7728. this.comment();
  7729. break;
  7730. case tokens.openParenthesis:
  7731. this.parentheses();
  7732. break;
  7733. case tokens.closeParenthesis:
  7734. if (throwOnParenthesis) {
  7735. this.missingParenthesis();
  7736. }
  7737. break;
  7738. case tokens.openSquare:
  7739. this.attribute();
  7740. break;
  7741. case tokens.dollar:
  7742. case tokens.caret:
  7743. case tokens.equals:
  7744. case tokens.word:
  7745. this.word();
  7746. break;
  7747. case tokens.colon:
  7748. this.pseudo();
  7749. break;
  7750. case tokens.comma:
  7751. this.comma();
  7752. break;
  7753. case tokens.asterisk:
  7754. this.universal();
  7755. break;
  7756. case tokens.ampersand:
  7757. this.nesting();
  7758. break;
  7759. case tokens.slash:
  7760. case tokens.combinator:
  7761. this.combinator();
  7762. break;
  7763. case tokens.str:
  7764. this.string();
  7765. break;
  7766. // These cases throw; no break needed.
  7767. case tokens.closeSquare:
  7768. this.missingSquareBracket();
  7769. case tokens.semicolon:
  7770. this.missingBackslash();
  7771. default:
  7772. this.unexpected();
  7773. }
  7774. }
  7775. /**
  7776. * Helpers
  7777. */
  7778. ;
  7779. _proto.expected = function expected(description, index, found) {
  7780. if (Array.isArray(description)) {
  7781. var last = description.pop();
  7782. description = description.join(', ') + " or " + last;
  7783. }
  7784. var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a';
  7785. if (!found) {
  7786. return this.error("Expected " + an + " " + description + ".", {
  7787. index: index
  7788. });
  7789. }
  7790. return this.error("Expected " + an + " " + description + ", found \"" + found + "\" instead.", {
  7791. index: index
  7792. });
  7793. };
  7794. _proto.requiredSpace = function requiredSpace(space) {
  7795. return this.options.lossy ? ' ' : space;
  7796. };
  7797. _proto.optionalSpace = function optionalSpace(space) {
  7798. return this.options.lossy ? '' : space;
  7799. };
  7800. _proto.lossySpace = function lossySpace(space, required) {
  7801. if (this.options.lossy) {
  7802. return required ? ' ' : '';
  7803. } else {
  7804. return space;
  7805. }
  7806. };
  7807. _proto.parseParenthesisToken = function parseParenthesisToken(token) {
  7808. var content = this.content(token);
  7809. if (token[_tokenize.FIELDS.TYPE] === tokens.space) {
  7810. return this.requiredSpace(content);
  7811. } else {
  7812. return content;
  7813. }
  7814. };
  7815. _proto.newNode = function newNode(node, namespace) {
  7816. if (namespace) {
  7817. if (/^ +$/.test(namespace)) {
  7818. if (!this.options.lossy) {
  7819. this.spaces = (this.spaces || '') + namespace;
  7820. }
  7821. namespace = true;
  7822. }
  7823. node.namespace = namespace;
  7824. unescapeProp(node, "namespace");
  7825. }
  7826. if (this.spaces) {
  7827. node.spaces.before = this.spaces;
  7828. this.spaces = '';
  7829. }
  7830. return this.current.append(node);
  7831. };
  7832. _proto.content = function content(token) {
  7833. if (token === void 0) {
  7834. token = this.currToken;
  7835. }
  7836. return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]);
  7837. };
  7838. /**
  7839. * returns the index of the next non-whitespace, non-comment token.
  7840. * returns -1 if no meaningful token is found.
  7841. */
  7842. _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) {
  7843. if (startPosition === void 0) {
  7844. startPosition = this.position + 1;
  7845. }
  7846. var searchPosition = startPosition;
  7847. while (searchPosition < this.tokens.length) {
  7848. if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) {
  7849. searchPosition++;
  7850. continue;
  7851. } else {
  7852. return searchPosition;
  7853. }
  7854. }
  7855. return -1;
  7856. };
  7857. _createClass(Parser, [{
  7858. key: "currToken",
  7859. get: function get() {
  7860. return this.tokens[this.position];
  7861. }
  7862. }, {
  7863. key: "nextToken",
  7864. get: function get() {
  7865. return this.tokens[this.position + 1];
  7866. }
  7867. }, {
  7868. key: "prevToken",
  7869. get: function get() {
  7870. return this.tokens[this.position - 1];
  7871. }
  7872. }]);
  7873. return Parser;
  7874. }();
  7875. exports["default"] = Parser;
  7876. module.exports = exports.default;
  7877. } (parser$1, parser$1.exports));
  7878. (function (module, exports) {
  7879. exports.__esModule = true;
  7880. exports["default"] = void 0;
  7881. var _parser = _interopRequireDefault(parser$1.exports);
  7882. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  7883. var Processor = /*#__PURE__*/function () {
  7884. function Processor(func, options) {
  7885. this.func = func || function noop() {};
  7886. this.funcRes = null;
  7887. this.options = options;
  7888. }
  7889. var _proto = Processor.prototype;
  7890. _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) {
  7891. if (options === void 0) {
  7892. options = {};
  7893. }
  7894. var merged = Object.assign({}, this.options, options);
  7895. if (merged.updateSelector === false) {
  7896. return false;
  7897. } else {
  7898. return typeof rule !== "string";
  7899. }
  7900. };
  7901. _proto._isLossy = function _isLossy(options) {
  7902. if (options === void 0) {
  7903. options = {};
  7904. }
  7905. var merged = Object.assign({}, this.options, options);
  7906. if (merged.lossless === false) {
  7907. return true;
  7908. } else {
  7909. return false;
  7910. }
  7911. };
  7912. _proto._root = function _root(rule, options) {
  7913. if (options === void 0) {
  7914. options = {};
  7915. }
  7916. var parser = new _parser["default"](rule, this._parseOptions(options));
  7917. return parser.root;
  7918. };
  7919. _proto._parseOptions = function _parseOptions(options) {
  7920. return {
  7921. lossy: this._isLossy(options)
  7922. };
  7923. };
  7924. _proto._run = function _run(rule, options) {
  7925. var _this = this;
  7926. if (options === void 0) {
  7927. options = {};
  7928. }
  7929. return new Promise(function (resolve, reject) {
  7930. try {
  7931. var root = _this._root(rule, options);
  7932. Promise.resolve(_this.func(root)).then(function (transform) {
  7933. var string = undefined;
  7934. if (_this._shouldUpdateSelector(rule, options)) {
  7935. string = root.toString();
  7936. rule.selector = string;
  7937. }
  7938. return {
  7939. transform: transform,
  7940. root: root,
  7941. string: string
  7942. };
  7943. }).then(resolve, reject);
  7944. } catch (e) {
  7945. reject(e);
  7946. return;
  7947. }
  7948. });
  7949. };
  7950. _proto._runSync = function _runSync(rule, options) {
  7951. if (options === void 0) {
  7952. options = {};
  7953. }
  7954. var root = this._root(rule, options);
  7955. var transform = this.func(root);
  7956. if (transform && typeof transform.then === "function") {
  7957. throw new Error("Selector processor returned a promise to a synchronous call.");
  7958. }
  7959. var string = undefined;
  7960. if (options.updateSelector && typeof rule !== "string") {
  7961. string = root.toString();
  7962. rule.selector = string;
  7963. }
  7964. return {
  7965. transform: transform,
  7966. root: root,
  7967. string: string
  7968. };
  7969. }
  7970. /**
  7971. * Process rule into a selector AST.
  7972. *
  7973. * @param rule {postcss.Rule | string} The css selector to be processed
  7974. * @param options The options for processing
  7975. * @returns {Promise<parser.Root>} The AST of the selector after processing it.
  7976. */
  7977. ;
  7978. _proto.ast = function ast(rule, options) {
  7979. return this._run(rule, options).then(function (result) {
  7980. return result.root;
  7981. });
  7982. }
  7983. /**
  7984. * Process rule into a selector AST synchronously.
  7985. *
  7986. * @param rule {postcss.Rule | string} The css selector to be processed
  7987. * @param options The options for processing
  7988. * @returns {parser.Root} The AST of the selector after processing it.
  7989. */
  7990. ;
  7991. _proto.astSync = function astSync(rule, options) {
  7992. return this._runSync(rule, options).root;
  7993. }
  7994. /**
  7995. * Process a selector into a transformed value asynchronously
  7996. *
  7997. * @param rule {postcss.Rule | string} The css selector to be processed
  7998. * @param options The options for processing
  7999. * @returns {Promise<any>} The value returned by the processor.
  8000. */
  8001. ;
  8002. _proto.transform = function transform(rule, options) {
  8003. return this._run(rule, options).then(function (result) {
  8004. return result.transform;
  8005. });
  8006. }
  8007. /**
  8008. * Process a selector into a transformed value synchronously.
  8009. *
  8010. * @param rule {postcss.Rule | string} The css selector to be processed
  8011. * @param options The options for processing
  8012. * @returns {any} The value returned by the processor.
  8013. */
  8014. ;
  8015. _proto.transformSync = function transformSync(rule, options) {
  8016. return this._runSync(rule, options).transform;
  8017. }
  8018. /**
  8019. * Process a selector into a new selector string asynchronously.
  8020. *
  8021. * @param rule {postcss.Rule | string} The css selector to be processed
  8022. * @param options The options for processing
  8023. * @returns {string} the selector after processing.
  8024. */
  8025. ;
  8026. _proto.process = function process(rule, options) {
  8027. return this._run(rule, options).then(function (result) {
  8028. return result.string || result.root.toString();
  8029. });
  8030. }
  8031. /**
  8032. * Process a selector into a new selector string synchronously.
  8033. *
  8034. * @param rule {postcss.Rule | string} The css selector to be processed
  8035. * @param options The options for processing
  8036. * @returns {string} the selector after processing.
  8037. */
  8038. ;
  8039. _proto.processSync = function processSync(rule, options) {
  8040. var result = this._runSync(rule, options);
  8041. return result.string || result.root.toString();
  8042. };
  8043. return Processor;
  8044. }();
  8045. exports["default"] = Processor;
  8046. module.exports = exports.default;
  8047. } (processor, processor.exports));
  8048. var selectors = {};
  8049. var constructors = {};
  8050. constructors.__esModule = true;
  8051. constructors.universal = constructors.tag = constructors.string = constructors.selector = constructors.root = constructors.pseudo = constructors.nesting = constructors.id = constructors.comment = constructors.combinator = constructors.className = constructors.attribute = void 0;
  8052. var _attribute = _interopRequireDefault$5(attribute$1);
  8053. var _className = _interopRequireDefault$5(className$1.exports);
  8054. var _combinator = _interopRequireDefault$5(combinator$2.exports);
  8055. var _comment = _interopRequireDefault$5(comment$2.exports);
  8056. var _id = _interopRequireDefault$5(id$1.exports);
  8057. var _nesting = _interopRequireDefault$5(nesting$1.exports);
  8058. var _pseudo = _interopRequireDefault$5(pseudo$1.exports);
  8059. var _root = _interopRequireDefault$5(root$2.exports);
  8060. var _selector = _interopRequireDefault$5(selector$1.exports);
  8061. var _string = _interopRequireDefault$5(string$1.exports);
  8062. var _tag = _interopRequireDefault$5(tag$1.exports);
  8063. var _universal = _interopRequireDefault$5(universal$1.exports);
  8064. function _interopRequireDefault$5(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  8065. var attribute = function attribute(opts) {
  8066. return new _attribute["default"](opts);
  8067. };
  8068. constructors.attribute = attribute;
  8069. var className = function className(opts) {
  8070. return new _className["default"](opts);
  8071. };
  8072. constructors.className = className;
  8073. var combinator = function combinator(opts) {
  8074. return new _combinator["default"](opts);
  8075. };
  8076. constructors.combinator = combinator;
  8077. var comment = function comment(opts) {
  8078. return new _comment["default"](opts);
  8079. };
  8080. constructors.comment = comment;
  8081. var id = function id(opts) {
  8082. return new _id["default"](opts);
  8083. };
  8084. constructors.id = id;
  8085. var nesting = function nesting(opts) {
  8086. return new _nesting["default"](opts);
  8087. };
  8088. constructors.nesting = nesting;
  8089. var pseudo = function pseudo(opts) {
  8090. return new _pseudo["default"](opts);
  8091. };
  8092. constructors.pseudo = pseudo;
  8093. var root$1 = function root(opts) {
  8094. return new _root["default"](opts);
  8095. };
  8096. constructors.root = root$1;
  8097. var selector = function selector(opts) {
  8098. return new _selector["default"](opts);
  8099. };
  8100. constructors.selector = selector;
  8101. var string = function string(opts) {
  8102. return new _string["default"](opts);
  8103. };
  8104. constructors.string = string;
  8105. var tag = function tag(opts) {
  8106. return new _tag["default"](opts);
  8107. };
  8108. constructors.tag = tag;
  8109. var universal = function universal(opts) {
  8110. return new _universal["default"](opts);
  8111. };
  8112. constructors.universal = universal;
  8113. var guards = {};
  8114. guards.__esModule = true;
  8115. guards.isNode = isNode;
  8116. guards.isPseudoElement = isPseudoElement;
  8117. guards.isPseudoClass = isPseudoClass;
  8118. guards.isContainer = isContainer;
  8119. guards.isNamespace = isNamespace;
  8120. guards.isUniversal = guards.isTag = guards.isString = guards.isSelector = guards.isRoot = guards.isPseudo = guards.isNesting = guards.isIdentifier = guards.isComment = guards.isCombinator = guards.isClassName = guards.isAttribute = void 0;
  8121. var _types = types;
  8122. var _IS_TYPE;
  8123. var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE);
  8124. function isNode(node) {
  8125. return typeof node === "object" && IS_TYPE[node.type];
  8126. }
  8127. function isNodeType(type, node) {
  8128. return isNode(node) && node.type === type;
  8129. }
  8130. var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE);
  8131. guards.isAttribute = isAttribute;
  8132. var isClassName = isNodeType.bind(null, _types.CLASS);
  8133. guards.isClassName = isClassName;
  8134. var isCombinator = isNodeType.bind(null, _types.COMBINATOR);
  8135. guards.isCombinator = isCombinator;
  8136. var isComment = isNodeType.bind(null, _types.COMMENT);
  8137. guards.isComment = isComment;
  8138. var isIdentifier = isNodeType.bind(null, _types.ID);
  8139. guards.isIdentifier = isIdentifier;
  8140. var isNesting = isNodeType.bind(null, _types.NESTING);
  8141. guards.isNesting = isNesting;
  8142. var isPseudo = isNodeType.bind(null, _types.PSEUDO);
  8143. guards.isPseudo = isPseudo;
  8144. var isRoot = isNodeType.bind(null, _types.ROOT);
  8145. guards.isRoot = isRoot;
  8146. var isSelector = isNodeType.bind(null, _types.SELECTOR);
  8147. guards.isSelector = isSelector;
  8148. var isString = isNodeType.bind(null, _types.STRING);
  8149. guards.isString = isString;
  8150. var isTag = isNodeType.bind(null, _types.TAG);
  8151. guards.isTag = isTag;
  8152. var isUniversal = isNodeType.bind(null, _types.UNIVERSAL);
  8153. guards.isUniversal = isUniversal;
  8154. function isPseudoElement(node) {
  8155. return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after");
  8156. }
  8157. function isPseudoClass(node) {
  8158. return isPseudo(node) && !isPseudoElement(node);
  8159. }
  8160. function isContainer(node) {
  8161. return !!(isNode(node) && node.walk);
  8162. }
  8163. function isNamespace(node) {
  8164. return isAttribute(node) || isTag(node);
  8165. }
  8166. (function (exports) {
  8167. exports.__esModule = true;
  8168. var _types = types;
  8169. Object.keys(_types).forEach(function (key) {
  8170. if (key === "default" || key === "__esModule") return;
  8171. if (key in exports && exports[key] === _types[key]) return;
  8172. exports[key] = _types[key];
  8173. });
  8174. var _constructors = constructors;
  8175. Object.keys(_constructors).forEach(function (key) {
  8176. if (key === "default" || key === "__esModule") return;
  8177. if (key in exports && exports[key] === _constructors[key]) return;
  8178. exports[key] = _constructors[key];
  8179. });
  8180. var _guards = guards;
  8181. Object.keys(_guards).forEach(function (key) {
  8182. if (key === "default" || key === "__esModule") return;
  8183. if (key in exports && exports[key] === _guards[key]) return;
  8184. exports[key] = _guards[key];
  8185. });
  8186. } (selectors));
  8187. (function (module, exports) {
  8188. exports.__esModule = true;
  8189. exports["default"] = void 0;
  8190. var _processor = _interopRequireDefault(processor.exports);
  8191. var selectors$1 = _interopRequireWildcard(selectors);
  8192. function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
  8193. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  8194. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  8195. var parser = function parser(processor) {
  8196. return new _processor["default"](processor);
  8197. };
  8198. Object.assign(parser, selectors$1);
  8199. delete parser.__esModule;
  8200. var _default = parser;
  8201. exports["default"] = _default;
  8202. module.exports = exports.default;
  8203. } (dist, dist.exports));
  8204. var selectorParser$2 = /*@__PURE__*/getDefaultExportFromCjs(dist.exports);
  8205. const animationNameRE = /^(-\w+-)?animation-name$/;
  8206. const animationRE = /^(-\w+-)?animation$/;
  8207. const scopedPlugin = (id = '') => {
  8208. const keyframes = Object.create(null);
  8209. const shortId = id.replace(/^data-v-/, '');
  8210. return {
  8211. postcssPlugin: 'vue-sfc-scoped',
  8212. Rule(rule) {
  8213. processRule(id, rule);
  8214. },
  8215. AtRule(node) {
  8216. if (/-?keyframes$/.test(node.name) &&
  8217. !node.params.endsWith(`-${shortId}`)) {
  8218. // register keyframes
  8219. keyframes[node.params] = node.params = node.params + '-' + shortId;
  8220. }
  8221. },
  8222. OnceExit(root) {
  8223. if (Object.keys(keyframes).length) {
  8224. // If keyframes are found in this <style>, find and rewrite animation names
  8225. // in declarations.
  8226. // Caveat: this only works for keyframes and animation rules in the same
  8227. // <style> element.
  8228. // individual animation-name declaration
  8229. root.walkDecls(decl => {
  8230. if (animationNameRE.test(decl.prop)) {
  8231. decl.value = decl.value
  8232. .split(',')
  8233. .map(v => keyframes[v.trim()] || v.trim())
  8234. .join(',');
  8235. }
  8236. // shorthand
  8237. if (animationRE.test(decl.prop)) {
  8238. decl.value = decl.value
  8239. .split(',')
  8240. .map(v => {
  8241. const vals = v.trim().split(/\s+/);
  8242. const i = vals.findIndex(val => keyframes[val]);
  8243. if (i !== -1) {
  8244. vals.splice(i, 1, keyframes[vals[i]]);
  8245. return vals.join(' ');
  8246. }
  8247. else {
  8248. return v;
  8249. }
  8250. })
  8251. .join(',');
  8252. }
  8253. });
  8254. }
  8255. }
  8256. };
  8257. };
  8258. const processedRules = new WeakSet();
  8259. function processRule(id, rule) {
  8260. if (processedRules.has(rule) ||
  8261. (rule.parent &&
  8262. rule.parent.type === 'atrule' &&
  8263. /-?keyframes$/.test(rule.parent.name))) {
  8264. return;
  8265. }
  8266. processedRules.add(rule);
  8267. rule.selector = selectorParser$2(selectorRoot => {
  8268. selectorRoot.each(selector => {
  8269. rewriteSelector(id, selector, selectorRoot);
  8270. });
  8271. }).processSync(rule.selector);
  8272. }
  8273. function rewriteSelector(id, selector, selectorRoot, slotted = false) {
  8274. let node = null;
  8275. let shouldInject = true;
  8276. // find the last child node to insert attribute selector
  8277. selector.each(n => {
  8278. // DEPRECATED ">>>" and "/deep/" combinator
  8279. if (n.type === 'combinator' &&
  8280. (n.value === '>>>' || n.value === '/deep/')) {
  8281. n.value = ' ';
  8282. n.spaces.before = n.spaces.after = '';
  8283. warn(`the >>> and /deep/ combinators have been deprecated. ` +
  8284. `Use :deep() instead.`);
  8285. return false;
  8286. }
  8287. if (n.type === 'pseudo') {
  8288. const { value } = n;
  8289. // deep: inject [id] attribute at the node before the ::v-deep
  8290. // combinator.
  8291. if (value === ':deep' || value === '::v-deep') {
  8292. if (n.nodes.length) {
  8293. // .foo ::v-deep(.bar) -> .foo[xxxxxxx] .bar
  8294. // replace the current node with ::v-deep's inner selector
  8295. let last = n;
  8296. n.nodes[0].each(ss => {
  8297. selector.insertAfter(last, ss);
  8298. last = ss;
  8299. });
  8300. // insert a space combinator before if it doesn't already have one
  8301. const prev = selector.at(selector.index(n) - 1);
  8302. if (!prev || !isSpaceCombinator(prev)) {
  8303. selector.insertAfter(n, selectorParser$2.combinator({
  8304. value: ' '
  8305. }));
  8306. }
  8307. selector.removeChild(n);
  8308. }
  8309. else {
  8310. // DEPRECATED usage
  8311. // .foo ::v-deep .bar -> .foo[xxxxxxx] .bar
  8312. warn(`::v-deep usage as a combinator has ` +
  8313. `been deprecated. Use :deep(<inner-selector>) instead.`);
  8314. const prev = selector.at(selector.index(n) - 1);
  8315. if (prev && isSpaceCombinator(prev)) {
  8316. selector.removeChild(prev);
  8317. }
  8318. selector.removeChild(n);
  8319. }
  8320. return false;
  8321. }
  8322. // slot: use selector inside `::v-slotted` and inject [id + '-s']
  8323. // instead.
  8324. // ::v-slotted(.foo) -> .foo[xxxxxxx-s]
  8325. if (value === ':slotted' || value === '::v-slotted') {
  8326. rewriteSelector(id, n.nodes[0], selectorRoot, true /* slotted */);
  8327. let last = n;
  8328. n.nodes[0].each(ss => {
  8329. selector.insertAfter(last, ss);
  8330. last = ss;
  8331. });
  8332. // selector.insertAfter(n, n.nodes[0])
  8333. selector.removeChild(n);
  8334. // since slotted attribute already scopes the selector there's no
  8335. // need for the non-slot attribute.
  8336. shouldInject = false;
  8337. return false;
  8338. }
  8339. // global: replace with inner selector and do not inject [id].
  8340. // ::v-global(.foo) -> .foo
  8341. if (value === ':global' || value === '::v-global') {
  8342. selectorRoot.insertAfter(selector, n.nodes[0]);
  8343. selectorRoot.removeChild(selector);
  8344. return false;
  8345. }
  8346. }
  8347. if (n.type !== 'pseudo' && n.type !== 'combinator') {
  8348. node = n;
  8349. }
  8350. });
  8351. if (node) {
  8352. node.spaces.after = '';
  8353. }
  8354. else {
  8355. // For deep selectors & standalone pseudo selectors,
  8356. // the attribute selectors are prepended rather than appended.
  8357. // So all leading spaces must be eliminated to avoid problems.
  8358. selector.first.spaces.before = '';
  8359. }
  8360. if (shouldInject) {
  8361. const idToAdd = slotted ? id + '-s' : id;
  8362. selector.insertAfter(
  8363. // If node is null it means we need to inject [id] at the start
  8364. // insertAfter can handle `null` here
  8365. node, selectorParser$2.attribute({
  8366. attribute: idToAdd,
  8367. value: idToAdd,
  8368. raws: {},
  8369. quoteMark: `"`
  8370. }));
  8371. }
  8372. }
  8373. function isSpaceCombinator(node) {
  8374. return node.type === 'combinator' && /^\s+$/.test(node.value);
  8375. }
  8376. scopedPlugin.postcss = true;
  8377. var scopedPlugin$1 = scopedPlugin;
  8378. var sourceMap = require$$0$2;
  8379. var SourceMapConsumer = sourceMap.SourceMapConsumer;
  8380. var SourceMapGenerator = sourceMap.SourceMapGenerator;
  8381. var mergeSourceMap = merge;
  8382. /**
  8383. * Merge old source map and new source map and return merged.
  8384. * If old or new source map value is falsy, return another one as it is.
  8385. *
  8386. * @param {object|string} [oldMap] old source map object
  8387. * @param {object|string} [newmap] new source map object
  8388. * @return {object|undefined} merged source map object, or undefined when both old and new source map are undefined
  8389. */
  8390. function merge(oldMap, newMap) {
  8391. if (!oldMap) return newMap
  8392. if (!newMap) return oldMap
  8393. var oldMapConsumer = new SourceMapConsumer(oldMap);
  8394. var newMapConsumer = new SourceMapConsumer(newMap);
  8395. var mergedMapGenerator = new SourceMapGenerator();
  8396. // iterate on new map and overwrite original position of new map with one of old map
  8397. newMapConsumer.eachMapping(function(m) {
  8398. // pass when `originalLine` is null.
  8399. // It occurs in case that the node does not have origin in original code.
  8400. if (m.originalLine == null) return
  8401. var origPosInOldMap = oldMapConsumer.originalPositionFor({
  8402. line: m.originalLine,
  8403. column: m.originalColumn
  8404. });
  8405. if (origPosInOldMap.source == null) return
  8406. mergedMapGenerator.addMapping({
  8407. original: {
  8408. line: origPosInOldMap.line,
  8409. column: origPosInOldMap.column
  8410. },
  8411. generated: {
  8412. line: m.generatedLine,
  8413. column: m.generatedColumn
  8414. },
  8415. source: origPosInOldMap.source,
  8416. name: origPosInOldMap.name
  8417. });
  8418. });
  8419. var consumers = [oldMapConsumer, newMapConsumer];
  8420. consumers.forEach(function(consumer) {
  8421. consumer.sources.forEach(function(sourceFile) {
  8422. mergedMapGenerator._sources.add(sourceFile);
  8423. var sourceContent = consumer.sourceContentFor(sourceFile);
  8424. if (sourceContent != null) {
  8425. mergedMapGenerator.setSourceContent(sourceFile, sourceContent);
  8426. }
  8427. });
  8428. });
  8429. mergedMapGenerator._sourceRoot = oldMap.sourceRoot;
  8430. mergedMapGenerator._file = oldMap.file;
  8431. return JSON.parse(mergedMapGenerator.toString())
  8432. }
  8433. var merge$1 = mergeSourceMap;
  8434. // .scss/.sass processor
  8435. const scss = (source, map, options, load = require) => {
  8436. const nodeSass = load('sass');
  8437. const finalOptions = {
  8438. ...options,
  8439. data: getSource(source, options.filename, options.additionalData),
  8440. file: options.filename,
  8441. outFile: options.filename,
  8442. sourceMap: !!map
  8443. };
  8444. try {
  8445. const result = nodeSass.renderSync(finalOptions);
  8446. const dependencies = result.stats.includedFiles;
  8447. if (map) {
  8448. return {
  8449. code: result.css.toString(),
  8450. map: merge$1(map, JSON.parse(result.map.toString())),
  8451. errors: [],
  8452. dependencies
  8453. };
  8454. }
  8455. return { code: result.css.toString(), errors: [], dependencies };
  8456. }
  8457. catch (e) {
  8458. return { code: '', errors: [e], dependencies: [] };
  8459. }
  8460. };
  8461. const sass = (source, map, options, load) => scss(source, map, {
  8462. ...options,
  8463. indentedSyntax: true
  8464. }, load);
  8465. // .less
  8466. const less = (source, map, options, load = require) => {
  8467. const nodeLess = load('less');
  8468. let result;
  8469. let error = null;
  8470. nodeLess.render(getSource(source, options.filename, options.additionalData), { ...options, syncImport: true }, (err, output) => {
  8471. error = err;
  8472. result = output;
  8473. });
  8474. if (error)
  8475. return { code: '', errors: [error], dependencies: [] };
  8476. const dependencies = result.imports;
  8477. if (map) {
  8478. return {
  8479. code: result.css.toString(),
  8480. map: merge$1(map, result.map),
  8481. errors: [],
  8482. dependencies: dependencies
  8483. };
  8484. }
  8485. return {
  8486. code: result.css.toString(),
  8487. errors: [],
  8488. dependencies: dependencies
  8489. };
  8490. };
  8491. // .styl
  8492. const styl = (source, map, options, load = require) => {
  8493. const nodeStylus = load('stylus');
  8494. try {
  8495. const ref = nodeStylus(source);
  8496. Object.keys(options).forEach(key => ref.set(key, options[key]));
  8497. if (map)
  8498. ref.set('sourcemap', { inline: false, comment: false });
  8499. const result = ref.render();
  8500. const dependencies = ref.deps();
  8501. if (map) {
  8502. return {
  8503. code: result,
  8504. map: merge$1(map, ref.sourcemap),
  8505. errors: [],
  8506. dependencies
  8507. };
  8508. }
  8509. return { code: result, errors: [], dependencies };
  8510. }
  8511. catch (e) {
  8512. return { code: '', errors: [e], dependencies: [] };
  8513. }
  8514. };
  8515. function getSource(source, filename, additionalData) {
  8516. if (!additionalData)
  8517. return source;
  8518. if (shared.isFunction(additionalData)) {
  8519. return additionalData(source, filename);
  8520. }
  8521. return additionalData + source;
  8522. }
  8523. const processors = {
  8524. less,
  8525. sass,
  8526. scss,
  8527. styl,
  8528. stylus: styl
  8529. };
  8530. var build = {exports: {}};
  8531. /**
  8532. * lodash (Custom Build) <https://lodash.com/>
  8533. * Build: `lodash modularize exports="npm" -o ./`
  8534. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  8535. * Released under MIT license <https://lodash.com/license>
  8536. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  8537. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  8538. */
  8539. /** Used as references for various `Number` constants. */
  8540. var INFINITY = 1 / 0;
  8541. /** `Object#toString` result references. */
  8542. var symbolTag = '[object Symbol]';
  8543. /** Used to match words composed of alphanumeric characters. */
  8544. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  8545. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  8546. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  8547. /** Used to compose unicode character classes. */
  8548. var rsAstralRange = '\\ud800-\\udfff',
  8549. rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
  8550. rsComboSymbolsRange = '\\u20d0-\\u20f0',
  8551. rsDingbatRange = '\\u2700-\\u27bf',
  8552. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  8553. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  8554. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  8555. rsPunctuationRange = '\\u2000-\\u206f',
  8556. rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
  8557. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  8558. rsVarRange = '\\ufe0e\\ufe0f',
  8559. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  8560. /** Used to compose unicode capture groups. */
  8561. var rsApos = "['\u2019]",
  8562. rsAstral = '[' + rsAstralRange + ']',
  8563. rsBreak = '[' + rsBreakRange + ']',
  8564. rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
  8565. rsDigits = '\\d+',
  8566. rsDingbat = '[' + rsDingbatRange + ']',
  8567. rsLower = '[' + rsLowerRange + ']',
  8568. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  8569. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  8570. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  8571. rsNonAstral = '[^' + rsAstralRange + ']',
  8572. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  8573. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  8574. rsUpper = '[' + rsUpperRange + ']',
  8575. rsZWJ = '\\u200d';
  8576. /** Used to compose unicode regexes. */
  8577. var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',
  8578. rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',
  8579. rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  8580. rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  8581. reOptMod = rsModifier + '?',
  8582. rsOptVar = '[' + rsVarRange + ']?',
  8583. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  8584. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  8585. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  8586. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  8587. /** Used to match apostrophes. */
  8588. var reApos = RegExp(rsApos, 'g');
  8589. /**
  8590. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  8591. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  8592. */
  8593. var reComboMark = RegExp(rsCombo, 'g');
  8594. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  8595. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  8596. /** Used to match complex or compound words. */
  8597. var reUnicodeWord = RegExp([
  8598. rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  8599. rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',
  8600. rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr,
  8601. rsUpper + '+' + rsOptUpperContr,
  8602. rsDigits,
  8603. rsEmoji
  8604. ].join('|'), 'g');
  8605. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  8606. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
  8607. /** Used to detect strings that need a more robust regexp to match words. */
  8608. var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
  8609. /** Used to map Latin Unicode letters to basic Latin letters. */
  8610. var deburredLetters = {
  8611. // Latin-1 Supplement block.
  8612. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  8613. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  8614. '\xc7': 'C', '\xe7': 'c',
  8615. '\xd0': 'D', '\xf0': 'd',
  8616. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  8617. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  8618. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  8619. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  8620. '\xd1': 'N', '\xf1': 'n',
  8621. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  8622. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  8623. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  8624. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  8625. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  8626. '\xc6': 'Ae', '\xe6': 'ae',
  8627. '\xde': 'Th', '\xfe': 'th',
  8628. '\xdf': 'ss',
  8629. // Latin Extended-A block.
  8630. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  8631. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  8632. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  8633. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  8634. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  8635. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  8636. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  8637. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  8638. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  8639. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  8640. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  8641. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  8642. '\u0134': 'J', '\u0135': 'j',
  8643. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  8644. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  8645. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  8646. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  8647. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  8648. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  8649. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  8650. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  8651. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  8652. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  8653. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  8654. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  8655. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  8656. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  8657. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  8658. '\u0174': 'W', '\u0175': 'w',
  8659. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  8660. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  8661. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  8662. '\u0132': 'IJ', '\u0133': 'ij',
  8663. '\u0152': 'Oe', '\u0153': 'oe',
  8664. '\u0149': "'n", '\u017f': 'ss'
  8665. };
  8666. /** Detect free variable `global` from Node.js. */
  8667. var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
  8668. /** Detect free variable `self`. */
  8669. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  8670. /** Used as a reference to the global object. */
  8671. var root = freeGlobal || freeSelf || Function('return this')();
  8672. /**
  8673. * A specialized version of `_.reduce` for arrays without support for
  8674. * iteratee shorthands.
  8675. *
  8676. * @private
  8677. * @param {Array} [array] The array to iterate over.
  8678. * @param {Function} iteratee The function invoked per iteration.
  8679. * @param {*} [accumulator] The initial value.
  8680. * @param {boolean} [initAccum] Specify using the first element of `array` as
  8681. * the initial value.
  8682. * @returns {*} Returns the accumulated value.
  8683. */
  8684. function arrayReduce(array, iteratee, accumulator, initAccum) {
  8685. var index = -1,
  8686. length = array ? array.length : 0;
  8687. if (initAccum && length) {
  8688. accumulator = array[++index];
  8689. }
  8690. while (++index < length) {
  8691. accumulator = iteratee(accumulator, array[index], index, array);
  8692. }
  8693. return accumulator;
  8694. }
  8695. /**
  8696. * Converts an ASCII `string` to an array.
  8697. *
  8698. * @private
  8699. * @param {string} string The string to convert.
  8700. * @returns {Array} Returns the converted array.
  8701. */
  8702. function asciiToArray(string) {
  8703. return string.split('');
  8704. }
  8705. /**
  8706. * Splits an ASCII `string` into an array of its words.
  8707. *
  8708. * @private
  8709. * @param {string} The string to inspect.
  8710. * @returns {Array} Returns the words of `string`.
  8711. */
  8712. function asciiWords(string) {
  8713. return string.match(reAsciiWord) || [];
  8714. }
  8715. /**
  8716. * The base implementation of `_.propertyOf` without support for deep paths.
  8717. *
  8718. * @private
  8719. * @param {Object} object The object to query.
  8720. * @returns {Function} Returns the new accessor function.
  8721. */
  8722. function basePropertyOf(object) {
  8723. return function(key) {
  8724. return object == null ? undefined : object[key];
  8725. };
  8726. }
  8727. /**
  8728. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  8729. * letters to basic Latin letters.
  8730. *
  8731. * @private
  8732. * @param {string} letter The matched letter to deburr.
  8733. * @returns {string} Returns the deburred letter.
  8734. */
  8735. var deburrLetter = basePropertyOf(deburredLetters);
  8736. /**
  8737. * Checks if `string` contains Unicode symbols.
  8738. *
  8739. * @private
  8740. * @param {string} string The string to inspect.
  8741. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  8742. */
  8743. function hasUnicode(string) {
  8744. return reHasUnicode.test(string);
  8745. }
  8746. /**
  8747. * Checks if `string` contains a word composed of Unicode symbols.
  8748. *
  8749. * @private
  8750. * @param {string} string The string to inspect.
  8751. * @returns {boolean} Returns `true` if a word is found, else `false`.
  8752. */
  8753. function hasUnicodeWord(string) {
  8754. return reHasUnicodeWord.test(string);
  8755. }
  8756. /**
  8757. * Converts `string` to an array.
  8758. *
  8759. * @private
  8760. * @param {string} string The string to convert.
  8761. * @returns {Array} Returns the converted array.
  8762. */
  8763. function stringToArray(string) {
  8764. return hasUnicode(string)
  8765. ? unicodeToArray(string)
  8766. : asciiToArray(string);
  8767. }
  8768. /**
  8769. * Converts a Unicode `string` to an array.
  8770. *
  8771. * @private
  8772. * @param {string} string The string to convert.
  8773. * @returns {Array} Returns the converted array.
  8774. */
  8775. function unicodeToArray(string) {
  8776. return string.match(reUnicode) || [];
  8777. }
  8778. /**
  8779. * Splits a Unicode `string` into an array of its words.
  8780. *
  8781. * @private
  8782. * @param {string} The string to inspect.
  8783. * @returns {Array} Returns the words of `string`.
  8784. */
  8785. function unicodeWords(string) {
  8786. return string.match(reUnicodeWord) || [];
  8787. }
  8788. /** Used for built-in method references. */
  8789. var objectProto = Object.prototype;
  8790. /**
  8791. * Used to resolve the
  8792. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  8793. * of values.
  8794. */
  8795. var objectToString = objectProto.toString;
  8796. /** Built-in value references. */
  8797. var Symbol$1 = root.Symbol;
  8798. /** Used to convert symbols to primitives and strings. */
  8799. var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
  8800. symbolToString = symbolProto ? symbolProto.toString : undefined;
  8801. /**
  8802. * The base implementation of `_.slice` without an iteratee call guard.
  8803. *
  8804. * @private
  8805. * @param {Array} array The array to slice.
  8806. * @param {number} [start=0] The start position.
  8807. * @param {number} [end=array.length] The end position.
  8808. * @returns {Array} Returns the slice of `array`.
  8809. */
  8810. function baseSlice(array, start, end) {
  8811. var index = -1,
  8812. length = array.length;
  8813. if (start < 0) {
  8814. start = -start > length ? 0 : (length + start);
  8815. }
  8816. end = end > length ? length : end;
  8817. if (end < 0) {
  8818. end += length;
  8819. }
  8820. length = start > end ? 0 : ((end - start) >>> 0);
  8821. start >>>= 0;
  8822. var result = Array(length);
  8823. while (++index < length) {
  8824. result[index] = array[index + start];
  8825. }
  8826. return result;
  8827. }
  8828. /**
  8829. * The base implementation of `_.toString` which doesn't convert nullish
  8830. * values to empty strings.
  8831. *
  8832. * @private
  8833. * @param {*} value The value to process.
  8834. * @returns {string} Returns the string.
  8835. */
  8836. function baseToString(value) {
  8837. // Exit early for strings to avoid a performance hit in some environments.
  8838. if (typeof value == 'string') {
  8839. return value;
  8840. }
  8841. if (isSymbol(value)) {
  8842. return symbolToString ? symbolToString.call(value) : '';
  8843. }
  8844. var result = (value + '');
  8845. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  8846. }
  8847. /**
  8848. * Casts `array` to a slice if it's needed.
  8849. *
  8850. * @private
  8851. * @param {Array} array The array to inspect.
  8852. * @param {number} start The start position.
  8853. * @param {number} [end=array.length] The end position.
  8854. * @returns {Array} Returns the cast slice.
  8855. */
  8856. function castSlice(array, start, end) {
  8857. var length = array.length;
  8858. end = end === undefined ? length : end;
  8859. return (!start && end >= length) ? array : baseSlice(array, start, end);
  8860. }
  8861. /**
  8862. * Creates a function like `_.lowerFirst`.
  8863. *
  8864. * @private
  8865. * @param {string} methodName The name of the `String` case method to use.
  8866. * @returns {Function} Returns the new case function.
  8867. */
  8868. function createCaseFirst(methodName) {
  8869. return function(string) {
  8870. string = toString(string);
  8871. var strSymbols = hasUnicode(string)
  8872. ? stringToArray(string)
  8873. : undefined;
  8874. var chr = strSymbols
  8875. ? strSymbols[0]
  8876. : string.charAt(0);
  8877. var trailing = strSymbols
  8878. ? castSlice(strSymbols, 1).join('')
  8879. : string.slice(1);
  8880. return chr[methodName]() + trailing;
  8881. };
  8882. }
  8883. /**
  8884. * Creates a function like `_.camelCase`.
  8885. *
  8886. * @private
  8887. * @param {Function} callback The function to combine each word.
  8888. * @returns {Function} Returns the new compounder function.
  8889. */
  8890. function createCompounder(callback) {
  8891. return function(string) {
  8892. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  8893. };
  8894. }
  8895. /**
  8896. * Checks if `value` is object-like. A value is object-like if it's not `null`
  8897. * and has a `typeof` result of "object".
  8898. *
  8899. * @static
  8900. * @memberOf _
  8901. * @since 4.0.0
  8902. * @category Lang
  8903. * @param {*} value The value to check.
  8904. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  8905. * @example
  8906. *
  8907. * _.isObjectLike({});
  8908. * // => true
  8909. *
  8910. * _.isObjectLike([1, 2, 3]);
  8911. * // => true
  8912. *
  8913. * _.isObjectLike(_.noop);
  8914. * // => false
  8915. *
  8916. * _.isObjectLike(null);
  8917. * // => false
  8918. */
  8919. function isObjectLike(value) {
  8920. return !!value && typeof value == 'object';
  8921. }
  8922. /**
  8923. * Checks if `value` is classified as a `Symbol` primitive or object.
  8924. *
  8925. * @static
  8926. * @memberOf _
  8927. * @since 4.0.0
  8928. * @category Lang
  8929. * @param {*} value The value to check.
  8930. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  8931. * @example
  8932. *
  8933. * _.isSymbol(Symbol.iterator);
  8934. * // => true
  8935. *
  8936. * _.isSymbol('abc');
  8937. * // => false
  8938. */
  8939. function isSymbol(value) {
  8940. return typeof value == 'symbol' ||
  8941. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  8942. }
  8943. /**
  8944. * Converts `value` to a string. An empty string is returned for `null`
  8945. * and `undefined` values. The sign of `-0` is preserved.
  8946. *
  8947. * @static
  8948. * @memberOf _
  8949. * @since 4.0.0
  8950. * @category Lang
  8951. * @param {*} value The value to process.
  8952. * @returns {string} Returns the string.
  8953. * @example
  8954. *
  8955. * _.toString(null);
  8956. * // => ''
  8957. *
  8958. * _.toString(-0);
  8959. * // => '-0'
  8960. *
  8961. * _.toString([1, 2, 3]);
  8962. * // => '1,2,3'
  8963. */
  8964. function toString(value) {
  8965. return value == null ? '' : baseToString(value);
  8966. }
  8967. /**
  8968. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  8969. *
  8970. * @static
  8971. * @memberOf _
  8972. * @since 3.0.0
  8973. * @category String
  8974. * @param {string} [string=''] The string to convert.
  8975. * @returns {string} Returns the camel cased string.
  8976. * @example
  8977. *
  8978. * _.camelCase('Foo Bar');
  8979. * // => 'fooBar'
  8980. *
  8981. * _.camelCase('--foo-bar--');
  8982. * // => 'fooBar'
  8983. *
  8984. * _.camelCase('__FOO_BAR__');
  8985. * // => 'fooBar'
  8986. */
  8987. var camelCase = createCompounder(function(result, word, index) {
  8988. word = word.toLowerCase();
  8989. return result + (index ? capitalize(word) : word);
  8990. });
  8991. /**
  8992. * Converts the first character of `string` to upper case and the remaining
  8993. * to lower case.
  8994. *
  8995. * @static
  8996. * @memberOf _
  8997. * @since 3.0.0
  8998. * @category String
  8999. * @param {string} [string=''] The string to capitalize.
  9000. * @returns {string} Returns the capitalized string.
  9001. * @example
  9002. *
  9003. * _.capitalize('FRED');
  9004. * // => 'Fred'
  9005. */
  9006. function capitalize(string) {
  9007. return upperFirst(toString(string).toLowerCase());
  9008. }
  9009. /**
  9010. * Deburrs `string` by converting
  9011. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  9012. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  9013. * letters to basic Latin letters and removing
  9014. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  9015. *
  9016. * @static
  9017. * @memberOf _
  9018. * @since 3.0.0
  9019. * @category String
  9020. * @param {string} [string=''] The string to deburr.
  9021. * @returns {string} Returns the deburred string.
  9022. * @example
  9023. *
  9024. * _.deburr('déjà vu');
  9025. * // => 'deja vu'
  9026. */
  9027. function deburr(string) {
  9028. string = toString(string);
  9029. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  9030. }
  9031. /**
  9032. * Converts the first character of `string` to upper case.
  9033. *
  9034. * @static
  9035. * @memberOf _
  9036. * @since 4.0.0
  9037. * @category String
  9038. * @param {string} [string=''] The string to convert.
  9039. * @returns {string} Returns the converted string.
  9040. * @example
  9041. *
  9042. * _.upperFirst('fred');
  9043. * // => 'Fred'
  9044. *
  9045. * _.upperFirst('FRED');
  9046. * // => 'FRED'
  9047. */
  9048. var upperFirst = createCaseFirst('toUpperCase');
  9049. /**
  9050. * Splits `string` into an array of its words.
  9051. *
  9052. * @static
  9053. * @memberOf _
  9054. * @since 3.0.0
  9055. * @category String
  9056. * @param {string} [string=''] The string to inspect.
  9057. * @param {RegExp|string} [pattern] The pattern to match words.
  9058. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9059. * @returns {Array} Returns the words of `string`.
  9060. * @example
  9061. *
  9062. * _.words('fred, barney, & pebbles');
  9063. * // => ['fred', 'barney', 'pebbles']
  9064. *
  9065. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  9066. * // => ['fred', 'barney', '&', 'pebbles']
  9067. */
  9068. function words(string, pattern, guard) {
  9069. string = toString(string);
  9070. pattern = guard ? undefined : pattern;
  9071. if (pattern === undefined) {
  9072. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  9073. }
  9074. return string.match(pattern) || [];
  9075. }
  9076. var lodash_camelcase = camelCase;
  9077. var lib$3 = {};
  9078. var lib$2 = {exports: {}};
  9079. var parse$3 = {exports: {}};
  9080. var util = {};
  9081. var unicode$1 = {};
  9082. Object.defineProperty(unicode$1,"__esModule",{value:true});unicode$1.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;unicode$1.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/;unicode$1.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
  9083. Object.defineProperty(util,'__esModule',{value:true});util.isSpaceSeparator=isSpaceSeparator;util.isIdStartChar=isIdStartChar;util.isIdContinueChar=isIdContinueChar;util.isDigit=isDigit;util.isHexDigit=isHexDigit;var _unicode=unicode$1;var unicode=_interopRequireWildcard(_unicode);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else {var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key];}}newObj.default=obj;return newObj}}function isSpaceSeparator(c){return unicode.Space_Separator.test(c)}function isIdStartChar(c){return c>='a'&&c<='z'||c>='A'&&c<='Z'||c==='$'||c==='_'||unicode.ID_Start.test(c)}function isIdContinueChar(c){return c>='a'&&c<='z'||c>='A'&&c<='Z'||c>='0'&&c<='9'||c==='$'||c==='_'||c==='\u200C'||c==='\u200D'||unicode.ID_Continue.test(c)}function isDigit(c){return /[0-9]/.test(c)}function isHexDigit(c){return /[0-9A-Fa-f]/.test(c)}
  9084. (function (module, exports) {
  9085. Object.defineProperty(exports,'__esModule',{value:true});var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj};exports.default=parse;var _util=util;var util$1=_interopRequireWildcard(_util);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else {var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key];}}newObj.default=obj;return newObj}}var source=void 0;var parseState=void 0;var stack=void 0;var pos=void 0;var line=void 0;var column=void 0;var token=void 0;var key=void 0;var root=void 0;function parse(text,reviver){source=String(text);parseState='start';stack=[];pos=0;line=1;column=0;token=undefined;key=undefined;root=undefined;do{token=lex();parseStates[parseState]();}while(token.type!=='eof');if(typeof reviver==='function'){return internalize({'':root},'',reviver)}return root}function internalize(holder,name,reviver){var value=holder[name];if(value!=null&&(typeof value==='undefined'?'undefined':_typeof(value))==='object'){for(var _key in value){var replacement=internalize(value,_key,reviver);if(replacement===undefined){delete value[_key];}else {value[_key]=replacement;}}}return reviver.call(holder,name,value)}var lexState=void 0;var buffer=void 0;var doubleQuote=void 0;var _sign=void 0;var c=void 0;function lex(){lexState='default';buffer='';doubleQuote=false;_sign=1;for(;;){c=peek();var _token=lexStates[lexState]();if(_token){return _token}}}function peek(){if(source[pos]){return String.fromCodePoint(source.codePointAt(pos))}}function read(){var c=peek();if(c==='\n'){line++;column=0;}else if(c){column+=c.length;}else {column++;}if(c){pos+=c.length;}return c}var lexStates={default:function _default(){switch(c){case'\t':case'\x0B':case'\f':case' ':case'\xA0':case'\uFEFF':case'\n':case'\r':case'\u2028':case'\u2029':read();return;case'/':read();lexState='comment';return;case undefined:read();return newToken('eof');}if(util$1.isSpaceSeparator(c)){read();return}return lexStates[parseState]()},comment:function comment(){switch(c){case'*':read();lexState='multiLineComment';return;case'/':read();lexState='singleLineComment';return;}throw invalidChar(read())},multiLineComment:function multiLineComment(){switch(c){case'*':read();lexState='multiLineCommentAsterisk';return;case undefined:throw invalidChar(read());}read();},multiLineCommentAsterisk:function multiLineCommentAsterisk(){switch(c){case'*':read();return;case'/':read();lexState='default';return;case undefined:throw invalidChar(read());}read();lexState='multiLineComment';},singleLineComment:function singleLineComment(){switch(c){case'\n':case'\r':case'\u2028':case'\u2029':read();lexState='default';return;case undefined:read();return newToken('eof');}read();},value:function value(){switch(c){case'{':case'[':return newToken('punctuator',read());case'n':read();literal('ull');return newToken('null',null);case't':read();literal('rue');return newToken('boolean',true);case'f':read();literal('alse');return newToken('boolean',false);case'-':case'+':if(read()==='-'){_sign=-1;}lexState='sign';return;case'.':buffer=read();lexState='decimalPointLeading';return;case'0':buffer=read();lexState='zero';return;case'1':case'2':case'3':case'4':case'5':case'6':case'7':case'8':case'9':buffer=read();lexState='decimalInteger';return;case'I':read();literal('nfinity');return newToken('numeric',Infinity);case'N':read();literal('aN');return newToken('numeric',NaN);case'"':case'\'':doubleQuote=read()==='"';buffer='';lexState='string';return;}throw invalidChar(read())},identifierNameStartEscape:function identifierNameStartEscape(){if(c!=='u'){throw invalidChar(read())}read();var u=unicodeEscape();switch(u){case'$':case'_':break;default:if(!util$1.isIdStartChar(u)){throw invalidIdentifier()}break;}buffer+=u;lexState='identifierName';},identifierName:function identifierName(){switch(c){case'$':case'_':case'\u200C':case'\u200D':buffer+=read();return;case'\\':read();lexState='identifierNameEscape';return;}if(util$1.isIdContinueChar(c)){buffer+=read();return}return newToken('identifier',buffer)},identifierNameEscape:function identifierNameEscape(){if(c!=='u'){throw invalidChar(read())}read();var u=unicodeEscape();switch(u){case'$':case'_':case'\u200C':case'\u200D':break;default:if(!util$1.isIdContinueChar(u)){throw invalidIdentifier()}break;}buffer+=u;lexState='identifierName';},sign:function sign(){switch(c){case'.':buffer=read();lexState='decimalPointLeading';return;case'0':buffer=read();lexState='zero';return;case'1':case'2':case'3':case'4':case'5':case'6':case'7':case'8':case'9':buffer=read();lexState='decimalInteger';return;case'I':read();literal('nfinity');return newToken('numeric',_sign*Infinity);case'N':read();literal('aN');return newToken('numeric',NaN);}throw invalidChar(read())},zero:function zero(){switch(c){case'.':buffer+=read();lexState='decimalPoint';return;case'e':case'E':buffer+=read();lexState='decimalExponent';return;case'x':case'X':buffer+=read();lexState='hexadecimal';return;}return newToken('numeric',_sign*0)},decimalInteger:function decimalInteger(){switch(c){case'.':buffer+=read();lexState='decimalPoint';return;case'e':case'E':buffer+=read();lexState='decimalExponent';return;}if(util$1.isDigit(c)){buffer+=read();return}return newToken('numeric',_sign*Number(buffer))},decimalPointLeading:function decimalPointLeading(){if(util$1.isDigit(c)){buffer+=read();lexState='decimalFraction';return}throw invalidChar(read())},decimalPoint:function decimalPoint(){switch(c){case'e':case'E':buffer+=read();lexState='decimalExponent';return;}if(util$1.isDigit(c)){buffer+=read();lexState='decimalFraction';return}return newToken('numeric',_sign*Number(buffer))},decimalFraction:function decimalFraction(){switch(c){case'e':case'E':buffer+=read();lexState='decimalExponent';return;}if(util$1.isDigit(c)){buffer+=read();return}return newToken('numeric',_sign*Number(buffer))},decimalExponent:function decimalExponent(){switch(c){case'+':case'-':buffer+=read();lexState='decimalExponentSign';return;}if(util$1.isDigit(c)){buffer+=read();lexState='decimalExponentInteger';return}throw invalidChar(read())},decimalExponentSign:function decimalExponentSign(){if(util$1.isDigit(c)){buffer+=read();lexState='decimalExponentInteger';return}throw invalidChar(read())},decimalExponentInteger:function decimalExponentInteger(){if(util$1.isDigit(c)){buffer+=read();return}return newToken('numeric',_sign*Number(buffer))},hexadecimal:function hexadecimal(){if(util$1.isHexDigit(c)){buffer+=read();lexState='hexadecimalInteger';return}throw invalidChar(read())},hexadecimalInteger:function hexadecimalInteger(){if(util$1.isHexDigit(c)){buffer+=read();return}return newToken('numeric',_sign*Number(buffer))},string:function string(){switch(c){case'\\':read();buffer+=escape();return;case'"':if(doubleQuote){read();return newToken('string',buffer)}buffer+=read();return;case'\'':if(!doubleQuote){read();return newToken('string',buffer)}buffer+=read();return;case'\n':case'\r':throw invalidChar(read());case'\u2028':case'\u2029':separatorChar(c);break;case undefined:throw invalidChar(read());}buffer+=read();},start:function start(){switch(c){case'{':case'[':return newToken('punctuator',read());}lexState='value';},beforePropertyName:function beforePropertyName(){switch(c){case'$':case'_':buffer=read();lexState='identifierName';return;case'\\':read();lexState='identifierNameStartEscape';return;case'}':return newToken('punctuator',read());case'"':case'\'':doubleQuote=read()==='"';lexState='string';return;}if(util$1.isIdStartChar(c)){buffer+=read();lexState='identifierName';return}throw invalidChar(read())},afterPropertyName:function afterPropertyName(){if(c===':'){return newToken('punctuator',read())}throw invalidChar(read())},beforePropertyValue:function beforePropertyValue(){lexState='value';},afterPropertyValue:function afterPropertyValue(){switch(c){case',':case'}':return newToken('punctuator',read());}throw invalidChar(read())},beforeArrayValue:function beforeArrayValue(){if(c===']'){return newToken('punctuator',read())}lexState='value';},afterArrayValue:function afterArrayValue(){switch(c){case',':case']':return newToken('punctuator',read());}throw invalidChar(read())},end:function end(){throw invalidChar(read())}};function newToken(type,value){return {type:type,value:value,line:line,column:column}}function literal(s){var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=s[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _c=_step.value;var p=peek();if(p!==_c){throw invalidChar(read())}read();}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return();}}finally{if(_didIteratorError){throw _iteratorError}}}}function escape(){var c=peek();switch(c){case'b':read();return '\b';case'f':read();return '\f';case'n':read();return '\n';case'r':read();return '\r';case't':read();return '\t';case'v':read();return '\x0B';case'0':read();if(util$1.isDigit(peek())){throw invalidChar(read())}return '\0';case'x':read();return hexEscape();case'u':read();return unicodeEscape();case'\n':case'\u2028':case'\u2029':read();return '';case'\r':read();if(peek()==='\n'){read();}return '';case'1':case'2':case'3':case'4':case'5':case'6':case'7':case'8':case'9':throw invalidChar(read());case undefined:throw invalidChar(read());}return read()}function hexEscape(){var buffer='';var c=peek();if(!util$1.isHexDigit(c)){throw invalidChar(read())}buffer+=read();c=peek();if(!util$1.isHexDigit(c)){throw invalidChar(read())}buffer+=read();return String.fromCodePoint(parseInt(buffer,16))}function unicodeEscape(){var buffer='';var count=4;while(count-->0){var _c2=peek();if(!util$1.isHexDigit(_c2)){throw invalidChar(read())}buffer+=read();}return String.fromCodePoint(parseInt(buffer,16))}var parseStates={start:function start(){if(token.type==='eof'){throw invalidEOF()}push();},beforePropertyName:function beforePropertyName(){switch(token.type){case'identifier':case'string':key=token.value;parseState='afterPropertyName';return;case'punctuator':pop();return;case'eof':throw invalidEOF();}},afterPropertyName:function afterPropertyName(){if(token.type==='eof'){throw invalidEOF()}parseState='beforePropertyValue';},beforePropertyValue:function beforePropertyValue(){if(token.type==='eof'){throw invalidEOF()}push();},beforeArrayValue:function beforeArrayValue(){if(token.type==='eof'){throw invalidEOF()}if(token.type==='punctuator'&&token.value===']'){pop();return}push();},afterPropertyValue:function afterPropertyValue(){if(token.type==='eof'){throw invalidEOF()}switch(token.value){case',':parseState='beforePropertyName';return;case'}':pop();}},afterArrayValue:function afterArrayValue(){if(token.type==='eof'){throw invalidEOF()}switch(token.value){case',':parseState='beforeArrayValue';return;case']':pop();}},end:function end(){}};function push(){var value=void 0;switch(token.type){case'punctuator':switch(token.value){case'{':value={};break;case'[':value=[];break;}break;case'null':case'boolean':case'numeric':case'string':value=token.value;break;}if(root===undefined){root=value;}else {var parent=stack[stack.length-1];if(Array.isArray(parent)){parent.push(value);}else {parent[key]=value;}}if(value!==null&&(typeof value==='undefined'?'undefined':_typeof(value))==='object'){stack.push(value);if(Array.isArray(value)){parseState='beforeArrayValue';}else {parseState='beforePropertyName';}}else {var current=stack[stack.length-1];if(current==null){parseState='end';}else if(Array.isArray(current)){parseState='afterArrayValue';}else {parseState='afterPropertyValue';}}}function pop(){stack.pop();var current=stack[stack.length-1];if(current==null){parseState='end';}else if(Array.isArray(current)){parseState='afterArrayValue';}else {parseState='afterPropertyValue';}}function invalidChar(c){if(c===undefined){return syntaxError('JSON5: invalid end of input at '+line+':'+column)}return syntaxError('JSON5: invalid character \''+formatChar(c)+'\' at '+line+':'+column)}function invalidEOF(){return syntaxError('JSON5: invalid end of input at '+line+':'+column)}function invalidIdentifier(){column-=5;return syntaxError('JSON5: invalid identifier character at '+line+':'+column)}function separatorChar(c){console.warn('JSON5: \''+c+'\' is not valid ECMAScript; consider escaping');}function formatChar(c){var replacements={'\'':'\\\'','"':'\\"','\\':'\\\\','\b':'\\b','\f':'\\f','\n':'\\n','\r':'\\r','\t':'\\t','\x0B':'\\v','\0':'\\0','\u2028':'\\u2028','\u2029':'\\u2029'};if(replacements[c]){return replacements[c]}if(c<' '){var hexString=c.charCodeAt(0).toString(16);return '\\x'+('00'+hexString).substring(hexString.length)}return c}function syntaxError(message){var err=new SyntaxError(message);err.lineNumber=line;err.columnNumber=column;return err}module.exports=exports['default'];
  9086. } (parse$3, parse$3.exports));
  9087. var stringify$3 = {exports: {}};
  9088. (function (module, exports) {
  9089. Object.defineProperty(exports,'__esModule',{value:true});var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj};exports.default=stringify;var _util=util;var util$1=_interopRequireWildcard(_util);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else {var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key];}}newObj.default=obj;return newObj}}function stringify(value,replacer,space){var stack=[];var indent='';var propertyList=void 0;var replacerFunc=void 0;var gap='';var quote=void 0;if(replacer!=null&&(typeof replacer==='undefined'?'undefined':_typeof(replacer))==='object'&&!Array.isArray(replacer)){space=replacer.space;quote=replacer.quote;replacer=replacer.replacer;}if(typeof replacer==='function'){replacerFunc=replacer;}else if(Array.isArray(replacer)){propertyList=[];var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=replacer[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var v=_step.value;var item=void 0;if(typeof v==='string'){item=v;}else if(typeof v==='number'||v instanceof String||v instanceof Number){item=String(v);}if(item!==undefined&&propertyList.indexOf(item)<0){propertyList.push(item);}}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return();}}finally{if(_didIteratorError){throw _iteratorError}}}}if(space instanceof Number){space=Number(space);}else if(space instanceof String){space=String(space);}if(typeof space==='number'){if(space>0){space=Math.min(10,Math.floor(space));gap=' '.substr(0,space);}}else if(typeof space==='string'){gap=space.substr(0,10);}return serializeProperty('',{'':value});function serializeProperty(key,holder){var value=holder[key];if(value!=null){if(typeof value.toJSON5==='function'){value=value.toJSON5(key);}else if(typeof value.toJSON==='function'){value=value.toJSON(key);}}if(replacerFunc){value=replacerFunc.call(holder,key,value);}if(value instanceof Number){value=Number(value);}else if(value instanceof String){value=String(value);}else if(value instanceof Boolean){value=value.valueOf();}switch(value){case null:return 'null';case true:return 'true';case false:return 'false';}if(typeof value==='string'){return quoteString(value)}if(typeof value==='number'){return String(value)}if((typeof value==='undefined'?'undefined':_typeof(value))==='object'){return Array.isArray(value)?serializeArray(value):serializeObject(value)}return undefined}function quoteString(value){var quotes={'\'':0.1,'"':0.2};var replacements={'\'':'\\\'','"':'\\"','\\':'\\\\','\b':'\\b','\f':'\\f','\n':'\\n','\r':'\\r','\t':'\\t','\x0B':'\\v','\0':'\\0','\u2028':'\\u2028','\u2029':'\\u2029'};var product='';var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=value[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var c=_step2.value;switch(c){case'\'':case'"':quotes[c]++;product+=c;continue;}if(replacements[c]){product+=replacements[c];continue}if(c<' '){var hexString=c.charCodeAt(0).toString(16);product+='\\x'+('00'+hexString).substring(hexString.length);continue}product+=c;}}catch(err){_didIteratorError2=true;_iteratorError2=err;}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return();}}finally{if(_didIteratorError2){throw _iteratorError2}}}var quoteChar=quote||Object.keys(quotes).reduce(function(a,b){return quotes[a]<quotes[b]?a:b});product=product.replace(new RegExp(quoteChar,'g'),replacements[quoteChar]);return quoteChar+product+quoteChar}function serializeObject(value){if(stack.indexOf(value)>=0){throw TypeError('Converting circular structure to JSON5')}stack.push(value);var stepback=indent;indent=indent+gap;var keys=propertyList||Object.keys(value);var partial=[];var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=undefined;try{for(var _iterator3=keys[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var key=_step3.value;var propertyString=serializeProperty(key,value);if(propertyString!==undefined){var member=serializeKey(key)+':';if(gap!==''){member+=' ';}member+=propertyString;partial.push(member);}}}catch(err){_didIteratorError3=true;_iteratorError3=err;}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return){_iterator3.return();}}finally{if(_didIteratorError3){throw _iteratorError3}}}var final=void 0;if(partial.length===0){final='{}';}else {var properties=void 0;if(gap===''){properties=partial.join(',');final='{'+properties+'}';}else {var separator=',\n'+indent;properties=partial.join(separator);final='{\n'+indent+properties+',\n'+stepback+'}';}}stack.pop();indent=stepback;return final}function serializeKey(key){if(key.length===0){return quoteString(key)}var firstChar=String.fromCodePoint(key.codePointAt(0));if(!util$1.isIdStartChar(firstChar)){return quoteString(key)}for(var i=firstChar.length;i<key.length;i++){if(!util$1.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))){return quoteString(key)}}return key}function serializeArray(value){if(stack.indexOf(value)>=0){throw TypeError('Converting circular structure to JSON5')}stack.push(value);var stepback=indent;indent=indent+gap;var partial=[];for(var i=0;i<value.length;i++){var propertyString=serializeProperty(String(i),value);partial.push(propertyString!==undefined?propertyString:'null');}var final=void 0;if(partial.length===0){final='[]';}else {if(gap===''){var properties=partial.join(',');final='['+properties+']';}else {var separator=',\n'+indent;var _properties=partial.join(separator);final='[\n'+indent+_properties+',\n'+stepback+']';}}stack.pop();indent=stepback;return final}}module.exports=exports['default'];
  9090. } (stringify$3, stringify$3.exports));
  9091. (function (module, exports) {
  9092. Object.defineProperty(exports,'__esModule',{value:true});var _parse=parse$3.exports;var _parse2=_interopRequireDefault(_parse);var _stringify=stringify$3.exports;var _stringify2=_interopRequireDefault(_stringify);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={parse:_parse2.default,stringify:_stringify2.default};module.exports=exports['default'];
  9093. } (lib$2, lib$2.exports));
  9094. const JSON5 = lib$2.exports;
  9095. const specialValues = {
  9096. null: null,
  9097. true: true,
  9098. false: false,
  9099. };
  9100. function parseQuery$2(query) {
  9101. if (query.substr(0, 1) !== '?') {
  9102. throw new Error(
  9103. "A valid query string passed to parseQuery should begin with '?'"
  9104. );
  9105. }
  9106. query = query.substr(1);
  9107. if (!query) {
  9108. return {};
  9109. }
  9110. if (query.substr(0, 1) === '{' && query.substr(-1) === '}') {
  9111. return JSON5.parse(query);
  9112. }
  9113. const queryArgs = query.split(/[,&]/g);
  9114. const result = {};
  9115. queryArgs.forEach((arg) => {
  9116. const idx = arg.indexOf('=');
  9117. if (idx >= 0) {
  9118. let name = arg.substr(0, idx);
  9119. let value = decodeURIComponent(arg.substr(idx + 1));
  9120. if (specialValues.hasOwnProperty(value)) {
  9121. value = specialValues[value];
  9122. }
  9123. if (name.substr(-2) === '[]') {
  9124. name = decodeURIComponent(name.substr(0, name.length - 2));
  9125. if (!Array.isArray(result[name])) {
  9126. result[name] = [];
  9127. }
  9128. result[name].push(value);
  9129. } else {
  9130. name = decodeURIComponent(name);
  9131. result[name] = value;
  9132. }
  9133. } else {
  9134. if (arg.substr(0, 1) === '-') {
  9135. result[decodeURIComponent(arg.substr(1))] = false;
  9136. } else if (arg.substr(0, 1) === '+') {
  9137. result[decodeURIComponent(arg.substr(1))] = true;
  9138. } else {
  9139. result[decodeURIComponent(arg)] = true;
  9140. }
  9141. }
  9142. });
  9143. return result;
  9144. }
  9145. var parseQuery_1 = parseQuery$2;
  9146. const parseQuery$1 = parseQuery_1;
  9147. function getOptions$1(loaderContext) {
  9148. const query = loaderContext.query;
  9149. if (typeof query === 'string' && query !== '') {
  9150. return parseQuery$1(loaderContext.query);
  9151. }
  9152. if (!query || typeof query !== 'object') {
  9153. // Not object-like queries are not supported.
  9154. return null;
  9155. }
  9156. return query;
  9157. }
  9158. var getOptions_1 = getOptions$1;
  9159. const path$3 = path$4;
  9160. const matchRelativePath = /^\.\.?[/\\]/;
  9161. function isAbsolutePath(str) {
  9162. return path$3.posix.isAbsolute(str) || path$3.win32.isAbsolute(str);
  9163. }
  9164. function isRelativePath(str) {
  9165. return matchRelativePath.test(str);
  9166. }
  9167. function stringifyRequest$1(loaderContext, request) {
  9168. const splitted = request.split('!');
  9169. const context =
  9170. loaderContext.context ||
  9171. (loaderContext.options && loaderContext.options.context);
  9172. return JSON.stringify(
  9173. splitted
  9174. .map((part) => {
  9175. // First, separate singlePath from query, because the query might contain paths again
  9176. const splittedPart = part.match(/^(.*?)(\?.*)/);
  9177. const query = splittedPart ? splittedPart[2] : '';
  9178. let singlePath = splittedPart ? splittedPart[1] : part;
  9179. if (isAbsolutePath(singlePath) && context) {
  9180. singlePath = path$3.relative(context, singlePath);
  9181. if (isAbsolutePath(singlePath)) {
  9182. // If singlePath still matches an absolute path, singlePath was on a different drive than context.
  9183. // In this case, we leave the path platform-specific without replacing any separators.
  9184. // @see https://github.com/webpack/loader-utils/pull/14
  9185. return singlePath + query;
  9186. }
  9187. if (isRelativePath(singlePath) === false) {
  9188. // Ensure that the relative path starts at least with ./ otherwise it would be a request into the modules directory (like node_modules).
  9189. singlePath = './' + singlePath;
  9190. }
  9191. }
  9192. return singlePath.replace(/\\/g, '/') + query;
  9193. })
  9194. .join('!')
  9195. );
  9196. }
  9197. var stringifyRequest_1 = stringifyRequest$1;
  9198. function getRemainingRequest$1(loaderContext) {
  9199. if (loaderContext.remainingRequest) {
  9200. return loaderContext.remainingRequest;
  9201. }
  9202. const request = loaderContext.loaders
  9203. .slice(loaderContext.loaderIndex + 1)
  9204. .map((obj) => obj.request)
  9205. .concat([loaderContext.resource]);
  9206. return request.join('!');
  9207. }
  9208. var getRemainingRequest_1 = getRemainingRequest$1;
  9209. function getCurrentRequest$1(loaderContext) {
  9210. if (loaderContext.currentRequest) {
  9211. return loaderContext.currentRequest;
  9212. }
  9213. const request = loaderContext.loaders
  9214. .slice(loaderContext.loaderIndex)
  9215. .map((obj) => obj.request)
  9216. .concat([loaderContext.resource]);
  9217. return request.join('!');
  9218. }
  9219. var getCurrentRequest_1 = getCurrentRequest$1;
  9220. const path$2 = path$4;
  9221. function isUrlRequest$1(url, root) {
  9222. // An URL is not an request if
  9223. // 1. It's an absolute url and it is not `windows` path like `C:\dir\file`
  9224. if (/^[a-z][a-z0-9+.-]*:/i.test(url) && !path$2.win32.isAbsolute(url)) {
  9225. return false;
  9226. }
  9227. // 2. It's a protocol-relative
  9228. if (/^\/\//.test(url)) {
  9229. return false;
  9230. }
  9231. // 3. It's some kind of url for a template
  9232. if (/^[{}[\]#*;,'§$%&(=?`´^°<>]/.test(url)) {
  9233. return false;
  9234. }
  9235. // 4. It's also not an request if root isn't set and it's a root-relative url
  9236. if ((root === undefined || root === false) && /^\//.test(url)) {
  9237. return false;
  9238. }
  9239. return true;
  9240. }
  9241. var isUrlRequest_1 = isUrlRequest$1;
  9242. // we can't use path.win32.isAbsolute because it also matches paths starting with a forward slash
  9243. const matchNativeWin32Path = /^[A-Z]:[/\\]|^\\\\/i;
  9244. function urlToRequest$1(url, root) {
  9245. // Do not rewrite an empty url
  9246. if (url === '') {
  9247. return '';
  9248. }
  9249. const moduleRequestRegex = /^[^?]*~/;
  9250. let request;
  9251. if (matchNativeWin32Path.test(url)) {
  9252. // absolute windows path, keep it
  9253. request = url;
  9254. } else if (root !== undefined && root !== false && /^\//.test(url)) {
  9255. // if root is set and the url is root-relative
  9256. switch (typeof root) {
  9257. // 1. root is a string: root is prefixed to the url
  9258. case 'string':
  9259. // special case: `~` roots convert to module request
  9260. if (moduleRequestRegex.test(root)) {
  9261. request = root.replace(/([^~/])$/, '$1/') + url.slice(1);
  9262. } else {
  9263. request = root + url;
  9264. }
  9265. break;
  9266. // 2. root is `true`: absolute paths are allowed
  9267. // *nix only, windows-style absolute paths are always allowed as they doesn't start with a `/`
  9268. case 'boolean':
  9269. request = url;
  9270. break;
  9271. default:
  9272. throw new Error(
  9273. "Unexpected parameters to loader-utils 'urlToRequest': url = " +
  9274. url +
  9275. ', root = ' +
  9276. root +
  9277. '.'
  9278. );
  9279. }
  9280. } else if (/^\.\.?\//.test(url)) {
  9281. // A relative url stays
  9282. request = url;
  9283. } else {
  9284. // every other url is threaded like a relative url
  9285. request = './' + url;
  9286. }
  9287. // A `~` makes the url an module
  9288. if (moduleRequestRegex.test(request)) {
  9289. request = request.replace(moduleRequestRegex, '');
  9290. }
  9291. return request;
  9292. }
  9293. var urlToRequest_1 = urlToRequest$1;
  9294. function parseString$1(str) {
  9295. try {
  9296. if (str[0] === '"') {
  9297. return JSON.parse(str);
  9298. }
  9299. if (str[0] === "'" && str.substr(str.length - 1) === "'") {
  9300. return parseString$1(
  9301. str
  9302. .replace(/\\.|"/g, (x) => (x === '"' ? '\\"' : x))
  9303. .replace(/^'|'$/g, '"')
  9304. );
  9305. }
  9306. return JSON.parse('"' + str + '"');
  9307. } catch (e) {
  9308. return str;
  9309. }
  9310. }
  9311. var parseString_1 = parseString$1;
  9312. /*
  9313. * big.js v5.2.2
  9314. * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
  9315. * Copyright (c) 2018 Michael Mclaughlin <M8ch88l@gmail.com>
  9316. * https://github.com/MikeMcl/big.js/LICENCE
  9317. */
  9318. /************************************** EDITABLE DEFAULTS *****************************************/
  9319. // The default values below must be integers within the stated ranges.
  9320. /*
  9321. * The maximum number of decimal places (DP) of the results of operations involving division:
  9322. * div and sqrt, and pow with negative exponents.
  9323. */
  9324. var DP = 20, // 0 to MAX_DP
  9325. /*
  9326. * The rounding mode (RM) used when rounding to the above decimal places.
  9327. *
  9328. * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN)
  9329. * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP)
  9330. * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)
  9331. * 3 Away from zero. (ROUND_UP)
  9332. */
  9333. RM = 1, // 0, 1, 2 or 3
  9334. // The maximum value of DP and Big.DP.
  9335. MAX_DP = 1E6, // 0 to 1000000
  9336. // The maximum magnitude of the exponent argument to the pow method.
  9337. MAX_POWER = 1E6, // 1 to 1000000
  9338. /*
  9339. * The negative exponent (NE) at and beneath which toString returns exponential notation.
  9340. * (JavaScript numbers: -7)
  9341. * -1000000 is the minimum recommended exponent value of a Big.
  9342. */
  9343. NE = -7, // 0 to -1000000
  9344. /*
  9345. * The positive exponent (PE) at and above which toString returns exponential notation.
  9346. * (JavaScript numbers: 21)
  9347. * 1000000 is the maximum recommended exponent value of a Big.
  9348. * (This limit is not enforced or checked.)
  9349. */
  9350. PE = 21, // 0 to 1000000
  9351. /**************************************************************************************************/
  9352. // Error messages.
  9353. NAME = '[big.js] ',
  9354. INVALID = NAME + 'Invalid ',
  9355. INVALID_DP = INVALID + 'decimal places',
  9356. INVALID_RM = INVALID + 'rounding mode',
  9357. DIV_BY_ZERO = NAME + 'Division by zero',
  9358. // The shared prototype object.
  9359. P = {},
  9360. UNDEFINED = void 0,
  9361. NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
  9362. /*
  9363. * Create and return a Big constructor.
  9364. *
  9365. */
  9366. function _Big_() {
  9367. /*
  9368. * The Big constructor and exported function.
  9369. * Create and return a new instance of a Big number object.
  9370. *
  9371. * n {number|string|Big} A numeric value.
  9372. */
  9373. function Big(n) {
  9374. var x = this;
  9375. // Enable constructor usage without new.
  9376. if (!(x instanceof Big)) return n === UNDEFINED ? _Big_() : new Big(n);
  9377. // Duplicate.
  9378. if (n instanceof Big) {
  9379. x.s = n.s;
  9380. x.e = n.e;
  9381. x.c = n.c.slice();
  9382. } else {
  9383. parse$2(x, n);
  9384. }
  9385. /*
  9386. * Retain a reference to this Big constructor, and shadow Big.prototype.constructor which
  9387. * points to Object.
  9388. */
  9389. x.constructor = Big;
  9390. }
  9391. Big.prototype = P;
  9392. Big.DP = DP;
  9393. Big.RM = RM;
  9394. Big.NE = NE;
  9395. Big.PE = PE;
  9396. Big.version = '5.2.2';
  9397. return Big;
  9398. }
  9399. /*
  9400. * Parse the number or string value passed to a Big constructor.
  9401. *
  9402. * x {Big} A Big number instance.
  9403. * n {number|string} A numeric value.
  9404. */
  9405. function parse$2(x, n) {
  9406. var e, i, nl;
  9407. // Minus zero?
  9408. if (n === 0 && 1 / n < 0) n = '-0';
  9409. else if (!NUMERIC.test(n += '')) throw Error(INVALID + 'number');
  9410. // Determine sign.
  9411. x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;
  9412. // Decimal point?
  9413. if ((e = n.indexOf('.')) > -1) n = n.replace('.', '');
  9414. // Exponential form?
  9415. if ((i = n.search(/e/i)) > 0) {
  9416. // Determine exponent.
  9417. if (e < 0) e = i;
  9418. e += +n.slice(i + 1);
  9419. n = n.substring(0, i);
  9420. } else if (e < 0) {
  9421. // Integer.
  9422. e = n.length;
  9423. }
  9424. nl = n.length;
  9425. // Determine leading zeros.
  9426. for (i = 0; i < nl && n.charAt(i) == '0';) ++i;
  9427. if (i == nl) {
  9428. // Zero.
  9429. x.c = [x.e = 0];
  9430. } else {
  9431. // Determine trailing zeros.
  9432. for (; nl > 0 && n.charAt(--nl) == '0';);
  9433. x.e = e - i - 1;
  9434. x.c = [];
  9435. // Convert string to array of digits without leading/trailing zeros.
  9436. for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);
  9437. }
  9438. return x;
  9439. }
  9440. /*
  9441. * Round Big x to a maximum of dp decimal places using rounding mode rm.
  9442. * Called by stringify, P.div, P.round and P.sqrt.
  9443. *
  9444. * x {Big} The Big to round.
  9445. * dp {number} Integer, 0 to MAX_DP inclusive.
  9446. * rm {number} 0, 1, 2 or 3 (DOWN, HALF_UP, HALF_EVEN, UP)
  9447. * [more] {boolean} Whether the result of division was truncated.
  9448. */
  9449. function round(x, dp, rm, more) {
  9450. var xc = x.c,
  9451. i = x.e + dp + 1;
  9452. if (i < xc.length) {
  9453. if (rm === 1) {
  9454. // xc[i] is the digit after the digit that may be rounded up.
  9455. more = xc[i] >= 5;
  9456. } else if (rm === 2) {
  9457. more = xc[i] > 5 || xc[i] == 5 &&
  9458. (more || i < 0 || xc[i + 1] !== UNDEFINED || xc[i - 1] & 1);
  9459. } else if (rm === 3) {
  9460. more = more || !!xc[0];
  9461. } else {
  9462. more = false;
  9463. if (rm !== 0) throw Error(INVALID_RM);
  9464. }
  9465. if (i < 1) {
  9466. xc.length = 1;
  9467. if (more) {
  9468. // 1, 0.1, 0.01, 0.001, 0.0001 etc.
  9469. x.e = -dp;
  9470. xc[0] = 1;
  9471. } else {
  9472. // Zero.
  9473. xc[0] = x.e = 0;
  9474. }
  9475. } else {
  9476. // Remove any digits after the required decimal places.
  9477. xc.length = i--;
  9478. // Round up?
  9479. if (more) {
  9480. // Rounding up may mean the previous digit has to be rounded up.
  9481. for (; ++xc[i] > 9;) {
  9482. xc[i] = 0;
  9483. if (!i--) {
  9484. ++x.e;
  9485. xc.unshift(1);
  9486. }
  9487. }
  9488. }
  9489. // Remove trailing zeros.
  9490. for (i = xc.length; !xc[--i];) xc.pop();
  9491. }
  9492. } else if (rm < 0 || rm > 3 || rm !== ~~rm) {
  9493. throw Error(INVALID_RM);
  9494. }
  9495. return x;
  9496. }
  9497. /*
  9498. * Return a string representing the value of Big x in normal or exponential notation.
  9499. * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.
  9500. *
  9501. * x {Big}
  9502. * id? {number} Caller id.
  9503. * 1 toExponential
  9504. * 2 toFixed
  9505. * 3 toPrecision
  9506. * 4 valueOf
  9507. * n? {number|undefined} Caller's argument.
  9508. * k? {number|undefined}
  9509. */
  9510. function stringify$2(x, id, n, k) {
  9511. var e, s,
  9512. Big = x.constructor,
  9513. z = !x.c[0];
  9514. if (n !== UNDEFINED) {
  9515. if (n !== ~~n || n < (id == 3) || n > MAX_DP) {
  9516. throw Error(id == 3 ? INVALID + 'precision' : INVALID_DP);
  9517. }
  9518. x = new Big(x);
  9519. // The index of the digit that may be rounded up.
  9520. n = k - x.e;
  9521. // Round?
  9522. if (x.c.length > ++k) round(x, n, Big.RM);
  9523. // toFixed: recalculate k as x.e may have changed if value rounded up.
  9524. if (id == 2) k = x.e + n + 1;
  9525. // Append zeros?
  9526. for (; x.c.length < k;) x.c.push(0);
  9527. }
  9528. e = x.e;
  9529. s = x.c.join('');
  9530. n = s.length;
  9531. // Exponential notation?
  9532. if (id != 2 && (id == 1 || id == 3 && k <= e || e <= Big.NE || e >= Big.PE)) {
  9533. s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;
  9534. // Normal notation.
  9535. } else if (e < 0) {
  9536. for (; ++e;) s = '0' + s;
  9537. s = '0.' + s;
  9538. } else if (e > 0) {
  9539. if (++e > n) for (e -= n; e--;) s += '0';
  9540. else if (e < n) s = s.slice(0, e) + '.' + s.slice(e);
  9541. } else if (n > 1) {
  9542. s = s.charAt(0) + '.' + s.slice(1);
  9543. }
  9544. return x.s < 0 && (!z || id == 4) ? '-' + s : s;
  9545. }
  9546. // Prototype/instance methods
  9547. /*
  9548. * Return a new Big whose value is the absolute value of this Big.
  9549. */
  9550. P.abs = function () {
  9551. var x = new this.constructor(this);
  9552. x.s = 1;
  9553. return x;
  9554. };
  9555. /*
  9556. * Return 1 if the value of this Big is greater than the value of Big y,
  9557. * -1 if the value of this Big is less than the value of Big y, or
  9558. * 0 if they have the same value.
  9559. */
  9560. P.cmp = function (y) {
  9561. var isneg,
  9562. x = this,
  9563. xc = x.c,
  9564. yc = (y = new x.constructor(y)).c,
  9565. i = x.s,
  9566. j = y.s,
  9567. k = x.e,
  9568. l = y.e;
  9569. // Either zero?
  9570. if (!xc[0] || !yc[0]) return !xc[0] ? !yc[0] ? 0 : -j : i;
  9571. // Signs differ?
  9572. if (i != j) return i;
  9573. isneg = i < 0;
  9574. // Compare exponents.
  9575. if (k != l) return k > l ^ isneg ? 1 : -1;
  9576. j = (k = xc.length) < (l = yc.length) ? k : l;
  9577. // Compare digit by digit.
  9578. for (i = -1; ++i < j;) {
  9579. if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1;
  9580. }
  9581. // Compare lengths.
  9582. return k == l ? 0 : k > l ^ isneg ? 1 : -1;
  9583. };
  9584. /*
  9585. * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,
  9586. * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
  9587. */
  9588. P.div = function (y) {
  9589. var x = this,
  9590. Big = x.constructor,
  9591. a = x.c, // dividend
  9592. b = (y = new Big(y)).c, // divisor
  9593. k = x.s == y.s ? 1 : -1,
  9594. dp = Big.DP;
  9595. if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP);
  9596. // Divisor is zero?
  9597. if (!b[0]) throw Error(DIV_BY_ZERO);
  9598. // Dividend is 0? Return +-0.
  9599. if (!a[0]) return new Big(k * 0);
  9600. var bl, bt, n, cmp, ri,
  9601. bz = b.slice(),
  9602. ai = bl = b.length,
  9603. al = a.length,
  9604. r = a.slice(0, bl), // remainder
  9605. rl = r.length,
  9606. q = y, // quotient
  9607. qc = q.c = [],
  9608. qi = 0,
  9609. d = dp + (q.e = x.e - y.e) + 1; // number of digits of the result
  9610. q.s = k;
  9611. k = d < 0 ? 0 : d;
  9612. // Create version of divisor with leading zero.
  9613. bz.unshift(0);
  9614. // Add zeros to make remainder as long as divisor.
  9615. for (; rl++ < bl;) r.push(0);
  9616. do {
  9617. // n is how many times the divisor goes into current remainder.
  9618. for (n = 0; n < 10; n++) {
  9619. // Compare divisor and remainder.
  9620. if (bl != (rl = r.length)) {
  9621. cmp = bl > rl ? 1 : -1;
  9622. } else {
  9623. for (ri = -1, cmp = 0; ++ri < bl;) {
  9624. if (b[ri] != r[ri]) {
  9625. cmp = b[ri] > r[ri] ? 1 : -1;
  9626. break;
  9627. }
  9628. }
  9629. }
  9630. // If divisor < remainder, subtract divisor from remainder.
  9631. if (cmp < 0) {
  9632. // Remainder can't be more than 1 digit longer than divisor.
  9633. // Equalise lengths using divisor with extra leading zero?
  9634. for (bt = rl == bl ? b : bz; rl;) {
  9635. if (r[--rl] < bt[rl]) {
  9636. ri = rl;
  9637. for (; ri && !r[--ri];) r[ri] = 9;
  9638. --r[ri];
  9639. r[rl] += 10;
  9640. }
  9641. r[rl] -= bt[rl];
  9642. }
  9643. for (; !r[0];) r.shift();
  9644. } else {
  9645. break;
  9646. }
  9647. }
  9648. // Add the digit n to the result array.
  9649. qc[qi++] = cmp ? n : ++n;
  9650. // Update the remainder.
  9651. if (r[0] && cmp) r[rl] = a[ai] || 0;
  9652. else r = [a[ai]];
  9653. } while ((ai++ < al || r[0] !== UNDEFINED) && k--);
  9654. // Leading zero? Do not remove if result is simply zero (qi == 1).
  9655. if (!qc[0] && qi != 1) {
  9656. // There can't be more than one zero.
  9657. qc.shift();
  9658. q.e--;
  9659. }
  9660. // Round?
  9661. if (qi > d) round(q, dp, Big.RM, r[0] !== UNDEFINED);
  9662. return q;
  9663. };
  9664. /*
  9665. * Return true if the value of this Big is equal to the value of Big y, otherwise return false.
  9666. */
  9667. P.eq = function (y) {
  9668. return !this.cmp(y);
  9669. };
  9670. /*
  9671. * Return true if the value of this Big is greater than the value of Big y, otherwise return
  9672. * false.
  9673. */
  9674. P.gt = function (y) {
  9675. return this.cmp(y) > 0;
  9676. };
  9677. /*
  9678. * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise
  9679. * return false.
  9680. */
  9681. P.gte = function (y) {
  9682. return this.cmp(y) > -1;
  9683. };
  9684. /*
  9685. * Return true if the value of this Big is less than the value of Big y, otherwise return false.
  9686. */
  9687. P.lt = function (y) {
  9688. return this.cmp(y) < 0;
  9689. };
  9690. /*
  9691. * Return true if the value of this Big is less than or equal to the value of Big y, otherwise
  9692. * return false.
  9693. */
  9694. P.lte = function (y) {
  9695. return this.cmp(y) < 1;
  9696. };
  9697. /*
  9698. * Return a new Big whose value is the value of this Big minus the value of Big y.
  9699. */
  9700. P.minus = P.sub = function (y) {
  9701. var i, j, t, xlty,
  9702. x = this,
  9703. Big = x.constructor,
  9704. a = x.s,
  9705. b = (y = new Big(y)).s;
  9706. // Signs differ?
  9707. if (a != b) {
  9708. y.s = -b;
  9709. return x.plus(y);
  9710. }
  9711. var xc = x.c.slice(),
  9712. xe = x.e,
  9713. yc = y.c,
  9714. ye = y.e;
  9715. // Either zero?
  9716. if (!xc[0] || !yc[0]) {
  9717. // y is non-zero? x is non-zero? Or both are zero.
  9718. return yc[0] ? (y.s = -b, y) : new Big(xc[0] ? x : 0);
  9719. }
  9720. // Determine which is the bigger number. Prepend zeros to equalise exponents.
  9721. if (a = xe - ye) {
  9722. if (xlty = a < 0) {
  9723. a = -a;
  9724. t = xc;
  9725. } else {
  9726. ye = xe;
  9727. t = yc;
  9728. }
  9729. t.reverse();
  9730. for (b = a; b--;) t.push(0);
  9731. t.reverse();
  9732. } else {
  9733. // Exponents equal. Check digit by digit.
  9734. j = ((xlty = xc.length < yc.length) ? xc : yc).length;
  9735. for (a = b = 0; b < j; b++) {
  9736. if (xc[b] != yc[b]) {
  9737. xlty = xc[b] < yc[b];
  9738. break;
  9739. }
  9740. }
  9741. }
  9742. // x < y? Point xc to the array of the bigger number.
  9743. if (xlty) {
  9744. t = xc;
  9745. xc = yc;
  9746. yc = t;
  9747. y.s = -y.s;
  9748. }
  9749. /*
  9750. * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only
  9751. * needs to start at yc.length.
  9752. */
  9753. if ((b = (j = yc.length) - (i = xc.length)) > 0) for (; b--;) xc[i++] = 0;
  9754. // Subtract yc from xc.
  9755. for (b = i; j > a;) {
  9756. if (xc[--j] < yc[j]) {
  9757. for (i = j; i && !xc[--i];) xc[i] = 9;
  9758. --xc[i];
  9759. xc[j] += 10;
  9760. }
  9761. xc[j] -= yc[j];
  9762. }
  9763. // Remove trailing zeros.
  9764. for (; xc[--b] === 0;) xc.pop();
  9765. // Remove leading zeros and adjust exponent accordingly.
  9766. for (; xc[0] === 0;) {
  9767. xc.shift();
  9768. --ye;
  9769. }
  9770. if (!xc[0]) {
  9771. // n - n = +0
  9772. y.s = 1;
  9773. // Result must be zero.
  9774. xc = [ye = 0];
  9775. }
  9776. y.c = xc;
  9777. y.e = ye;
  9778. return y;
  9779. };
  9780. /*
  9781. * Return a new Big whose value is the value of this Big modulo the value of Big y.
  9782. */
  9783. P.mod = function (y) {
  9784. var ygtx,
  9785. x = this,
  9786. Big = x.constructor,
  9787. a = x.s,
  9788. b = (y = new Big(y)).s;
  9789. if (!y.c[0]) throw Error(DIV_BY_ZERO);
  9790. x.s = y.s = 1;
  9791. ygtx = y.cmp(x) == 1;
  9792. x.s = a;
  9793. y.s = b;
  9794. if (ygtx) return new Big(x);
  9795. a = Big.DP;
  9796. b = Big.RM;
  9797. Big.DP = Big.RM = 0;
  9798. x = x.div(y);
  9799. Big.DP = a;
  9800. Big.RM = b;
  9801. return this.minus(x.times(y));
  9802. };
  9803. /*
  9804. * Return a new Big whose value is the value of this Big plus the value of Big y.
  9805. */
  9806. P.plus = P.add = function (y) {
  9807. var t,
  9808. x = this,
  9809. Big = x.constructor,
  9810. a = x.s,
  9811. b = (y = new Big(y)).s;
  9812. // Signs differ?
  9813. if (a != b) {
  9814. y.s = -b;
  9815. return x.minus(y);
  9816. }
  9817. var xe = x.e,
  9818. xc = x.c,
  9819. ye = y.e,
  9820. yc = y.c;
  9821. // Either zero? y is non-zero? x is non-zero? Or both are zero.
  9822. if (!xc[0] || !yc[0]) return yc[0] ? y : new Big(xc[0] ? x : a * 0);
  9823. xc = xc.slice();
  9824. // Prepend zeros to equalise exponents.
  9825. // Note: reverse faster than unshifts.
  9826. if (a = xe - ye) {
  9827. if (a > 0) {
  9828. ye = xe;
  9829. t = yc;
  9830. } else {
  9831. a = -a;
  9832. t = xc;
  9833. }
  9834. t.reverse();
  9835. for (; a--;) t.push(0);
  9836. t.reverse();
  9837. }
  9838. // Point xc to the longer array.
  9839. if (xc.length - yc.length < 0) {
  9840. t = yc;
  9841. yc = xc;
  9842. xc = t;
  9843. }
  9844. a = yc.length;
  9845. // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.
  9846. for (b = 0; a; xc[a] %= 10) b = (xc[--a] = xc[a] + yc[a] + b) / 10 | 0;
  9847. // No need to check for zero, as +x + +y != 0 && -x + -y != 0
  9848. if (b) {
  9849. xc.unshift(b);
  9850. ++ye;
  9851. }
  9852. // Remove trailing zeros.
  9853. for (a = xc.length; xc[--a] === 0;) xc.pop();
  9854. y.c = xc;
  9855. y.e = ye;
  9856. return y;
  9857. };
  9858. /*
  9859. * Return a Big whose value is the value of this Big raised to the power n.
  9860. * If n is negative, round to a maximum of Big.DP decimal places using rounding
  9861. * mode Big.RM.
  9862. *
  9863. * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.
  9864. */
  9865. P.pow = function (n) {
  9866. var x = this,
  9867. one = new x.constructor(1),
  9868. y = one,
  9869. isneg = n < 0;
  9870. if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) throw Error(INVALID + 'exponent');
  9871. if (isneg) n = -n;
  9872. for (;;) {
  9873. if (n & 1) y = y.times(x);
  9874. n >>= 1;
  9875. if (!n) break;
  9876. x = x.times(x);
  9877. }
  9878. return isneg ? one.div(y) : y;
  9879. };
  9880. /*
  9881. * Return a new Big whose value is the value of this Big rounded using rounding mode rm
  9882. * to a maximum of dp decimal places, or, if dp is negative, to an integer which is a
  9883. * multiple of 10**-dp.
  9884. * If dp is not specified, round to 0 decimal places.
  9885. * If rm is not specified, use Big.RM.
  9886. *
  9887. * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.
  9888. * rm? 0, 1, 2 or 3 (ROUND_DOWN, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_UP)
  9889. */
  9890. P.round = function (dp, rm) {
  9891. var Big = this.constructor;
  9892. if (dp === UNDEFINED) dp = 0;
  9893. else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) throw Error(INVALID_DP);
  9894. return round(new Big(this), dp, rm === UNDEFINED ? Big.RM : rm);
  9895. };
  9896. /*
  9897. * Return a new Big whose value is the square root of the value of this Big, rounded, if
  9898. * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
  9899. */
  9900. P.sqrt = function () {
  9901. var r, c, t,
  9902. x = this,
  9903. Big = x.constructor,
  9904. s = x.s,
  9905. e = x.e,
  9906. half = new Big(0.5);
  9907. // Zero?
  9908. if (!x.c[0]) return new Big(x);
  9909. // Negative?
  9910. if (s < 0) throw Error(NAME + 'No square root');
  9911. // Estimate.
  9912. s = Math.sqrt(x + '');
  9913. // Math.sqrt underflow/overflow?
  9914. // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.
  9915. if (s === 0 || s === 1 / 0) {
  9916. c = x.c.join('');
  9917. if (!(c.length + e & 1)) c += '0';
  9918. s = Math.sqrt(c);
  9919. e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);
  9920. r = new Big((s == 1 / 0 ? '1e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);
  9921. } else {
  9922. r = new Big(s);
  9923. }
  9924. e = r.e + (Big.DP += 4);
  9925. // Newton-Raphson iteration.
  9926. do {
  9927. t = r;
  9928. r = half.times(t.plus(x.div(t)));
  9929. } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));
  9930. return round(r, Big.DP -= 4, Big.RM);
  9931. };
  9932. /*
  9933. * Return a new Big whose value is the value of this Big times the value of Big y.
  9934. */
  9935. P.times = P.mul = function (y) {
  9936. var c,
  9937. x = this,
  9938. Big = x.constructor,
  9939. xc = x.c,
  9940. yc = (y = new Big(y)).c,
  9941. a = xc.length,
  9942. b = yc.length,
  9943. i = x.e,
  9944. j = y.e;
  9945. // Determine sign of result.
  9946. y.s = x.s == y.s ? 1 : -1;
  9947. // Return signed 0 if either 0.
  9948. if (!xc[0] || !yc[0]) return new Big(y.s * 0);
  9949. // Initialise exponent of result as x.e + y.e.
  9950. y.e = i + j;
  9951. // If array xc has fewer digits than yc, swap xc and yc, and lengths.
  9952. if (a < b) {
  9953. c = xc;
  9954. xc = yc;
  9955. yc = c;
  9956. j = a;
  9957. a = b;
  9958. b = j;
  9959. }
  9960. // Initialise coefficient array of result with zeros.
  9961. for (c = new Array(j = a + b); j--;) c[j] = 0;
  9962. // Multiply.
  9963. // i is initially xc.length.
  9964. for (i = b; i--;) {
  9965. b = 0;
  9966. // a is yc.length.
  9967. for (j = a + i; j > i;) {
  9968. // Current sum of products at this digit position, plus carry.
  9969. b = c[j] + yc[i] * xc[j - i - 1] + b;
  9970. c[j--] = b % 10;
  9971. // carry
  9972. b = b / 10 | 0;
  9973. }
  9974. c[j] = (c[j] + b) % 10;
  9975. }
  9976. // Increment result exponent if there is a final carry, otherwise remove leading zero.
  9977. if (b) ++y.e;
  9978. else c.shift();
  9979. // Remove trailing zeros.
  9980. for (i = c.length; !c[--i];) c.pop();
  9981. y.c = c;
  9982. return y;
  9983. };
  9984. /*
  9985. * Return a string representing the value of this Big in exponential notation to dp fixed decimal
  9986. * places and rounded using Big.RM.
  9987. *
  9988. * dp? {number} Integer, 0 to MAX_DP inclusive.
  9989. */
  9990. P.toExponential = function (dp) {
  9991. return stringify$2(this, 1, dp, dp);
  9992. };
  9993. /*
  9994. * Return a string representing the value of this Big in normal notation to dp fixed decimal
  9995. * places and rounded using Big.RM.
  9996. *
  9997. * dp? {number} Integer, 0 to MAX_DP inclusive.
  9998. *
  9999. * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
  10000. * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
  10001. */
  10002. P.toFixed = function (dp) {
  10003. return stringify$2(this, 2, dp, this.e + dp);
  10004. };
  10005. /*
  10006. * Return a string representing the value of this Big rounded to sd significant digits using
  10007. * Big.RM. Use exponential notation if sd is less than the number of digits necessary to represent
  10008. * the integer part of the value in normal notation.
  10009. *
  10010. * sd {number} Integer, 1 to MAX_DP inclusive.
  10011. */
  10012. P.toPrecision = function (sd) {
  10013. return stringify$2(this, 3, sd, sd - 1);
  10014. };
  10015. /*
  10016. * Return a string representing the value of this Big.
  10017. * Return exponential notation if this Big has a positive exponent equal to or greater than
  10018. * Big.PE, or a negative exponent equal to or less than Big.NE.
  10019. * Omit the sign for negative zero.
  10020. */
  10021. P.toString = function () {
  10022. return stringify$2(this);
  10023. };
  10024. /*
  10025. * Return a string representing the value of this Big.
  10026. * Return exponential notation if this Big has a positive exponent equal to or greater than
  10027. * Big.PE, or a negative exponent equal to or less than Big.NE.
  10028. * Include the sign for negative zero.
  10029. */
  10030. P.valueOf = P.toJSON = function () {
  10031. return stringify$2(this, 4);
  10032. };
  10033. // Export
  10034. var Big = _Big_();
  10035. var big = /*#__PURE__*/Object.freeze({
  10036. __proto__: null,
  10037. Big: Big,
  10038. default: Big
  10039. });
  10040. var require$$0 = /*@__PURE__*/getAugmentedNamespace(big);
  10041. const baseEncodeTables = {
  10042. 26: 'abcdefghijklmnopqrstuvwxyz',
  10043. 32: '123456789abcdefghjkmnpqrstuvwxyz', // no 0lio
  10044. 36: '0123456789abcdefghijklmnopqrstuvwxyz',
  10045. 49: 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ', // no lIO
  10046. 52: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
  10047. 58: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ', // no 0lIO
  10048. 62: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
  10049. 64: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_',
  10050. };
  10051. function encodeBufferToBase(buffer, base) {
  10052. const encodeTable = baseEncodeTables[base];
  10053. if (!encodeTable) {
  10054. throw new Error('Unknown encoding base' + base);
  10055. }
  10056. const readLength = buffer.length;
  10057. const Big = require$$0;
  10058. Big.RM = Big.DP = 0;
  10059. let b = new Big(0);
  10060. for (let i = readLength - 1; i >= 0; i--) {
  10061. b = b.times(256).plus(buffer[i]);
  10062. }
  10063. let output = '';
  10064. while (b.gt(0)) {
  10065. output = encodeTable[b.mod(base)] + output;
  10066. b = b.div(base);
  10067. }
  10068. Big.DP = 20;
  10069. Big.RM = 1;
  10070. return output;
  10071. }
  10072. function getHashDigest$2(buffer, hashType, digestType, maxLength) {
  10073. hashType = hashType || 'md5';
  10074. maxLength = maxLength || 9999;
  10075. const hash = require('crypto').createHash(hashType);
  10076. hash.update(buffer);
  10077. if (
  10078. digestType === 'base26' ||
  10079. digestType === 'base32' ||
  10080. digestType === 'base36' ||
  10081. digestType === 'base49' ||
  10082. digestType === 'base52' ||
  10083. digestType === 'base58' ||
  10084. digestType === 'base62' ||
  10085. digestType === 'base64'
  10086. ) {
  10087. return encodeBufferToBase(hash.digest(), digestType.substr(4)).substr(
  10088. 0,
  10089. maxLength
  10090. );
  10091. } else {
  10092. return hash.digest(digestType || 'hex').substr(0, maxLength);
  10093. }
  10094. }
  10095. var getHashDigest_1 = getHashDigest$2;
  10096. var emojisList$1 = [
  10097. "🀄️",
  10098. "🃏",
  10099. "🅰️",
  10100. "🅱️",
  10101. "🅾️",
  10102. "🅿️",
  10103. "🆎",
  10104. "🆑",
  10105. "🆒",
  10106. "🆓",
  10107. "🆔",
  10108. "🆕",
  10109. "🆖",
  10110. "🆗",
  10111. "🆘",
  10112. "🆙",
  10113. "🆚",
  10114. "🇦🇨",
  10115. "🇦🇩",
  10116. "🇦🇪",
  10117. "🇦🇫",
  10118. "🇦🇬",
  10119. "🇦🇮",
  10120. "🇦🇱",
  10121. "🇦🇲",
  10122. "🇦🇴",
  10123. "🇦🇶",
  10124. "🇦🇷",
  10125. "🇦🇸",
  10126. "🇦🇹",
  10127. "🇦🇺",
  10128. "🇦🇼",
  10129. "🇦🇽",
  10130. "🇦🇿",
  10131. "🇦",
  10132. "🇧🇦",
  10133. "🇧🇧",
  10134. "🇧🇩",
  10135. "🇧🇪",
  10136. "🇧🇫",
  10137. "🇧🇬",
  10138. "🇧🇭",
  10139. "🇧🇮",
  10140. "🇧🇯",
  10141. "🇧🇱",
  10142. "🇧🇲",
  10143. "🇧🇳",
  10144. "🇧🇴",
  10145. "🇧🇶",
  10146. "🇧🇷",
  10147. "🇧🇸",
  10148. "🇧🇹",
  10149. "🇧🇻",
  10150. "🇧🇼",
  10151. "🇧🇾",
  10152. "🇧🇿",
  10153. "🇧",
  10154. "🇨🇦",
  10155. "🇨🇨",
  10156. "🇨🇩",
  10157. "🇨🇫",
  10158. "🇨🇬",
  10159. "🇨🇭",
  10160. "🇨🇮",
  10161. "🇨🇰",
  10162. "🇨🇱",
  10163. "🇨🇲",
  10164. "🇨🇳",
  10165. "🇨🇴",
  10166. "🇨🇵",
  10167. "🇨🇷",
  10168. "🇨🇺",
  10169. "🇨🇻",
  10170. "🇨🇼",
  10171. "🇨🇽",
  10172. "🇨🇾",
  10173. "🇨🇿",
  10174. "🇨",
  10175. "🇩🇪",
  10176. "🇩🇬",
  10177. "🇩🇯",
  10178. "🇩🇰",
  10179. "🇩🇲",
  10180. "🇩🇴",
  10181. "🇩🇿",
  10182. "🇩",
  10183. "🇪🇦",
  10184. "🇪🇨",
  10185. "🇪🇪",
  10186. "🇪🇬",
  10187. "🇪🇭",
  10188. "🇪🇷",
  10189. "🇪🇸",
  10190. "🇪🇹",
  10191. "🇪🇺",
  10192. "🇪",
  10193. "🇫🇮",
  10194. "🇫🇯",
  10195. "🇫🇰",
  10196. "🇫🇲",
  10197. "🇫🇴",
  10198. "🇫🇷",
  10199. "🇫",
  10200. "🇬🇦",
  10201. "🇬🇧",
  10202. "🇬🇩",
  10203. "🇬🇪",
  10204. "🇬🇫",
  10205. "🇬🇬",
  10206. "🇬🇭",
  10207. "🇬🇮",
  10208. "🇬🇱",
  10209. "🇬🇲",
  10210. "🇬🇳",
  10211. "🇬🇵",
  10212. "🇬🇶",
  10213. "🇬🇷",
  10214. "🇬🇸",
  10215. "🇬🇹",
  10216. "🇬🇺",
  10217. "🇬🇼",
  10218. "🇬🇾",
  10219. "🇬",
  10220. "🇭🇰",
  10221. "🇭🇲",
  10222. "🇭🇳",
  10223. "🇭🇷",
  10224. "🇭🇹",
  10225. "🇭🇺",
  10226. "🇭",
  10227. "🇮🇨",
  10228. "🇮🇩",
  10229. "🇮🇪",
  10230. "🇮🇱",
  10231. "🇮🇲",
  10232. "🇮🇳",
  10233. "🇮🇴",
  10234. "🇮🇶",
  10235. "🇮🇷",
  10236. "🇮🇸",
  10237. "🇮🇹",
  10238. "🇮",
  10239. "🇯🇪",
  10240. "🇯🇲",
  10241. "🇯🇴",
  10242. "🇯🇵",
  10243. "🇯",
  10244. "🇰🇪",
  10245. "🇰🇬",
  10246. "🇰🇭",
  10247. "🇰🇮",
  10248. "🇰🇲",
  10249. "🇰🇳",
  10250. "🇰🇵",
  10251. "🇰🇷",
  10252. "🇰🇼",
  10253. "🇰🇾",
  10254. "🇰🇿",
  10255. "🇰",
  10256. "🇱🇦",
  10257. "🇱🇧",
  10258. "🇱🇨",
  10259. "🇱🇮",
  10260. "🇱🇰",
  10261. "🇱🇷",
  10262. "🇱🇸",
  10263. "🇱🇹",
  10264. "🇱🇺",
  10265. "🇱🇻",
  10266. "🇱🇾",
  10267. "🇱",
  10268. "🇲🇦",
  10269. "🇲🇨",
  10270. "🇲🇩",
  10271. "🇲🇪",
  10272. "🇲🇫",
  10273. "🇲🇬",
  10274. "🇲🇭",
  10275. "🇲🇰",
  10276. "🇲🇱",
  10277. "🇲🇲",
  10278. "🇲🇳",
  10279. "🇲🇴",
  10280. "🇲🇵",
  10281. "🇲🇶",
  10282. "🇲🇷",
  10283. "🇲🇸",
  10284. "🇲🇹",
  10285. "🇲🇺",
  10286. "🇲🇻",
  10287. "🇲🇼",
  10288. "🇲🇽",
  10289. "🇲🇾",
  10290. "🇲🇿",
  10291. "🇲",
  10292. "🇳🇦",
  10293. "🇳🇨",
  10294. "🇳🇪",
  10295. "🇳🇫",
  10296. "🇳🇬",
  10297. "🇳🇮",
  10298. "🇳🇱",
  10299. "🇳🇴",
  10300. "🇳🇵",
  10301. "🇳🇷",
  10302. "🇳🇺",
  10303. "🇳🇿",
  10304. "🇳",
  10305. "🇴🇲",
  10306. "🇴",
  10307. "🇵🇦",
  10308. "🇵🇪",
  10309. "🇵🇫",
  10310. "🇵🇬",
  10311. "🇵🇭",
  10312. "🇵🇰",
  10313. "🇵🇱",
  10314. "🇵🇲",
  10315. "🇵🇳",
  10316. "🇵🇷",
  10317. "🇵🇸",
  10318. "🇵🇹",
  10319. "🇵🇼",
  10320. "🇵🇾",
  10321. "🇵",
  10322. "🇶🇦",
  10323. "🇶",
  10324. "🇷🇪",
  10325. "🇷🇴",
  10326. "🇷🇸",
  10327. "🇷🇺",
  10328. "🇷🇼",
  10329. "🇷",
  10330. "🇸🇦",
  10331. "🇸🇧",
  10332. "🇸🇨",
  10333. "🇸🇩",
  10334. "🇸🇪",
  10335. "🇸🇬",
  10336. "🇸🇭",
  10337. "🇸🇮",
  10338. "🇸🇯",
  10339. "🇸🇰",
  10340. "🇸🇱",
  10341. "🇸🇲",
  10342. "🇸🇳",
  10343. "🇸🇴",
  10344. "🇸🇷",
  10345. "🇸🇸",
  10346. "🇸🇹",
  10347. "🇸🇻",
  10348. "🇸🇽",
  10349. "🇸🇾",
  10350. "🇸🇿",
  10351. "🇸",
  10352. "🇹🇦",
  10353. "🇹🇨",
  10354. "🇹🇩",
  10355. "🇹🇫",
  10356. "🇹🇬",
  10357. "🇹🇭",
  10358. "🇹🇯",
  10359. "🇹🇰",
  10360. "🇹🇱",
  10361. "🇹🇲",
  10362. "🇹🇳",
  10363. "🇹🇴",
  10364. "🇹🇷",
  10365. "🇹🇹",
  10366. "🇹🇻",
  10367. "🇹🇼",
  10368. "🇹🇿",
  10369. "🇹",
  10370. "🇺🇦",
  10371. "🇺🇬",
  10372. "🇺🇲",
  10373. "🇺🇳",
  10374. "🇺🇸",
  10375. "🇺🇾",
  10376. "🇺🇿",
  10377. "🇺",
  10378. "🇻🇦",
  10379. "🇻🇨",
  10380. "🇻🇪",
  10381. "🇻🇬",
  10382. "🇻🇮",
  10383. "🇻🇳",
  10384. "🇻🇺",
  10385. "🇻",
  10386. "🇼🇫",
  10387. "🇼🇸",
  10388. "🇼",
  10389. "🇽🇰",
  10390. "🇽",
  10391. "🇾🇪",
  10392. "🇾🇹",
  10393. "🇾",
  10394. "🇿🇦",
  10395. "🇿🇲",
  10396. "🇿🇼",
  10397. "🇿",
  10398. "🈁",
  10399. "🈂️",
  10400. "🈚️",
  10401. "🈯️",
  10402. "🈲",
  10403. "🈳",
  10404. "🈴",
  10405. "🈵",
  10406. "🈶",
  10407. "🈷️",
  10408. "🈸",
  10409. "🈹",
  10410. "🈺",
  10411. "🉐",
  10412. "🉑",
  10413. "🌀",
  10414. "🌁",
  10415. "🌂",
  10416. "🌃",
  10417. "🌄",
  10418. "🌅",
  10419. "🌆",
  10420. "🌇",
  10421. "🌈",
  10422. "🌉",
  10423. "🌊",
  10424. "🌋",
  10425. "🌌",
  10426. "🌍",
  10427. "🌎",
  10428. "🌏",
  10429. "🌐",
  10430. "🌑",
  10431. "🌒",
  10432. "🌓",
  10433. "🌔",
  10434. "🌕",
  10435. "🌖",
  10436. "🌗",
  10437. "🌘",
  10438. "🌙",
  10439. "🌚",
  10440. "🌛",
  10441. "🌜",
  10442. "🌝",
  10443. "🌞",
  10444. "🌟",
  10445. "🌠",
  10446. "🌡️",
  10447. "🌤️",
  10448. "🌥️",
  10449. "🌦️",
  10450. "🌧️",
  10451. "🌨️",
  10452. "🌩️",
  10453. "🌪️",
  10454. "🌫️",
  10455. "🌬️",
  10456. "🌭",
  10457. "🌮",
  10458. "🌯",
  10459. "🌰",
  10460. "🌱",
  10461. "🌲",
  10462. "🌳",
  10463. "🌴",
  10464. "🌵",
  10465. "🌶️",
  10466. "🌷",
  10467. "🌸",
  10468. "🌹",
  10469. "🌺",
  10470. "🌻",
  10471. "🌼",
  10472. "🌽",
  10473. "🌾",
  10474. "🌿",
  10475. "🍀",
  10476. "🍁",
  10477. "🍂",
  10478. "🍃",
  10479. "🍄",
  10480. "🍅",
  10481. "🍆",
  10482. "🍇",
  10483. "🍈",
  10484. "🍉",
  10485. "🍊",
  10486. "🍋",
  10487. "🍌",
  10488. "🍍",
  10489. "🍎",
  10490. "🍏",
  10491. "🍐",
  10492. "🍑",
  10493. "🍒",
  10494. "🍓",
  10495. "🍔",
  10496. "🍕",
  10497. "🍖",
  10498. "🍗",
  10499. "🍘",
  10500. "🍙",
  10501. "🍚",
  10502. "🍛",
  10503. "🍜",
  10504. "🍝",
  10505. "🍞",
  10506. "🍟",
  10507. "🍠",
  10508. "🍡",
  10509. "🍢",
  10510. "🍣",
  10511. "🍤",
  10512. "🍥",
  10513. "🍦",
  10514. "🍧",
  10515. "🍨",
  10516. "🍩",
  10517. "🍪",
  10518. "🍫",
  10519. "🍬",
  10520. "🍭",
  10521. "🍮",
  10522. "🍯",
  10523. "🍰",
  10524. "🍱",
  10525. "🍲",
  10526. "🍳",
  10527. "🍴",
  10528. "🍵",
  10529. "🍶",
  10530. "🍷",
  10531. "🍸",
  10532. "🍹",
  10533. "🍺",
  10534. "🍻",
  10535. "🍼",
  10536. "🍽️",
  10537. "🍾",
  10538. "🍿",
  10539. "🎀",
  10540. "🎁",
  10541. "🎂",
  10542. "🎃",
  10543. "🎄",
  10544. "🎅🏻",
  10545. "🎅🏼",
  10546. "🎅🏽",
  10547. "🎅🏾",
  10548. "🎅🏿",
  10549. "🎅",
  10550. "🎆",
  10551. "🎇",
  10552. "🎈",
  10553. "🎉",
  10554. "🎊",
  10555. "🎋",
  10556. "🎌",
  10557. "🎍",
  10558. "🎎",
  10559. "🎏",
  10560. "🎐",
  10561. "🎑",
  10562. "🎒",
  10563. "🎓",
  10564. "🎖️",
  10565. "🎗️",
  10566. "🎙️",
  10567. "🎚️",
  10568. "🎛️",
  10569. "🎞️",
  10570. "🎟️",
  10571. "🎠",
  10572. "🎡",
  10573. "🎢",
  10574. "🎣",
  10575. "🎤",
  10576. "🎥",
  10577. "🎦",
  10578. "🎧",
  10579. "🎨",
  10580. "🎩",
  10581. "🎪",
  10582. "🎫",
  10583. "🎬",
  10584. "🎭",
  10585. "🎮",
  10586. "🎯",
  10587. "🎰",
  10588. "🎱",
  10589. "🎲",
  10590. "🎳",
  10591. "🎴",
  10592. "🎵",
  10593. "🎶",
  10594. "🎷",
  10595. "🎸",
  10596. "🎹",
  10597. "🎺",
  10598. "🎻",
  10599. "🎼",
  10600. "🎽",
  10601. "🎾",
  10602. "🎿",
  10603. "🏀",
  10604. "🏁",
  10605. "🏂🏻",
  10606. "🏂🏼",
  10607. "🏂🏽",
  10608. "🏂🏾",
  10609. "🏂🏿",
  10610. "🏂",
  10611. "🏃🏻‍♀️",
  10612. "🏃🏻‍♂️",
  10613. "🏃🏻",
  10614. "🏃🏼‍♀️",
  10615. "🏃🏼‍♂️",
  10616. "🏃🏼",
  10617. "🏃🏽‍♀️",
  10618. "🏃🏽‍♂️",
  10619. "🏃🏽",
  10620. "🏃🏾‍♀️",
  10621. "🏃🏾‍♂️",
  10622. "🏃🏾",
  10623. "🏃🏿‍♀️",
  10624. "🏃🏿‍♂️",
  10625. "🏃🏿",
  10626. "🏃‍♀️",
  10627. "🏃‍♂️",
  10628. "🏃",
  10629. "🏄🏻‍♀️",
  10630. "🏄🏻‍♂️",
  10631. "🏄🏻",
  10632. "🏄🏼‍♀️",
  10633. "🏄🏼‍♂️",
  10634. "🏄🏼",
  10635. "🏄🏽‍♀️",
  10636. "🏄🏽‍♂️",
  10637. "🏄🏽",
  10638. "🏄🏾‍♀️",
  10639. "🏄🏾‍♂️",
  10640. "🏄🏾",
  10641. "🏄🏿‍♀️",
  10642. "🏄🏿‍♂️",
  10643. "🏄🏿",
  10644. "🏄‍♀️",
  10645. "🏄‍♂️",
  10646. "🏄",
  10647. "🏅",
  10648. "🏆",
  10649. "🏇🏻",
  10650. "🏇🏼",
  10651. "🏇🏽",
  10652. "🏇🏾",
  10653. "🏇🏿",
  10654. "🏇",
  10655. "🏈",
  10656. "🏉",
  10657. "🏊🏻‍♀️",
  10658. "🏊🏻‍♂️",
  10659. "🏊🏻",
  10660. "🏊🏼‍♀️",
  10661. "🏊🏼‍♂️",
  10662. "🏊🏼",
  10663. "🏊🏽‍♀️",
  10664. "🏊🏽‍♂️",
  10665. "🏊🏽",
  10666. "🏊🏾‍♀️",
  10667. "🏊🏾‍♂️",
  10668. "🏊🏾",
  10669. "🏊🏿‍♀️",
  10670. "🏊🏿‍♂️",
  10671. "🏊🏿",
  10672. "🏊‍♀️",
  10673. "🏊‍♂️",
  10674. "🏊",
  10675. "🏋🏻‍♀️",
  10676. "🏋🏻‍♂️",
  10677. "🏋🏻",
  10678. "🏋🏼‍♀️",
  10679. "🏋🏼‍♂️",
  10680. "🏋🏼",
  10681. "🏋🏽‍♀️",
  10682. "🏋🏽‍♂️",
  10683. "🏋🏽",
  10684. "🏋🏾‍♀️",
  10685. "🏋🏾‍♂️",
  10686. "🏋🏾",
  10687. "🏋🏿‍♀️",
  10688. "🏋🏿‍♂️",
  10689. "🏋🏿",
  10690. "🏋️‍♀️",
  10691. "🏋️‍♂️",
  10692. "🏋️",
  10693. "🏌🏻‍♀️",
  10694. "🏌🏻‍♂️",
  10695. "🏌🏻",
  10696. "🏌🏼‍♀️",
  10697. "🏌🏼‍♂️",
  10698. "🏌🏼",
  10699. "🏌🏽‍♀️",
  10700. "🏌🏽‍♂️",
  10701. "🏌🏽",
  10702. "🏌🏾‍♀️",
  10703. "🏌🏾‍♂️",
  10704. "🏌🏾",
  10705. "🏌🏿‍♀️",
  10706. "🏌🏿‍♂️",
  10707. "🏌🏿",
  10708. "🏌️‍♀️",
  10709. "🏌️‍♂️",
  10710. "🏌️",
  10711. "🏍️",
  10712. "🏎️",
  10713. "🏏",
  10714. "🏐",
  10715. "🏑",
  10716. "🏒",
  10717. "🏓",
  10718. "🏔️",
  10719. "🏕️",
  10720. "🏖️",
  10721. "🏗️",
  10722. "🏘️",
  10723. "🏙️",
  10724. "🏚️",
  10725. "🏛️",
  10726. "🏜️",
  10727. "🏝️",
  10728. "🏞️",
  10729. "🏟️",
  10730. "🏠",
  10731. "🏡",
  10732. "🏢",
  10733. "🏣",
  10734. "🏤",
  10735. "🏥",
  10736. "🏦",
  10737. "🏧",
  10738. "🏨",
  10739. "🏩",
  10740. "🏪",
  10741. "🏫",
  10742. "🏬",
  10743. "🏭",
  10744. "🏮",
  10745. "🏯",
  10746. "🏰",
  10747. "🏳️‍🌈",
  10748. "🏳️",
  10749. "🏴‍☠️",
  10750. "🏴󠁧󠁢󠁥󠁮󠁧󠁿",
  10751. "🏴󠁧󠁢󠁳󠁣󠁴󠁿",
  10752. "🏴󠁧󠁢󠁷󠁬󠁳󠁿",
  10753. "🏴",
  10754. "🏵️",
  10755. "🏷️",
  10756. "🏸",
  10757. "🏹",
  10758. "🏺",
  10759. "🏻",
  10760. "🏼",
  10761. "🏽",
  10762. "🏾",
  10763. "🏿",
  10764. "🐀",
  10765. "🐁",
  10766. "🐂",
  10767. "🐃",
  10768. "🐄",
  10769. "🐅",
  10770. "🐆",
  10771. "🐇",
  10772. "🐈",
  10773. "🐉",
  10774. "🐊",
  10775. "🐋",
  10776. "🐌",
  10777. "🐍",
  10778. "🐎",
  10779. "🐏",
  10780. "🐐",
  10781. "🐑",
  10782. "🐒",
  10783. "🐓",
  10784. "🐔",
  10785. "🐕‍🦺",
  10786. "🐕",
  10787. "🐖",
  10788. "🐗",
  10789. "🐘",
  10790. "🐙",
  10791. "🐚",
  10792. "🐛",
  10793. "🐜",
  10794. "🐝",
  10795. "🐞",
  10796. "🐟",
  10797. "🐠",
  10798. "🐡",
  10799. "🐢",
  10800. "🐣",
  10801. "🐤",
  10802. "🐥",
  10803. "🐦",
  10804. "🐧",
  10805. "🐨",
  10806. "🐩",
  10807. "🐪",
  10808. "🐫",
  10809. "🐬",
  10810. "🐭",
  10811. "🐮",
  10812. "🐯",
  10813. "🐰",
  10814. "🐱",
  10815. "🐲",
  10816. "🐳",
  10817. "🐴",
  10818. "🐵",
  10819. "🐶",
  10820. "🐷",
  10821. "🐸",
  10822. "🐹",
  10823. "🐺",
  10824. "🐻",
  10825. "🐼",
  10826. "🐽",
  10827. "🐾",
  10828. "🐿️",
  10829. "👀",
  10830. "👁‍🗨",
  10831. "👁️",
  10832. "👂🏻",
  10833. "👂🏼",
  10834. "👂🏽",
  10835. "👂🏾",
  10836. "👂🏿",
  10837. "👂",
  10838. "👃🏻",
  10839. "👃🏼",
  10840. "👃🏽",
  10841. "👃🏾",
  10842. "👃🏿",
  10843. "👃",
  10844. "👄",
  10845. "👅",
  10846. "👆🏻",
  10847. "👆🏼",
  10848. "👆🏽",
  10849. "👆🏾",
  10850. "👆🏿",
  10851. "👆",
  10852. "👇🏻",
  10853. "👇🏼",
  10854. "👇🏽",
  10855. "👇🏾",
  10856. "👇🏿",
  10857. "👇",
  10858. "👈🏻",
  10859. "👈🏼",
  10860. "👈🏽",
  10861. "👈🏾",
  10862. "👈🏿",
  10863. "👈",
  10864. "👉🏻",
  10865. "👉🏼",
  10866. "👉🏽",
  10867. "👉🏾",
  10868. "👉🏿",
  10869. "👉",
  10870. "👊🏻",
  10871. "👊🏼",
  10872. "👊🏽",
  10873. "👊🏾",
  10874. "👊🏿",
  10875. "👊",
  10876. "👋🏻",
  10877. "👋🏼",
  10878. "👋🏽",
  10879. "👋🏾",
  10880. "👋🏿",
  10881. "👋",
  10882. "👌🏻",
  10883. "👌🏼",
  10884. "👌🏽",
  10885. "👌🏾",
  10886. "👌🏿",
  10887. "👌",
  10888. "👍🏻",
  10889. "👍🏼",
  10890. "👍🏽",
  10891. "👍🏾",
  10892. "👍🏿",
  10893. "👍",
  10894. "👎🏻",
  10895. "👎🏼",
  10896. "👎🏽",
  10897. "👎🏾",
  10898. "👎🏿",
  10899. "👎",
  10900. "👏🏻",
  10901. "👏🏼",
  10902. "👏🏽",
  10903. "👏🏾",
  10904. "👏🏿",
  10905. "👏",
  10906. "👐🏻",
  10907. "👐🏼",
  10908. "👐🏽",
  10909. "👐🏾",
  10910. "👐🏿",
  10911. "👐",
  10912. "👑",
  10913. "👒",
  10914. "👓",
  10915. "👔",
  10916. "👕",
  10917. "👖",
  10918. "👗",
  10919. "👘",
  10920. "👙",
  10921. "👚",
  10922. "👛",
  10923. "👜",
  10924. "👝",
  10925. "👞",
  10926. "👟",
  10927. "👠",
  10928. "👡",
  10929. "👢",
  10930. "👣",
  10931. "👤",
  10932. "👥",
  10933. "👦🏻",
  10934. "👦🏼",
  10935. "👦🏽",
  10936. "👦🏾",
  10937. "👦🏿",
  10938. "👦",
  10939. "👧🏻",
  10940. "👧🏼",
  10941. "👧🏽",
  10942. "👧🏾",
  10943. "👧🏿",
  10944. "👧",
  10945. "👨🏻‍🌾",
  10946. "👨🏻‍🍳",
  10947. "👨🏻‍🎓",
  10948. "👨🏻‍🎤",
  10949. "👨🏻‍🎨",
  10950. "👨🏻‍🏫",
  10951. "👨🏻‍🏭",
  10952. "👨🏻‍💻",
  10953. "👨🏻‍💼",
  10954. "👨🏻‍🔧",
  10955. "👨🏻‍🔬",
  10956. "👨🏻‍🚀",
  10957. "👨🏻‍🚒",
  10958. "👨🏻‍🦯",
  10959. "👨🏻‍🦰",
  10960. "👨🏻‍🦱",
  10961. "👨🏻‍🦲",
  10962. "👨🏻‍🦳",
  10963. "👨🏻‍🦼",
  10964. "👨🏻‍🦽",
  10965. "👨🏻‍⚕️",
  10966. "👨🏻‍⚖️",
  10967. "👨🏻‍✈️",
  10968. "👨🏻",
  10969. "👨🏼‍🌾",
  10970. "👨🏼‍🍳",
  10971. "👨🏼‍🎓",
  10972. "👨🏼‍🎤",
  10973. "👨🏼‍🎨",
  10974. "👨🏼‍🏫",
  10975. "👨🏼‍🏭",
  10976. "👨🏼‍💻",
  10977. "👨🏼‍💼",
  10978. "👨🏼‍🔧",
  10979. "👨🏼‍🔬",
  10980. "👨🏼‍🚀",
  10981. "👨🏼‍🚒",
  10982. "👨🏼‍🤝‍👨🏻",
  10983. "👨🏼‍🦯",
  10984. "👨🏼‍🦰",
  10985. "👨🏼‍🦱",
  10986. "👨🏼‍🦲",
  10987. "👨🏼‍🦳",
  10988. "👨🏼‍🦼",
  10989. "👨🏼‍🦽",
  10990. "👨🏼‍⚕️",
  10991. "👨🏼‍⚖️",
  10992. "👨🏼‍✈️",
  10993. "👨🏼",
  10994. "👨🏽‍🌾",
  10995. "👨🏽‍🍳",
  10996. "👨🏽‍🎓",
  10997. "👨🏽‍🎤",
  10998. "👨🏽‍🎨",
  10999. "👨🏽‍🏫",
  11000. "👨🏽‍🏭",
  11001. "👨🏽‍💻",
  11002. "👨🏽‍💼",
  11003. "👨🏽‍🔧",
  11004. "👨🏽‍🔬",
  11005. "👨🏽‍🚀",
  11006. "👨🏽‍🚒",
  11007. "👨🏽‍🤝‍👨🏻",
  11008. "👨🏽‍🤝‍👨🏼",
  11009. "👨🏽‍🦯",
  11010. "👨🏽‍🦰",
  11011. "👨🏽‍🦱",
  11012. "👨🏽‍🦲",
  11013. "👨🏽‍🦳",
  11014. "👨🏽‍🦼",
  11015. "👨🏽‍🦽",
  11016. "👨🏽‍⚕️",
  11017. "👨🏽‍⚖️",
  11018. "👨🏽‍✈️",
  11019. "👨🏽",
  11020. "👨🏾‍🌾",
  11021. "👨🏾‍🍳",
  11022. "👨🏾‍🎓",
  11023. "👨🏾‍🎤",
  11024. "👨🏾‍🎨",
  11025. "👨🏾‍🏫",
  11026. "👨🏾‍🏭",
  11027. "👨🏾‍💻",
  11028. "👨🏾‍💼",
  11029. "👨🏾‍🔧",
  11030. "👨🏾‍🔬",
  11031. "👨🏾‍🚀",
  11032. "👨🏾‍🚒",
  11033. "👨🏾‍🤝‍👨🏻",
  11034. "👨🏾‍🤝‍👨🏼",
  11035. "👨🏾‍🤝‍👨🏽",
  11036. "👨🏾‍🦯",
  11037. "👨🏾‍🦰",
  11038. "👨🏾‍🦱",
  11039. "👨🏾‍🦲",
  11040. "👨🏾‍🦳",
  11041. "👨🏾‍🦼",
  11042. "👨🏾‍🦽",
  11043. "👨🏾‍⚕️",
  11044. "👨🏾‍⚖️",
  11045. "👨🏾‍✈️",
  11046. "👨🏾",
  11047. "👨🏿‍🌾",
  11048. "👨🏿‍🍳",
  11049. "👨🏿‍🎓",
  11050. "👨🏿‍🎤",
  11051. "👨🏿‍🎨",
  11052. "👨🏿‍🏫",
  11053. "👨🏿‍🏭",
  11054. "👨🏿‍💻",
  11055. "👨🏿‍💼",
  11056. "👨🏿‍🔧",
  11057. "👨🏿‍🔬",
  11058. "👨🏿‍🚀",
  11059. "👨🏿‍🚒",
  11060. "👨🏿‍🤝‍👨🏻",
  11061. "👨🏿‍🤝‍👨🏼",
  11062. "👨🏿‍🤝‍👨🏽",
  11063. "👨🏿‍🤝‍👨🏾",
  11064. "👨🏿‍🦯",
  11065. "👨🏿‍🦰",
  11066. "👨🏿‍🦱",
  11067. "👨🏿‍🦲",
  11068. "👨🏿‍🦳",
  11069. "👨🏿‍🦼",
  11070. "👨🏿‍🦽",
  11071. "👨🏿‍⚕️",
  11072. "👨🏿‍⚖️",
  11073. "👨🏿‍✈️",
  11074. "👨🏿",
  11075. "👨‍🌾",
  11076. "👨‍🍳",
  11077. "👨‍🎓",
  11078. "👨‍🎤",
  11079. "👨‍🎨",
  11080. "👨‍🏫",
  11081. "👨‍🏭",
  11082. "👨‍👦‍👦",
  11083. "👨‍👦",
  11084. "👨‍👧‍👦",
  11085. "👨‍👧‍👧",
  11086. "👨‍👧",
  11087. "👨‍👨‍👦‍👦",
  11088. "👨‍👨‍👦",
  11089. "👨‍👨‍👧‍👦",
  11090. "👨‍👨‍👧‍👧",
  11091. "👨‍👨‍👧",
  11092. "👨‍👩‍👦‍👦",
  11093. "👨‍👩‍👦",
  11094. "👨‍👩‍👧‍👦",
  11095. "👨‍👩‍👧‍👧",
  11096. "👨‍👩‍👧",
  11097. "👨‍💻",
  11098. "👨‍💼",
  11099. "👨‍🔧",
  11100. "👨‍🔬",
  11101. "👨‍🚀",
  11102. "👨‍🚒",
  11103. "👨‍🦯",
  11104. "👨‍🦰",
  11105. "👨‍🦱",
  11106. "👨‍🦲",
  11107. "👨‍🦳",
  11108. "👨‍🦼",
  11109. "👨‍🦽",
  11110. "👨‍⚕️",
  11111. "👨‍⚖️",
  11112. "👨‍✈️",
  11113. "👨‍❤️‍👨",
  11114. "👨‍❤️‍💋‍👨",
  11115. "👨",
  11116. "👩🏻‍🌾",
  11117. "👩🏻‍🍳",
  11118. "👩🏻‍🎓",
  11119. "👩🏻‍🎤",
  11120. "👩🏻‍🎨",
  11121. "👩🏻‍🏫",
  11122. "👩🏻‍🏭",
  11123. "👩🏻‍💻",
  11124. "👩🏻‍💼",
  11125. "👩🏻‍🔧",
  11126. "👩🏻‍🔬",
  11127. "👩🏻‍🚀",
  11128. "👩🏻‍🚒",
  11129. "👩🏻‍🤝‍👨🏼",
  11130. "👩🏻‍🤝‍👨🏽",
  11131. "👩🏻‍🤝‍👨🏾",
  11132. "👩🏻‍🤝‍👨🏿",
  11133. "👩🏻‍🦯",
  11134. "👩🏻‍🦰",
  11135. "👩🏻‍🦱",
  11136. "👩🏻‍🦲",
  11137. "👩🏻‍🦳",
  11138. "👩🏻‍🦼",
  11139. "👩🏻‍🦽",
  11140. "👩🏻‍⚕️",
  11141. "👩🏻‍⚖️",
  11142. "👩🏻‍✈️",
  11143. "👩🏻",
  11144. "👩🏼‍🌾",
  11145. "👩🏼‍🍳",
  11146. "👩🏼‍🎓",
  11147. "👩🏼‍🎤",
  11148. "👩🏼‍🎨",
  11149. "👩🏼‍🏫",
  11150. "👩🏼‍🏭",
  11151. "👩🏼‍💻",
  11152. "👩🏼‍💼",
  11153. "👩🏼‍🔧",
  11154. "👩🏼‍🔬",
  11155. "👩🏼‍🚀",
  11156. "👩🏼‍🚒",
  11157. "👩🏼‍🤝‍👨🏻",
  11158. "👩🏼‍🤝‍👨🏽",
  11159. "👩🏼‍🤝‍👨🏾",
  11160. "👩🏼‍🤝‍👨🏿",
  11161. "👩🏼‍🤝‍👩🏻",
  11162. "👩🏼‍🦯",
  11163. "👩🏼‍🦰",
  11164. "👩🏼‍🦱",
  11165. "👩🏼‍🦲",
  11166. "👩🏼‍🦳",
  11167. "👩🏼‍🦼",
  11168. "👩🏼‍🦽",
  11169. "👩🏼‍⚕️",
  11170. "👩🏼‍⚖️",
  11171. "👩🏼‍✈️",
  11172. "👩🏼",
  11173. "👩🏽‍🌾",
  11174. "👩🏽‍🍳",
  11175. "👩🏽‍🎓",
  11176. "👩🏽‍🎤",
  11177. "👩🏽‍🎨",
  11178. "👩🏽‍🏫",
  11179. "👩🏽‍🏭",
  11180. "👩🏽‍💻",
  11181. "👩🏽‍💼",
  11182. "👩🏽‍🔧",
  11183. "👩🏽‍🔬",
  11184. "👩🏽‍🚀",
  11185. "👩🏽‍🚒",
  11186. "👩🏽‍🤝‍👨🏻",
  11187. "👩🏽‍🤝‍👨🏼",
  11188. "👩🏽‍🤝‍👨🏾",
  11189. "👩🏽‍🤝‍👨🏿",
  11190. "👩🏽‍🤝‍👩🏻",
  11191. "👩🏽‍🤝‍👩🏼",
  11192. "👩🏽‍🦯",
  11193. "👩🏽‍🦰",
  11194. "👩🏽‍🦱",
  11195. "👩🏽‍🦲",
  11196. "👩🏽‍🦳",
  11197. "👩🏽‍🦼",
  11198. "👩🏽‍🦽",
  11199. "👩🏽‍⚕️",
  11200. "👩🏽‍⚖️",
  11201. "👩🏽‍✈️",
  11202. "👩🏽",
  11203. "👩🏾‍🌾",
  11204. "👩🏾‍🍳",
  11205. "👩🏾‍🎓",
  11206. "👩🏾‍🎤",
  11207. "👩🏾‍🎨",
  11208. "👩🏾‍🏫",
  11209. "👩🏾‍🏭",
  11210. "👩🏾‍💻",
  11211. "👩🏾‍💼",
  11212. "👩🏾‍🔧",
  11213. "👩🏾‍🔬",
  11214. "👩🏾‍🚀",
  11215. "👩🏾‍🚒",
  11216. "👩🏾‍🤝‍👨🏻",
  11217. "👩🏾‍🤝‍👨🏼",
  11218. "👩🏾‍🤝‍👨🏽",
  11219. "👩🏾‍🤝‍👨🏿",
  11220. "👩🏾‍🤝‍👩🏻",
  11221. "👩🏾‍🤝‍👩🏼",
  11222. "👩🏾‍🤝‍👩🏽",
  11223. "👩🏾‍🦯",
  11224. "👩🏾‍🦰",
  11225. "👩🏾‍🦱",
  11226. "👩🏾‍🦲",
  11227. "👩🏾‍🦳",
  11228. "👩🏾‍🦼",
  11229. "👩🏾‍🦽",
  11230. "👩🏾‍⚕️",
  11231. "👩🏾‍⚖️",
  11232. "👩🏾‍✈️",
  11233. "👩🏾",
  11234. "👩🏿‍🌾",
  11235. "👩🏿‍🍳",
  11236. "👩🏿‍🎓",
  11237. "👩🏿‍🎤",
  11238. "👩🏿‍🎨",
  11239. "👩🏿‍🏫",
  11240. "👩🏿‍🏭",
  11241. "👩🏿‍💻",
  11242. "👩🏿‍💼",
  11243. "👩🏿‍🔧",
  11244. "👩🏿‍🔬",
  11245. "👩🏿‍🚀",
  11246. "👩🏿‍🚒",
  11247. "👩🏿‍🤝‍👨🏻",
  11248. "👩🏿‍🤝‍👨🏼",
  11249. "👩🏿‍🤝‍👨🏽",
  11250. "👩🏿‍🤝‍👨🏾",
  11251. "👩🏿‍🤝‍👩🏻",
  11252. "👩🏿‍🤝‍👩🏼",
  11253. "👩🏿‍🤝‍👩🏽",
  11254. "👩🏿‍🤝‍👩🏾",
  11255. "👩🏿‍🦯",
  11256. "👩🏿‍🦰",
  11257. "👩🏿‍🦱",
  11258. "👩🏿‍🦲",
  11259. "👩🏿‍🦳",
  11260. "👩🏿‍🦼",
  11261. "👩🏿‍🦽",
  11262. "👩🏿‍⚕️",
  11263. "👩🏿‍⚖️",
  11264. "👩🏿‍✈️",
  11265. "👩🏿",
  11266. "👩‍🌾",
  11267. "👩‍🍳",
  11268. "👩‍🎓",
  11269. "👩‍🎤",
  11270. "👩‍🎨",
  11271. "👩‍🏫",
  11272. "👩‍🏭",
  11273. "👩‍👦‍👦",
  11274. "👩‍👦",
  11275. "👩‍👧‍👦",
  11276. "👩‍👧‍👧",
  11277. "👩‍👧",
  11278. "👩‍👩‍👦‍👦",
  11279. "👩‍👩‍👦",
  11280. "👩‍👩‍👧‍👦",
  11281. "👩‍👩‍👧‍👧",
  11282. "👩‍👩‍👧",
  11283. "👩‍💻",
  11284. "👩‍💼",
  11285. "👩‍🔧",
  11286. "👩‍🔬",
  11287. "👩‍🚀",
  11288. "👩‍🚒",
  11289. "👩‍🦯",
  11290. "👩‍🦰",
  11291. "👩‍🦱",
  11292. "👩‍🦲",
  11293. "👩‍🦳",
  11294. "👩‍🦼",
  11295. "👩‍🦽",
  11296. "👩‍⚕️",
  11297. "👩‍⚖️",
  11298. "👩‍✈️",
  11299. "👩‍❤️‍👨",
  11300. "👩‍❤️‍👩",
  11301. "👩‍❤️‍💋‍👨",
  11302. "👩‍❤️‍💋‍👩",
  11303. "👩",
  11304. "👪",
  11305. "👫🏻",
  11306. "👫🏼",
  11307. "👫🏽",
  11308. "👫🏾",
  11309. "👫🏿",
  11310. "👫",
  11311. "👬🏻",
  11312. "👬🏼",
  11313. "👬🏽",
  11314. "👬🏾",
  11315. "👬🏿",
  11316. "👬",
  11317. "👭🏻",
  11318. "👭🏼",
  11319. "👭🏽",
  11320. "👭🏾",
  11321. "👭🏿",
  11322. "👭",
  11323. "👮🏻‍♀️",
  11324. "👮🏻‍♂️",
  11325. "👮🏻",
  11326. "👮🏼‍♀️",
  11327. "👮🏼‍♂️",
  11328. "👮🏼",
  11329. "👮🏽‍♀️",
  11330. "👮🏽‍♂️",
  11331. "👮🏽",
  11332. "👮🏾‍♀️",
  11333. "👮🏾‍♂️",
  11334. "👮🏾",
  11335. "👮🏿‍♀️",
  11336. "👮🏿‍♂️",
  11337. "👮🏿",
  11338. "👮‍♀️",
  11339. "👮‍♂️",
  11340. "👮",
  11341. "👯‍♀️",
  11342. "👯‍♂️",
  11343. "👯",
  11344. "👰🏻",
  11345. "👰🏼",
  11346. "👰🏽",
  11347. "👰🏾",
  11348. "👰🏿",
  11349. "👰",
  11350. "👱🏻‍♀️",
  11351. "👱🏻‍♂️",
  11352. "👱🏻",
  11353. "👱🏼‍♀️",
  11354. "👱🏼‍♂️",
  11355. "👱🏼",
  11356. "👱🏽‍♀️",
  11357. "👱🏽‍♂️",
  11358. "👱🏽",
  11359. "👱🏾‍♀️",
  11360. "👱🏾‍♂️",
  11361. "👱🏾",
  11362. "👱🏿‍♀️",
  11363. "👱🏿‍♂️",
  11364. "👱🏿",
  11365. "👱‍♀️",
  11366. "👱‍♂️",
  11367. "👱",
  11368. "👲🏻",
  11369. "👲🏼",
  11370. "👲🏽",
  11371. "👲🏾",
  11372. "👲🏿",
  11373. "👲",
  11374. "👳🏻‍♀️",
  11375. "👳🏻‍♂️",
  11376. "👳🏻",
  11377. "👳🏼‍♀️",
  11378. "👳🏼‍♂️",
  11379. "👳🏼",
  11380. "👳🏽‍♀️",
  11381. "👳🏽‍♂️",
  11382. "👳🏽",
  11383. "👳🏾‍♀️",
  11384. "👳🏾‍♂️",
  11385. "👳🏾",
  11386. "👳🏿‍♀️",
  11387. "👳🏿‍♂️",
  11388. "👳🏿",
  11389. "👳‍♀️",
  11390. "👳‍♂️",
  11391. "👳",
  11392. "👴🏻",
  11393. "👴🏼",
  11394. "👴🏽",
  11395. "👴🏾",
  11396. "👴🏿",
  11397. "👴",
  11398. "👵🏻",
  11399. "👵🏼",
  11400. "👵🏽",
  11401. "👵🏾",
  11402. "👵🏿",
  11403. "👵",
  11404. "👶🏻",
  11405. "👶🏼",
  11406. "👶🏽",
  11407. "👶🏾",
  11408. "👶🏿",
  11409. "👶",
  11410. "👷🏻‍♀️",
  11411. "👷🏻‍♂️",
  11412. "👷🏻",
  11413. "👷🏼‍♀️",
  11414. "👷🏼‍♂️",
  11415. "👷🏼",
  11416. "👷🏽‍♀️",
  11417. "👷🏽‍♂️",
  11418. "👷🏽",
  11419. "👷🏾‍♀️",
  11420. "👷🏾‍♂️",
  11421. "👷🏾",
  11422. "👷🏿‍♀️",
  11423. "👷🏿‍♂️",
  11424. "👷🏿",
  11425. "👷‍♀️",
  11426. "👷‍♂️",
  11427. "👷",
  11428. "👸🏻",
  11429. "👸🏼",
  11430. "👸🏽",
  11431. "👸🏾",
  11432. "👸🏿",
  11433. "👸",
  11434. "👹",
  11435. "👺",
  11436. "👻",
  11437. "👼🏻",
  11438. "👼🏼",
  11439. "👼🏽",
  11440. "👼🏾",
  11441. "👼🏿",
  11442. "👼",
  11443. "👽",
  11444. "👾",
  11445. "👿",
  11446. "💀",
  11447. "💁🏻‍♀️",
  11448. "💁🏻‍♂️",
  11449. "💁🏻",
  11450. "💁🏼‍♀️",
  11451. "💁🏼‍♂️",
  11452. "💁🏼",
  11453. "💁🏽‍♀️",
  11454. "💁🏽‍♂️",
  11455. "💁🏽",
  11456. "💁🏾‍♀️",
  11457. "💁🏾‍♂️",
  11458. "💁🏾",
  11459. "💁🏿‍♀️",
  11460. "💁🏿‍♂️",
  11461. "💁🏿",
  11462. "💁‍♀️",
  11463. "💁‍♂️",
  11464. "💁",
  11465. "💂🏻‍♀️",
  11466. "💂🏻‍♂️",
  11467. "💂🏻",
  11468. "💂🏼‍♀️",
  11469. "💂🏼‍♂️",
  11470. "💂🏼",
  11471. "💂🏽‍♀️",
  11472. "💂🏽‍♂️",
  11473. "💂🏽",
  11474. "💂🏾‍♀️",
  11475. "💂🏾‍♂️",
  11476. "💂🏾",
  11477. "💂🏿‍♀️",
  11478. "💂🏿‍♂️",
  11479. "💂🏿",
  11480. "💂‍♀️",
  11481. "💂‍♂️",
  11482. "💂",
  11483. "💃🏻",
  11484. "💃🏼",
  11485. "💃🏽",
  11486. "💃🏾",
  11487. "💃🏿",
  11488. "💃",
  11489. "💄",
  11490. "💅🏻",
  11491. "💅🏼",
  11492. "💅🏽",
  11493. "💅🏾",
  11494. "💅🏿",
  11495. "💅",
  11496. "💆🏻‍♀️",
  11497. "💆🏻‍♂️",
  11498. "💆🏻",
  11499. "💆🏼‍♀️",
  11500. "💆🏼‍♂️",
  11501. "💆🏼",
  11502. "💆🏽‍♀️",
  11503. "💆🏽‍♂️",
  11504. "💆🏽",
  11505. "💆🏾‍♀️",
  11506. "💆🏾‍♂️",
  11507. "💆🏾",
  11508. "💆🏿‍♀️",
  11509. "💆🏿‍♂️",
  11510. "💆🏿",
  11511. "💆‍♀️",
  11512. "💆‍♂️",
  11513. "💆",
  11514. "💇🏻‍♀️",
  11515. "💇🏻‍♂️",
  11516. "💇🏻",
  11517. "💇🏼‍♀️",
  11518. "💇🏼‍♂️",
  11519. "💇🏼",
  11520. "💇🏽‍♀️",
  11521. "💇🏽‍♂️",
  11522. "💇🏽",
  11523. "💇🏾‍♀️",
  11524. "💇🏾‍♂️",
  11525. "💇🏾",
  11526. "💇🏿‍♀️",
  11527. "💇🏿‍♂️",
  11528. "💇🏿",
  11529. "💇‍♀️",
  11530. "💇‍♂️",
  11531. "💇",
  11532. "💈",
  11533. "💉",
  11534. "💊",
  11535. "💋",
  11536. "💌",
  11537. "💍",
  11538. "💎",
  11539. "💏",
  11540. "💐",
  11541. "💑",
  11542. "💒",
  11543. "💓",
  11544. "💔",
  11545. "💕",
  11546. "💖",
  11547. "💗",
  11548. "💘",
  11549. "💙",
  11550. "💚",
  11551. "💛",
  11552. "💜",
  11553. "💝",
  11554. "💞",
  11555. "💟",
  11556. "💠",
  11557. "💡",
  11558. "💢",
  11559. "💣",
  11560. "💤",
  11561. "💥",
  11562. "💦",
  11563. "💧",
  11564. "💨",
  11565. "💩",
  11566. "💪🏻",
  11567. "💪🏼",
  11568. "💪🏽",
  11569. "💪🏾",
  11570. "💪🏿",
  11571. "💪",
  11572. "💫",
  11573. "💬",
  11574. "💭",
  11575. "💮",
  11576. "💯",
  11577. "💰",
  11578. "💱",
  11579. "💲",
  11580. "💳",
  11581. "💴",
  11582. "💵",
  11583. "💶",
  11584. "💷",
  11585. "💸",
  11586. "💹",
  11587. "💺",
  11588. "💻",
  11589. "💼",
  11590. "💽",
  11591. "💾",
  11592. "💿",
  11593. "📀",
  11594. "📁",
  11595. "📂",
  11596. "📃",
  11597. "📄",
  11598. "📅",
  11599. "📆",
  11600. "📇",
  11601. "📈",
  11602. "📉",
  11603. "📊",
  11604. "📋",
  11605. "📌",
  11606. "📍",
  11607. "📎",
  11608. "📏",
  11609. "📐",
  11610. "📑",
  11611. "📒",
  11612. "📓",
  11613. "📔",
  11614. "📕",
  11615. "📖",
  11616. "📗",
  11617. "📘",
  11618. "📙",
  11619. "📚",
  11620. "📛",
  11621. "📜",
  11622. "📝",
  11623. "📞",
  11624. "📟",
  11625. "📠",
  11626. "📡",
  11627. "📢",
  11628. "📣",
  11629. "📤",
  11630. "📥",
  11631. "📦",
  11632. "📧",
  11633. "📨",
  11634. "📩",
  11635. "📪",
  11636. "📫",
  11637. "📬",
  11638. "📭",
  11639. "📮",
  11640. "📯",
  11641. "📰",
  11642. "📱",
  11643. "📲",
  11644. "📳",
  11645. "📴",
  11646. "📵",
  11647. "📶",
  11648. "📷",
  11649. "📸",
  11650. "📹",
  11651. "📺",
  11652. "📻",
  11653. "📼",
  11654. "📽️",
  11655. "📿",
  11656. "🔀",
  11657. "🔁",
  11658. "🔂",
  11659. "🔃",
  11660. "🔄",
  11661. "🔅",
  11662. "🔆",
  11663. "🔇",
  11664. "🔈",
  11665. "🔉",
  11666. "🔊",
  11667. "🔋",
  11668. "🔌",
  11669. "🔍",
  11670. "🔎",
  11671. "🔏",
  11672. "🔐",
  11673. "🔑",
  11674. "🔒",
  11675. "🔓",
  11676. "🔔",
  11677. "🔕",
  11678. "🔖",
  11679. "🔗",
  11680. "🔘",
  11681. "🔙",
  11682. "🔚",
  11683. "🔛",
  11684. "🔜",
  11685. "🔝",
  11686. "🔞",
  11687. "🔟",
  11688. "🔠",
  11689. "🔡",
  11690. "🔢",
  11691. "🔣",
  11692. "🔤",
  11693. "🔥",
  11694. "🔦",
  11695. "🔧",
  11696. "🔨",
  11697. "🔩",
  11698. "🔪",
  11699. "🔫",
  11700. "🔬",
  11701. "🔭",
  11702. "🔮",
  11703. "🔯",
  11704. "🔰",
  11705. "🔱",
  11706. "🔲",
  11707. "🔳",
  11708. "🔴",
  11709. "🔵",
  11710. "🔶",
  11711. "🔷",
  11712. "🔸",
  11713. "🔹",
  11714. "🔺",
  11715. "🔻",
  11716. "🔼",
  11717. "🔽",
  11718. "🕉️",
  11719. "🕊️",
  11720. "🕋",
  11721. "🕌",
  11722. "🕍",
  11723. "🕎",
  11724. "🕐",
  11725. "🕑",
  11726. "🕒",
  11727. "🕓",
  11728. "🕔",
  11729. "🕕",
  11730. "🕖",
  11731. "🕗",
  11732. "🕘",
  11733. "🕙",
  11734. "🕚",
  11735. "🕛",
  11736. "🕜",
  11737. "🕝",
  11738. "🕞",
  11739. "🕟",
  11740. "🕠",
  11741. "🕡",
  11742. "🕢",
  11743. "🕣",
  11744. "🕤",
  11745. "🕥",
  11746. "🕦",
  11747. "🕧",
  11748. "🕯️",
  11749. "🕰️",
  11750. "🕳️",
  11751. "🕴🏻‍♀️",
  11752. "🕴🏻‍♂️",
  11753. "🕴🏻",
  11754. "🕴🏼‍♀️",
  11755. "🕴🏼‍♂️",
  11756. "🕴🏼",
  11757. "🕴🏽‍♀️",
  11758. "🕴🏽‍♂️",
  11759. "🕴🏽",
  11760. "🕴🏾‍♀️",
  11761. "🕴🏾‍♂️",
  11762. "🕴🏾",
  11763. "🕴🏿‍♀️",
  11764. "🕴🏿‍♂️",
  11765. "🕴🏿",
  11766. "🕴️‍♀️",
  11767. "🕴️‍♂️",
  11768. "🕴️",
  11769. "🕵🏻‍♀️",
  11770. "🕵🏻‍♂️",
  11771. "🕵🏻",
  11772. "🕵🏼‍♀️",
  11773. "🕵🏼‍♂️",
  11774. "🕵🏼",
  11775. "🕵🏽‍♀️",
  11776. "🕵🏽‍♂️",
  11777. "🕵🏽",
  11778. "🕵🏾‍♀️",
  11779. "🕵🏾‍♂️",
  11780. "🕵🏾",
  11781. "🕵🏿‍♀️",
  11782. "🕵🏿‍♂️",
  11783. "🕵🏿",
  11784. "🕵️‍♀️",
  11785. "🕵️‍♂️",
  11786. "🕵️",
  11787. "🕶️",
  11788. "🕷️",
  11789. "🕸️",
  11790. "🕹️",
  11791. "🕺🏻",
  11792. "🕺🏼",
  11793. "🕺🏽",
  11794. "🕺🏾",
  11795. "🕺🏿",
  11796. "🕺",
  11797. "🖇️",
  11798. "🖊️",
  11799. "🖋️",
  11800. "🖌️",
  11801. "🖍️",
  11802. "🖐🏻",
  11803. "🖐🏼",
  11804. "🖐🏽",
  11805. "🖐🏾",
  11806. "🖐🏿",
  11807. "🖐️",
  11808. "🖕🏻",
  11809. "🖕🏼",
  11810. "🖕🏽",
  11811. "🖕🏾",
  11812. "🖕🏿",
  11813. "🖕",
  11814. "🖖🏻",
  11815. "🖖🏼",
  11816. "🖖🏽",
  11817. "🖖🏾",
  11818. "🖖🏿",
  11819. "🖖",
  11820. "🖤",
  11821. "🖥️",
  11822. "🖨️",
  11823. "🖱️",
  11824. "🖲️",
  11825. "🖼️",
  11826. "🗂️",
  11827. "🗃️",
  11828. "🗄️",
  11829. "🗑️",
  11830. "🗒️",
  11831. "🗓️",
  11832. "🗜️",
  11833. "🗝️",
  11834. "🗞️",
  11835. "🗡️",
  11836. "🗣️",
  11837. "🗨️",
  11838. "🗯️",
  11839. "🗳️",
  11840. "🗺️",
  11841. "🗻",
  11842. "🗼",
  11843. "🗽",
  11844. "🗾",
  11845. "🗿",
  11846. "😀",
  11847. "😁",
  11848. "😂",
  11849. "😃",
  11850. "😄",
  11851. "😅",
  11852. "😆",
  11853. "😇",
  11854. "😈",
  11855. "😉",
  11856. "😊",
  11857. "😋",
  11858. "😌",
  11859. "😍",
  11860. "😎",
  11861. "😏",
  11862. "😐",
  11863. "😑",
  11864. "😒",
  11865. "😓",
  11866. "😔",
  11867. "😕",
  11868. "😖",
  11869. "😗",
  11870. "😘",
  11871. "😙",
  11872. "😚",
  11873. "😛",
  11874. "😜",
  11875. "😝",
  11876. "😞",
  11877. "😟",
  11878. "😠",
  11879. "😡",
  11880. "😢",
  11881. "😣",
  11882. "😤",
  11883. "😥",
  11884. "😦",
  11885. "😧",
  11886. "😨",
  11887. "😩",
  11888. "😪",
  11889. "😫",
  11890. "😬",
  11891. "😭",
  11892. "😮",
  11893. "😯",
  11894. "😰",
  11895. "😱",
  11896. "😲",
  11897. "😳",
  11898. "😴",
  11899. "😵",
  11900. "😶",
  11901. "😷",
  11902. "😸",
  11903. "😹",
  11904. "😺",
  11905. "😻",
  11906. "😼",
  11907. "😽",
  11908. "😾",
  11909. "😿",
  11910. "🙀",
  11911. "🙁",
  11912. "🙂",
  11913. "🙃",
  11914. "🙄",
  11915. "🙅🏻‍♀️",
  11916. "🙅🏻‍♂️",
  11917. "🙅🏻",
  11918. "🙅🏼‍♀️",
  11919. "🙅🏼‍♂️",
  11920. "🙅🏼",
  11921. "🙅🏽‍♀️",
  11922. "🙅🏽‍♂️",
  11923. "🙅🏽",
  11924. "🙅🏾‍♀️",
  11925. "🙅🏾‍♂️",
  11926. "🙅🏾",
  11927. "🙅🏿‍♀️",
  11928. "🙅🏿‍♂️",
  11929. "🙅🏿",
  11930. "🙅‍♀️",
  11931. "🙅‍♂️",
  11932. "🙅",
  11933. "🙆🏻‍♀️",
  11934. "🙆🏻‍♂️",
  11935. "🙆🏻",
  11936. "🙆🏼‍♀️",
  11937. "🙆🏼‍♂️",
  11938. "🙆🏼",
  11939. "🙆🏽‍♀️",
  11940. "🙆🏽‍♂️",
  11941. "🙆🏽",
  11942. "🙆🏾‍♀️",
  11943. "🙆🏾‍♂️",
  11944. "🙆🏾",
  11945. "🙆🏿‍♀️",
  11946. "🙆🏿‍♂️",
  11947. "🙆🏿",
  11948. "🙆‍♀️",
  11949. "🙆‍♂️",
  11950. "🙆",
  11951. "🙇🏻‍♀️",
  11952. "🙇🏻‍♂️",
  11953. "🙇🏻",
  11954. "🙇🏼‍♀️",
  11955. "🙇🏼‍♂️",
  11956. "🙇🏼",
  11957. "🙇🏽‍♀️",
  11958. "🙇🏽‍♂️",
  11959. "🙇🏽",
  11960. "🙇🏾‍♀️",
  11961. "🙇🏾‍♂️",
  11962. "🙇🏾",
  11963. "🙇🏿‍♀️",
  11964. "🙇🏿‍♂️",
  11965. "🙇🏿",
  11966. "🙇‍♀️",
  11967. "🙇‍♂️",
  11968. "🙇",
  11969. "🙈",
  11970. "🙉",
  11971. "🙊",
  11972. "🙋🏻‍♀️",
  11973. "🙋🏻‍♂️",
  11974. "🙋🏻",
  11975. "🙋🏼‍♀️",
  11976. "🙋🏼‍♂️",
  11977. "🙋🏼",
  11978. "🙋🏽‍♀️",
  11979. "🙋🏽‍♂️",
  11980. "🙋🏽",
  11981. "🙋🏾‍♀️",
  11982. "🙋🏾‍♂️",
  11983. "🙋🏾",
  11984. "🙋🏿‍♀️",
  11985. "🙋🏿‍♂️",
  11986. "🙋🏿",
  11987. "🙋‍♀️",
  11988. "🙋‍♂️",
  11989. "🙋",
  11990. "🙌🏻",
  11991. "🙌🏼",
  11992. "🙌🏽",
  11993. "🙌🏾",
  11994. "🙌🏿",
  11995. "🙌",
  11996. "🙍🏻‍♀️",
  11997. "🙍🏻‍♂️",
  11998. "🙍🏻",
  11999. "🙍🏼‍♀️",
  12000. "🙍🏼‍♂️",
  12001. "🙍🏼",
  12002. "🙍🏽‍♀️",
  12003. "🙍🏽‍♂️",
  12004. "🙍🏽",
  12005. "🙍🏾‍♀️",
  12006. "🙍🏾‍♂️",
  12007. "🙍🏾",
  12008. "🙍🏿‍♀️",
  12009. "🙍🏿‍♂️",
  12010. "🙍🏿",
  12011. "🙍‍♀️",
  12012. "🙍‍♂️",
  12013. "🙍",
  12014. "🙎🏻‍♀️",
  12015. "🙎🏻‍♂️",
  12016. "🙎🏻",
  12017. "🙎🏼‍♀️",
  12018. "🙎🏼‍♂️",
  12019. "🙎🏼",
  12020. "🙎🏽‍♀️",
  12021. "🙎🏽‍♂️",
  12022. "🙎🏽",
  12023. "🙎🏾‍♀️",
  12024. "🙎🏾‍♂️",
  12025. "🙎🏾",
  12026. "🙎🏿‍♀️",
  12027. "🙎🏿‍♂️",
  12028. "🙎🏿",
  12029. "🙎‍♀️",
  12030. "🙎‍♂️",
  12031. "🙎",
  12032. "🙏🏻",
  12033. "🙏🏼",
  12034. "🙏🏽",
  12035. "🙏🏾",
  12036. "🙏🏿",
  12037. "🙏",
  12038. "🚀",
  12039. "🚁",
  12040. "🚂",
  12041. "🚃",
  12042. "🚄",
  12043. "🚅",
  12044. "🚆",
  12045. "🚇",
  12046. "🚈",
  12047. "🚉",
  12048. "🚊",
  12049. "🚋",
  12050. "🚌",
  12051. "🚍",
  12052. "🚎",
  12053. "🚏",
  12054. "🚐",
  12055. "🚑",
  12056. "🚒",
  12057. "🚓",
  12058. "🚔",
  12059. "🚕",
  12060. "🚖",
  12061. "🚗",
  12062. "🚘",
  12063. "🚙",
  12064. "🚚",
  12065. "🚛",
  12066. "🚜",
  12067. "🚝",
  12068. "🚞",
  12069. "🚟",
  12070. "🚠",
  12071. "🚡",
  12072. "🚢",
  12073. "🚣🏻‍♀️",
  12074. "🚣🏻‍♂️",
  12075. "🚣🏻",
  12076. "🚣🏼‍♀️",
  12077. "🚣🏼‍♂️",
  12078. "🚣🏼",
  12079. "🚣🏽‍♀️",
  12080. "🚣🏽‍♂️",
  12081. "🚣🏽",
  12082. "🚣🏾‍♀️",
  12083. "🚣🏾‍♂️",
  12084. "🚣🏾",
  12085. "🚣🏿‍♀️",
  12086. "🚣🏿‍♂️",
  12087. "🚣🏿",
  12088. "🚣‍♀️",
  12089. "🚣‍♂️",
  12090. "🚣",
  12091. "🚤",
  12092. "🚥",
  12093. "🚦",
  12094. "🚧",
  12095. "🚨",
  12096. "🚩",
  12097. "🚪",
  12098. "🚫",
  12099. "🚬",
  12100. "🚭",
  12101. "🚮",
  12102. "🚯",
  12103. "🚰",
  12104. "🚱",
  12105. "🚲",
  12106. "🚳",
  12107. "🚴🏻‍♀️",
  12108. "🚴🏻‍♂️",
  12109. "🚴🏻",
  12110. "🚴🏼‍♀️",
  12111. "🚴🏼‍♂️",
  12112. "🚴🏼",
  12113. "🚴🏽‍♀️",
  12114. "🚴🏽‍♂️",
  12115. "🚴🏽",
  12116. "🚴🏾‍♀️",
  12117. "🚴🏾‍♂️",
  12118. "🚴🏾",
  12119. "🚴🏿‍♀️",
  12120. "🚴🏿‍♂️",
  12121. "🚴🏿",
  12122. "🚴‍♀️",
  12123. "🚴‍♂️",
  12124. "🚴",
  12125. "🚵🏻‍♀️",
  12126. "🚵🏻‍♂️",
  12127. "🚵🏻",
  12128. "🚵🏼‍♀️",
  12129. "🚵🏼‍♂️",
  12130. "🚵🏼",
  12131. "🚵🏽‍♀️",
  12132. "🚵🏽‍♂️",
  12133. "🚵🏽",
  12134. "🚵🏾‍♀️",
  12135. "🚵🏾‍♂️",
  12136. "🚵🏾",
  12137. "🚵🏿‍♀️",
  12138. "🚵🏿‍♂️",
  12139. "🚵🏿",
  12140. "🚵‍♀️",
  12141. "🚵‍♂️",
  12142. "🚵",
  12143. "🚶🏻‍♀️",
  12144. "🚶🏻‍♂️",
  12145. "🚶🏻",
  12146. "🚶🏼‍♀️",
  12147. "🚶🏼‍♂️",
  12148. "🚶🏼",
  12149. "🚶🏽‍♀️",
  12150. "🚶🏽‍♂️",
  12151. "🚶🏽",
  12152. "🚶🏾‍♀️",
  12153. "🚶🏾‍♂️",
  12154. "🚶🏾",
  12155. "🚶🏿‍♀️",
  12156. "🚶🏿‍♂️",
  12157. "🚶🏿",
  12158. "🚶‍♀️",
  12159. "🚶‍♂️",
  12160. "🚶",
  12161. "🚷",
  12162. "🚸",
  12163. "🚹",
  12164. "🚺",
  12165. "🚻",
  12166. "🚼",
  12167. "🚽",
  12168. "🚾",
  12169. "🚿",
  12170. "🛀🏻",
  12171. "🛀🏼",
  12172. "🛀🏽",
  12173. "🛀🏾",
  12174. "🛀🏿",
  12175. "🛀",
  12176. "🛁",
  12177. "🛂",
  12178. "🛃",
  12179. "🛄",
  12180. "🛅",
  12181. "🛋️",
  12182. "🛌🏻",
  12183. "🛌🏼",
  12184. "🛌🏽",
  12185. "🛌🏾",
  12186. "🛌🏿",
  12187. "🛌",
  12188. "🛍️",
  12189. "🛎️",
  12190. "🛏️",
  12191. "🛐",
  12192. "🛑",
  12193. "🛒",
  12194. "🛕",
  12195. "🛠️",
  12196. "🛡️",
  12197. "🛢️",
  12198. "🛣️",
  12199. "🛤️",
  12200. "🛥️",
  12201. "🛩️",
  12202. "🛫",
  12203. "🛬",
  12204. "🛰️",
  12205. "🛳️",
  12206. "🛴",
  12207. "🛵",
  12208. "🛶",
  12209. "🛷",
  12210. "🛸",
  12211. "🛹",
  12212. "🛺",
  12213. "🟠",
  12214. "🟡",
  12215. "🟢",
  12216. "🟣",
  12217. "🟤",
  12218. "🟥",
  12219. "🟦",
  12220. "🟧",
  12221. "🟨",
  12222. "🟩",
  12223. "🟪",
  12224. "🟫",
  12225. "🤍",
  12226. "🤎",
  12227. "🤏🏻",
  12228. "🤏🏼",
  12229. "🤏🏽",
  12230. "🤏🏾",
  12231. "🤏🏿",
  12232. "🤏",
  12233. "🤐",
  12234. "🤑",
  12235. "🤒",
  12236. "🤓",
  12237. "🤔",
  12238. "🤕",
  12239. "🤖",
  12240. "🤗",
  12241. "🤘🏻",
  12242. "🤘🏼",
  12243. "🤘🏽",
  12244. "🤘🏾",
  12245. "🤘🏿",
  12246. "🤘",
  12247. "🤙🏻",
  12248. "🤙🏼",
  12249. "🤙🏽",
  12250. "🤙🏾",
  12251. "🤙🏿",
  12252. "🤙",
  12253. "🤚🏻",
  12254. "🤚🏼",
  12255. "🤚🏽",
  12256. "🤚🏾",
  12257. "🤚🏿",
  12258. "🤚",
  12259. "🤛🏻",
  12260. "🤛🏼",
  12261. "🤛🏽",
  12262. "🤛🏾",
  12263. "🤛🏿",
  12264. "🤛",
  12265. "🤜🏻",
  12266. "🤜🏼",
  12267. "🤜🏽",
  12268. "🤜🏾",
  12269. "🤜🏿",
  12270. "🤜",
  12271. "🤝",
  12272. "🤞🏻",
  12273. "🤞🏼",
  12274. "🤞🏽",
  12275. "🤞🏾",
  12276. "🤞🏿",
  12277. "🤞",
  12278. "🤟🏻",
  12279. "🤟🏼",
  12280. "🤟🏽",
  12281. "🤟🏾",
  12282. "🤟🏿",
  12283. "🤟",
  12284. "🤠",
  12285. "🤡",
  12286. "🤢",
  12287. "🤣",
  12288. "🤤",
  12289. "🤥",
  12290. "🤦🏻‍♀️",
  12291. "🤦🏻‍♂️",
  12292. "🤦🏻",
  12293. "🤦🏼‍♀️",
  12294. "🤦🏼‍♂️",
  12295. "🤦🏼",
  12296. "🤦🏽‍♀️",
  12297. "🤦🏽‍♂️",
  12298. "🤦🏽",
  12299. "🤦🏾‍♀️",
  12300. "🤦🏾‍♂️",
  12301. "🤦🏾",
  12302. "🤦🏿‍♀️",
  12303. "🤦🏿‍♂️",
  12304. "🤦🏿",
  12305. "🤦‍♀️",
  12306. "🤦‍♂️",
  12307. "🤦",
  12308. "🤧",
  12309. "🤨",
  12310. "🤩",
  12311. "🤪",
  12312. "🤫",
  12313. "🤬",
  12314. "🤭",
  12315. "🤮",
  12316. "🤯",
  12317. "🤰🏻",
  12318. "🤰🏼",
  12319. "🤰🏽",
  12320. "🤰🏾",
  12321. "🤰🏿",
  12322. "🤰",
  12323. "🤱🏻",
  12324. "🤱🏼",
  12325. "🤱🏽",
  12326. "🤱🏾",
  12327. "🤱🏿",
  12328. "🤱",
  12329. "🤲🏻",
  12330. "🤲🏼",
  12331. "🤲🏽",
  12332. "🤲🏾",
  12333. "🤲🏿",
  12334. "🤲",
  12335. "🤳🏻",
  12336. "🤳🏼",
  12337. "🤳🏽",
  12338. "🤳🏾",
  12339. "🤳🏿",
  12340. "🤳",
  12341. "🤴🏻",
  12342. "🤴🏼",
  12343. "🤴🏽",
  12344. "🤴🏾",
  12345. "🤴🏿",
  12346. "🤴",
  12347. "🤵🏻‍♀️",
  12348. "🤵🏻‍♂️",
  12349. "🤵🏻",
  12350. "🤵🏼‍♀️",
  12351. "🤵🏼‍♂️",
  12352. "🤵🏼",
  12353. "🤵🏽‍♀️",
  12354. "🤵🏽‍♂️",
  12355. "🤵🏽",
  12356. "🤵🏾‍♀️",
  12357. "🤵🏾‍♂️",
  12358. "🤵🏾",
  12359. "🤵🏿‍♀️",
  12360. "🤵🏿‍♂️",
  12361. "🤵🏿",
  12362. "🤵‍♀️",
  12363. "🤵‍♂️",
  12364. "🤵",
  12365. "🤶🏻",
  12366. "🤶🏼",
  12367. "🤶🏽",
  12368. "🤶🏾",
  12369. "🤶🏿",
  12370. "🤶",
  12371. "🤷🏻‍♀️",
  12372. "🤷🏻‍♂️",
  12373. "🤷🏻",
  12374. "🤷🏼‍♀️",
  12375. "🤷🏼‍♂️",
  12376. "🤷🏼",
  12377. "🤷🏽‍♀️",
  12378. "🤷🏽‍♂️",
  12379. "🤷🏽",
  12380. "🤷🏾‍♀️",
  12381. "🤷🏾‍♂️",
  12382. "🤷🏾",
  12383. "🤷🏿‍♀️",
  12384. "🤷🏿‍♂️",
  12385. "🤷🏿",
  12386. "🤷‍♀️",
  12387. "🤷‍♂️",
  12388. "🤷",
  12389. "🤸🏻‍♀️",
  12390. "🤸🏻‍♂️",
  12391. "🤸🏻",
  12392. "🤸🏼‍♀️",
  12393. "🤸🏼‍♂️",
  12394. "🤸🏼",
  12395. "🤸🏽‍♀️",
  12396. "🤸🏽‍♂️",
  12397. "🤸🏽",
  12398. "🤸🏾‍♀️",
  12399. "🤸🏾‍♂️",
  12400. "🤸🏾",
  12401. "🤸🏿‍♀️",
  12402. "🤸🏿‍♂️",
  12403. "🤸🏿",
  12404. "🤸‍♀️",
  12405. "🤸‍♂️",
  12406. "🤸",
  12407. "🤹🏻‍♀️",
  12408. "🤹🏻‍♂️",
  12409. "🤹🏻",
  12410. "🤹🏼‍♀️",
  12411. "🤹🏼‍♂️",
  12412. "🤹🏼",
  12413. "🤹🏽‍♀️",
  12414. "🤹🏽‍♂️",
  12415. "🤹🏽",
  12416. "🤹🏾‍♀️",
  12417. "🤹🏾‍♂️",
  12418. "🤹🏾",
  12419. "🤹🏿‍♀️",
  12420. "🤹🏿‍♂️",
  12421. "🤹🏿",
  12422. "🤹‍♀️",
  12423. "🤹‍♂️",
  12424. "🤹",
  12425. "🤺",
  12426. "🤼‍♀️",
  12427. "🤼‍♂️",
  12428. "🤼",
  12429. "🤽🏻‍♀️",
  12430. "🤽🏻‍♂️",
  12431. "🤽🏻",
  12432. "🤽🏼‍♀️",
  12433. "🤽🏼‍♂️",
  12434. "🤽🏼",
  12435. "🤽🏽‍♀️",
  12436. "🤽🏽‍♂️",
  12437. "🤽🏽",
  12438. "🤽🏾‍♀️",
  12439. "🤽🏾‍♂️",
  12440. "🤽🏾",
  12441. "🤽🏿‍♀️",
  12442. "🤽🏿‍♂️",
  12443. "🤽🏿",
  12444. "🤽‍♀️",
  12445. "🤽‍♂️",
  12446. "🤽",
  12447. "🤾🏻‍♀️",
  12448. "🤾🏻‍♂️",
  12449. "🤾🏻",
  12450. "🤾🏼‍♀️",
  12451. "🤾🏼‍♂️",
  12452. "🤾🏼",
  12453. "🤾🏽‍♀️",
  12454. "🤾🏽‍♂️",
  12455. "🤾🏽",
  12456. "🤾🏾‍♀️",
  12457. "🤾🏾‍♂️",
  12458. "🤾🏾",
  12459. "🤾🏿‍♀️",
  12460. "🤾🏿‍♂️",
  12461. "🤾🏿",
  12462. "🤾‍♀️",
  12463. "🤾‍♂️",
  12464. "🤾",
  12465. "🤿",
  12466. "🥀",
  12467. "🥁",
  12468. "🥂",
  12469. "🥃",
  12470. "🥄",
  12471. "🥅",
  12472. "🥇",
  12473. "🥈",
  12474. "🥉",
  12475. "🥊",
  12476. "🥋",
  12477. "🥌",
  12478. "🥍",
  12479. "🥎",
  12480. "🥏",
  12481. "🥐",
  12482. "🥑",
  12483. "🥒",
  12484. "🥓",
  12485. "🥔",
  12486. "🥕",
  12487. "🥖",
  12488. "🥗",
  12489. "🥘",
  12490. "🥙",
  12491. "🥚",
  12492. "🥛",
  12493. "🥜",
  12494. "🥝",
  12495. "🥞",
  12496. "🥟",
  12497. "🥠",
  12498. "🥡",
  12499. "🥢",
  12500. "🥣",
  12501. "🥤",
  12502. "🥥",
  12503. "🥦",
  12504. "🥧",
  12505. "🥨",
  12506. "🥩",
  12507. "🥪",
  12508. "🥫",
  12509. "🥬",
  12510. "🥭",
  12511. "🥮",
  12512. "🥯",
  12513. "🥰",
  12514. "🥱",
  12515. "🥳",
  12516. "🥴",
  12517. "🥵",
  12518. "🥶",
  12519. "🥺",
  12520. "🥻",
  12521. "🥼",
  12522. "🥽",
  12523. "🥾",
  12524. "🥿",
  12525. "🦀",
  12526. "🦁",
  12527. "🦂",
  12528. "🦃",
  12529. "🦄",
  12530. "🦅",
  12531. "🦆",
  12532. "🦇",
  12533. "🦈",
  12534. "🦉",
  12535. "🦊",
  12536. "🦋",
  12537. "🦌",
  12538. "🦍",
  12539. "🦎",
  12540. "🦏",
  12541. "🦐",
  12542. "🦑",
  12543. "🦒",
  12544. "🦓",
  12545. "🦔",
  12546. "🦕",
  12547. "🦖",
  12548. "🦗",
  12549. "🦘",
  12550. "🦙",
  12551. "🦚",
  12552. "🦛",
  12553. "🦜",
  12554. "🦝",
  12555. "🦞",
  12556. "🦟",
  12557. "🦠",
  12558. "🦡",
  12559. "🦢",
  12560. "🦥",
  12561. "🦦",
  12562. "🦧",
  12563. "🦨",
  12564. "🦩",
  12565. "🦪",
  12566. "🦮",
  12567. "🦯",
  12568. "🦰",
  12569. "🦱",
  12570. "🦲",
  12571. "🦳",
  12572. "🦴",
  12573. "🦵🏻",
  12574. "🦵🏼",
  12575. "🦵🏽",
  12576. "🦵🏾",
  12577. "🦵🏿",
  12578. "🦵",
  12579. "🦶🏻",
  12580. "🦶🏼",
  12581. "🦶🏽",
  12582. "🦶🏾",
  12583. "🦶🏿",
  12584. "🦶",
  12585. "🦷",
  12586. "🦸🏻‍♀️",
  12587. "🦸🏻‍♂️",
  12588. "🦸🏻",
  12589. "🦸🏼‍♀️",
  12590. "🦸🏼‍♂️",
  12591. "🦸🏼",
  12592. "🦸🏽‍♀️",
  12593. "🦸🏽‍♂️",
  12594. "🦸🏽",
  12595. "🦸🏾‍♀️",
  12596. "🦸🏾‍♂️",
  12597. "🦸🏾",
  12598. "🦸🏿‍♀️",
  12599. "🦸🏿‍♂️",
  12600. "🦸🏿",
  12601. "🦸‍♀️",
  12602. "🦸‍♂️",
  12603. "🦸",
  12604. "🦹🏻‍♀️",
  12605. "🦹🏻‍♂️",
  12606. "🦹🏻",
  12607. "🦹🏼‍♀️",
  12608. "🦹🏼‍♂️",
  12609. "🦹🏼",
  12610. "🦹🏽‍♀️",
  12611. "🦹🏽‍♂️",
  12612. "🦹🏽",
  12613. "🦹🏾‍♀️",
  12614. "🦹🏾‍♂️",
  12615. "🦹🏾",
  12616. "🦹🏿‍♀️",
  12617. "🦹🏿‍♂️",
  12618. "🦹🏿",
  12619. "🦹‍♀️",
  12620. "🦹‍♂️",
  12621. "🦹",
  12622. "🦺",
  12623. "🦻🏻",
  12624. "🦻🏼",
  12625. "🦻🏽",
  12626. "🦻🏾",
  12627. "🦻🏿",
  12628. "🦻",
  12629. "🦼",
  12630. "🦽",
  12631. "🦾",
  12632. "🦿",
  12633. "🧀",
  12634. "🧁",
  12635. "🧂",
  12636. "🧃",
  12637. "🧄",
  12638. "🧅",
  12639. "🧆",
  12640. "🧇",
  12641. "🧈",
  12642. "🧉",
  12643. "🧊",
  12644. "🧍🏻‍♀️",
  12645. "🧍🏻‍♂️",
  12646. "🧍🏻",
  12647. "🧍🏼‍♀️",
  12648. "🧍🏼‍♂️",
  12649. "🧍🏼",
  12650. "🧍🏽‍♀️",
  12651. "🧍🏽‍♂️",
  12652. "🧍🏽",
  12653. "🧍🏾‍♀️",
  12654. "🧍🏾‍♂️",
  12655. "🧍🏾",
  12656. "🧍🏿‍♀️",
  12657. "🧍🏿‍♂️",
  12658. "🧍🏿",
  12659. "🧍‍♀️",
  12660. "🧍‍♂️",
  12661. "🧍",
  12662. "🧎🏻‍♀️",
  12663. "🧎🏻‍♂️",
  12664. "🧎🏻",
  12665. "🧎🏼‍♀️",
  12666. "🧎🏼‍♂️",
  12667. "🧎🏼",
  12668. "🧎🏽‍♀️",
  12669. "🧎🏽‍♂️",
  12670. "🧎🏽",
  12671. "🧎🏾‍♀️",
  12672. "🧎🏾‍♂️",
  12673. "🧎🏾",
  12674. "🧎🏿‍♀️",
  12675. "🧎🏿‍♂️",
  12676. "🧎🏿",
  12677. "🧎‍♀️",
  12678. "🧎‍♂️",
  12679. "🧎",
  12680. "🧏🏻‍♀️",
  12681. "🧏🏻‍♂️",
  12682. "🧏🏻",
  12683. "🧏🏼‍♀️",
  12684. "🧏🏼‍♂️",
  12685. "🧏🏼",
  12686. "🧏🏽‍♀️",
  12687. "🧏🏽‍♂️",
  12688. "🧏🏽",
  12689. "🧏🏾‍♀️",
  12690. "🧏🏾‍♂️",
  12691. "🧏🏾",
  12692. "🧏🏿‍♀️",
  12693. "🧏🏿‍♂️",
  12694. "🧏🏿",
  12695. "🧏‍♀️",
  12696. "🧏‍♂️",
  12697. "🧏",
  12698. "🧐",
  12699. "🧑🏻‍🤝‍🧑🏻",
  12700. "🧑🏻",
  12701. "🧑🏼‍🤝‍🧑🏻",
  12702. "🧑🏼‍🤝‍🧑🏼",
  12703. "🧑🏼",
  12704. "🧑🏽‍🤝‍🧑🏻",
  12705. "🧑🏽‍🤝‍🧑🏼",
  12706. "🧑🏽‍🤝‍🧑🏽",
  12707. "🧑🏽",
  12708. "🧑🏾‍🤝‍🧑🏻",
  12709. "🧑🏾‍🤝‍🧑🏼",
  12710. "🧑🏾‍🤝‍🧑🏽",
  12711. "🧑🏾‍🤝‍🧑🏾",
  12712. "🧑🏾",
  12713. "🧑🏿‍🤝‍🧑🏻",
  12714. "🧑🏿‍🤝‍🧑🏼",
  12715. "🧑🏿‍🤝‍🧑🏽",
  12716. "🧑🏿‍🤝‍🧑🏾",
  12717. "🧑🏿‍🤝‍🧑🏿",
  12718. "🧑🏿",
  12719. "🧑‍🤝‍🧑",
  12720. "🧑",
  12721. "🧒🏻",
  12722. "🧒🏼",
  12723. "🧒🏽",
  12724. "🧒🏾",
  12725. "🧒🏿",
  12726. "🧒",
  12727. "🧓🏻",
  12728. "🧓🏼",
  12729. "🧓🏽",
  12730. "🧓🏾",
  12731. "🧓🏿",
  12732. "🧓",
  12733. "🧔🏻",
  12734. "🧔🏼",
  12735. "🧔🏽",
  12736. "🧔🏾",
  12737. "🧔🏿",
  12738. "🧔",
  12739. "🧕🏻",
  12740. "🧕🏼",
  12741. "🧕🏽",
  12742. "🧕🏾",
  12743. "🧕🏿",
  12744. "🧕",
  12745. "🧖🏻‍♀️",
  12746. "🧖🏻‍♂️",
  12747. "🧖🏻",
  12748. "🧖🏼‍♀️",
  12749. "🧖🏼‍♂️",
  12750. "🧖🏼",
  12751. "🧖🏽‍♀️",
  12752. "🧖🏽‍♂️",
  12753. "🧖🏽",
  12754. "🧖🏾‍♀️",
  12755. "🧖🏾‍♂️",
  12756. "🧖🏾",
  12757. "🧖🏿‍♀️",
  12758. "🧖🏿‍♂️",
  12759. "🧖🏿",
  12760. "🧖‍♀️",
  12761. "🧖‍♂️",
  12762. "🧖",
  12763. "🧗🏻‍♀️",
  12764. "🧗🏻‍♂️",
  12765. "🧗🏻",
  12766. "🧗🏼‍♀️",
  12767. "🧗🏼‍♂️",
  12768. "🧗🏼",
  12769. "🧗🏽‍♀️",
  12770. "🧗🏽‍♂️",
  12771. "🧗🏽",
  12772. "🧗🏾‍♀️",
  12773. "🧗🏾‍♂️",
  12774. "🧗🏾",
  12775. "🧗🏿‍♀️",
  12776. "🧗🏿‍♂️",
  12777. "🧗🏿",
  12778. "🧗‍♀️",
  12779. "🧗‍♂️",
  12780. "🧗",
  12781. "🧘🏻‍♀️",
  12782. "🧘🏻‍♂️",
  12783. "🧘🏻",
  12784. "🧘🏼‍♀️",
  12785. "🧘🏼‍♂️",
  12786. "🧘🏼",
  12787. "🧘🏽‍♀️",
  12788. "🧘🏽‍♂️",
  12789. "🧘🏽",
  12790. "🧘🏾‍♀️",
  12791. "🧘🏾‍♂️",
  12792. "🧘🏾",
  12793. "🧘🏿‍♀️",
  12794. "🧘🏿‍♂️",
  12795. "🧘🏿",
  12796. "🧘‍♀️",
  12797. "🧘‍♂️",
  12798. "🧘",
  12799. "🧙🏻‍♀️",
  12800. "🧙🏻‍♂️",
  12801. "🧙🏻",
  12802. "🧙🏼‍♀️",
  12803. "🧙🏼‍♂️",
  12804. "🧙🏼",
  12805. "🧙🏽‍♀️",
  12806. "🧙🏽‍♂️",
  12807. "🧙🏽",
  12808. "🧙🏾‍♀️",
  12809. "🧙🏾‍♂️",
  12810. "🧙🏾",
  12811. "🧙🏿‍♀️",
  12812. "🧙🏿‍♂️",
  12813. "🧙🏿",
  12814. "🧙‍♀️",
  12815. "🧙‍♂️",
  12816. "🧙",
  12817. "🧚🏻‍♀️",
  12818. "🧚🏻‍♂️",
  12819. "🧚🏻",
  12820. "🧚🏼‍♀️",
  12821. "🧚🏼‍♂️",
  12822. "🧚🏼",
  12823. "🧚🏽‍♀️",
  12824. "🧚🏽‍♂️",
  12825. "🧚🏽",
  12826. "🧚🏾‍♀️",
  12827. "🧚🏾‍♂️",
  12828. "🧚🏾",
  12829. "🧚🏿‍♀️",
  12830. "🧚🏿‍♂️",
  12831. "🧚🏿",
  12832. "🧚‍♀️",
  12833. "🧚‍♂️",
  12834. "🧚",
  12835. "🧛🏻‍♀️",
  12836. "🧛🏻‍♂️",
  12837. "🧛🏻",
  12838. "🧛🏼‍♀️",
  12839. "🧛🏼‍♂️",
  12840. "🧛🏼",
  12841. "🧛🏽‍♀️",
  12842. "🧛🏽‍♂️",
  12843. "🧛🏽",
  12844. "🧛🏾‍♀️",
  12845. "🧛🏾‍♂️",
  12846. "🧛🏾",
  12847. "🧛🏿‍♀️",
  12848. "🧛🏿‍♂️",
  12849. "🧛🏿",
  12850. "🧛‍♀️",
  12851. "🧛‍♂️",
  12852. "🧛",
  12853. "🧜🏻‍♀️",
  12854. "🧜🏻‍♂️",
  12855. "🧜🏻",
  12856. "🧜🏼‍♀️",
  12857. "🧜🏼‍♂️",
  12858. "🧜🏼",
  12859. "🧜🏽‍♀️",
  12860. "🧜🏽‍♂️",
  12861. "🧜🏽",
  12862. "🧜🏾‍♀️",
  12863. "🧜🏾‍♂️",
  12864. "🧜🏾",
  12865. "🧜🏿‍♀️",
  12866. "🧜🏿‍♂️",
  12867. "🧜🏿",
  12868. "🧜‍♀️",
  12869. "🧜‍♂️",
  12870. "🧜",
  12871. "🧝🏻‍♀️",
  12872. "🧝🏻‍♂️",
  12873. "🧝🏻",
  12874. "🧝🏼‍♀️",
  12875. "🧝🏼‍♂️",
  12876. "🧝🏼",
  12877. "🧝🏽‍♀️",
  12878. "🧝🏽‍♂️",
  12879. "🧝🏽",
  12880. "🧝🏾‍♀️",
  12881. "🧝🏾‍♂️",
  12882. "🧝🏾",
  12883. "🧝🏿‍♀️",
  12884. "🧝🏿‍♂️",
  12885. "🧝🏿",
  12886. "🧝‍♀️",
  12887. "🧝‍♂️",
  12888. "🧝",
  12889. "🧞‍♀️",
  12890. "🧞‍♂️",
  12891. "🧞",
  12892. "🧟‍♀️",
  12893. "🧟‍♂️",
  12894. "🧟",
  12895. "🧠",
  12896. "🧡",
  12897. "🧢",
  12898. "🧣",
  12899. "🧤",
  12900. "🧥",
  12901. "🧦",
  12902. "🧧",
  12903. "🧨",
  12904. "🧩",
  12905. "🧪",
  12906. "🧫",
  12907. "🧬",
  12908. "🧭",
  12909. "🧮",
  12910. "🧯",
  12911. "🧰",
  12912. "🧱",
  12913. "🧲",
  12914. "🧳",
  12915. "🧴",
  12916. "🧵",
  12917. "🧶",
  12918. "🧷",
  12919. "🧸",
  12920. "🧹",
  12921. "🧺",
  12922. "🧻",
  12923. "🧼",
  12924. "🧽",
  12925. "🧾",
  12926. "🧿",
  12927. "🩰",
  12928. "🩱",
  12929. "🩲",
  12930. "🩳",
  12931. "🩸",
  12932. "🩹",
  12933. "🩺",
  12934. "🪀",
  12935. "🪁",
  12936. "🪂",
  12937. "🪐",
  12938. "🪑",
  12939. "🪒",
  12940. "🪓",
  12941. "🪔",
  12942. "🪕",
  12943. "‼️",
  12944. "⁉️",
  12945. "™️",
  12946. "ℹ️",
  12947. "↔️",
  12948. "↕️",
  12949. "↖️",
  12950. "↗️",
  12951. "↘️",
  12952. "↙️",
  12953. "↩️",
  12954. "↪️",
  12955. "#⃣",
  12956. "⌚️",
  12957. "⌛️",
  12958. "⌨️",
  12959. "⏏️",
  12960. "⏩",
  12961. "⏪",
  12962. "⏫",
  12963. "⏬",
  12964. "⏭️",
  12965. "⏮️",
  12966. "⏯️",
  12967. "⏰",
  12968. "⏱️",
  12969. "⏲️",
  12970. "⏳",
  12971. "⏸️",
  12972. "⏹️",
  12973. "⏺️",
  12974. "Ⓜ️",
  12975. "▪️",
  12976. "▫️",
  12977. "▶️",
  12978. "◀️",
  12979. "◻️",
  12980. "◼️",
  12981. "◽️",
  12982. "◾️",
  12983. "☀️",
  12984. "☁️",
  12985. "☂️",
  12986. "☃️",
  12987. "☄️",
  12988. "☎️",
  12989. "☑️",
  12990. "☔️",
  12991. "☕️",
  12992. "☘️",
  12993. "☝🏻",
  12994. "☝🏼",
  12995. "☝🏽",
  12996. "☝🏾",
  12997. "☝🏿",
  12998. "☝️",
  12999. "☠️",
  13000. "☢️",
  13001. "☣️",
  13002. "☦️",
  13003. "☪️",
  13004. "☮️",
  13005. "☯️",
  13006. "☸️",
  13007. "☹️",
  13008. "☺️",
  13009. "♀️",
  13010. "♂️",
  13011. "♈️",
  13012. "♉️",
  13013. "♊️",
  13014. "♋️",
  13015. "♌️",
  13016. "♍️",
  13017. "♎️",
  13018. "♏️",
  13019. "♐️",
  13020. "♑️",
  13021. "♒️",
  13022. "♓️",
  13023. "♟️",
  13024. "♠️",
  13025. "♣️",
  13026. "♥️",
  13027. "♦️",
  13028. "♨️",
  13029. "♻️",
  13030. "♾",
  13031. "♿️",
  13032. "⚒️",
  13033. "⚓️",
  13034. "⚔️",
  13035. "⚕️",
  13036. "⚖️",
  13037. "⚗️",
  13038. "⚙️",
  13039. "⚛️",
  13040. "⚜️",
  13041. "⚠️",
  13042. "⚡️",
  13043. "⚪️",
  13044. "⚫️",
  13045. "⚰️",
  13046. "⚱️",
  13047. "⚽️",
  13048. "⚾️",
  13049. "⛄️",
  13050. "⛅️",
  13051. "⛈️",
  13052. "⛎",
  13053. "⛏️",
  13054. "⛑️",
  13055. "⛓️",
  13056. "⛔️",
  13057. "⛩️",
  13058. "⛪️",
  13059. "⛰️",
  13060. "⛱️",
  13061. "⛲️",
  13062. "⛳️",
  13063. "⛴️",
  13064. "⛵️",
  13065. "⛷🏻",
  13066. "⛷🏼",
  13067. "⛷🏽",
  13068. "⛷🏾",
  13069. "⛷🏿",
  13070. "⛷️",
  13071. "⛸️",
  13072. "⛹🏻‍♀️",
  13073. "⛹🏻‍♂️",
  13074. "⛹🏻",
  13075. "⛹🏼‍♀️",
  13076. "⛹🏼‍♂️",
  13077. "⛹🏼",
  13078. "⛹🏽‍♀️",
  13079. "⛹🏽‍♂️",
  13080. "⛹🏽",
  13081. "⛹🏾‍♀️",
  13082. "⛹🏾‍♂️",
  13083. "⛹🏾",
  13084. "⛹🏿‍♀️",
  13085. "⛹🏿‍♂️",
  13086. "⛹🏿",
  13087. "⛹️‍♀️",
  13088. "⛹️‍♂️",
  13089. "⛹️",
  13090. "⛺️",
  13091. "⛽️",
  13092. "✂️",
  13093. "✅",
  13094. "✈️",
  13095. "✉️",
  13096. "✊🏻",
  13097. "✊🏼",
  13098. "✊🏽",
  13099. "✊🏾",
  13100. "✊🏿",
  13101. "✊",
  13102. "✋🏻",
  13103. "✋🏼",
  13104. "✋🏽",
  13105. "✋🏾",
  13106. "✋🏿",
  13107. "✋",
  13108. "✌🏻",
  13109. "✌🏼",
  13110. "✌🏽",
  13111. "✌🏾",
  13112. "✌🏿",
  13113. "✌️",
  13114. "✍🏻",
  13115. "✍🏼",
  13116. "✍🏽",
  13117. "✍🏾",
  13118. "✍🏿",
  13119. "✍️",
  13120. "✏️",
  13121. "✒️",
  13122. "✔️",
  13123. "✖️",
  13124. "✝️",
  13125. "✡️",
  13126. "✨",
  13127. "✳️",
  13128. "✴️",
  13129. "❄️",
  13130. "❇️",
  13131. "❌",
  13132. "❎",
  13133. "❓",
  13134. "❔",
  13135. "❕",
  13136. "❗️",
  13137. "❣️",
  13138. "❤️",
  13139. "➕",
  13140. "➖",
  13141. "➗",
  13142. "➡️",
  13143. "➰",
  13144. "➿",
  13145. "⤴️",
  13146. "⤵️",
  13147. "*⃣",
  13148. "⬅️",
  13149. "⬆️",
  13150. "⬇️",
  13151. "⬛️",
  13152. "⬜️",
  13153. "⭐️",
  13154. "⭕️",
  13155. "0⃣",
  13156. "〰️",
  13157. "〽️",
  13158. "1⃣",
  13159. "2⃣",
  13160. "㊗️",
  13161. "㊙️",
  13162. "3⃣",
  13163. "4⃣",
  13164. "5⃣",
  13165. "6⃣",
  13166. "7⃣",
  13167. "8⃣",
  13168. "9⃣",
  13169. "©️",
  13170. "®️",
  13171. ""
  13172. ];
  13173. const path$1 = path$4;
  13174. const emojisList = emojisList$1;
  13175. const getHashDigest$1 = getHashDigest_1;
  13176. const emojiRegex = /[\uD800-\uDFFF]./;
  13177. const emojiList = emojisList.filter((emoji) => emojiRegex.test(emoji));
  13178. const emojiCache = {};
  13179. function encodeStringToEmoji(content, length) {
  13180. if (emojiCache[content]) {
  13181. return emojiCache[content];
  13182. }
  13183. length = length || 1;
  13184. const emojis = [];
  13185. do {
  13186. if (!emojiList.length) {
  13187. throw new Error('Ran out of emoji');
  13188. }
  13189. const index = Math.floor(Math.random() * emojiList.length);
  13190. emojis.push(emojiList[index]);
  13191. emojiList.splice(index, 1);
  13192. } while (--length > 0);
  13193. const emojiEncoding = emojis.join('');
  13194. emojiCache[content] = emojiEncoding;
  13195. return emojiEncoding;
  13196. }
  13197. function interpolateName$2(loaderContext, name, options) {
  13198. let filename;
  13199. const hasQuery =
  13200. loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1;
  13201. if (typeof name === 'function') {
  13202. filename = name(
  13203. loaderContext.resourcePath,
  13204. hasQuery ? loaderContext.resourceQuery : undefined
  13205. );
  13206. } else {
  13207. filename = name || '[hash].[ext]';
  13208. }
  13209. const context = options.context;
  13210. const content = options.content;
  13211. const regExp = options.regExp;
  13212. let ext = 'bin';
  13213. let basename = 'file';
  13214. let directory = '';
  13215. let folder = '';
  13216. let query = '';
  13217. if (loaderContext.resourcePath) {
  13218. const parsed = path$1.parse(loaderContext.resourcePath);
  13219. let resourcePath = loaderContext.resourcePath;
  13220. if (parsed.ext) {
  13221. ext = parsed.ext.substr(1);
  13222. }
  13223. if (parsed.dir) {
  13224. basename = parsed.name;
  13225. resourcePath = parsed.dir + path$1.sep;
  13226. }
  13227. if (typeof context !== 'undefined') {
  13228. directory = path$1
  13229. .relative(context, resourcePath + '_')
  13230. .replace(/\\/g, '/')
  13231. .replace(/\.\.(\/)?/g, '_$1');
  13232. directory = directory.substr(0, directory.length - 1);
  13233. } else {
  13234. directory = resourcePath.replace(/\\/g, '/').replace(/\.\.(\/)?/g, '_$1');
  13235. }
  13236. if (directory.length === 1) {
  13237. directory = '';
  13238. } else if (directory.length > 1) {
  13239. folder = path$1.basename(directory);
  13240. }
  13241. }
  13242. if (loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1) {
  13243. query = loaderContext.resourceQuery;
  13244. const hashIdx = query.indexOf('#');
  13245. if (hashIdx >= 0) {
  13246. query = query.substr(0, hashIdx);
  13247. }
  13248. }
  13249. let url = filename;
  13250. if (content) {
  13251. // Match hash template
  13252. url = url
  13253. // `hash` and `contenthash` are same in `loader-utils` context
  13254. // let's keep `hash` for backward compatibility
  13255. .replace(
  13256. /\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
  13257. (all, hashType, digestType, maxLength) =>
  13258. getHashDigest$1(content, hashType, digestType, parseInt(maxLength, 10))
  13259. )
  13260. .replace(/\[emoji(?::(\d+))?\]/gi, (all, length) =>
  13261. encodeStringToEmoji(content, parseInt(length, 10))
  13262. );
  13263. }
  13264. url = url
  13265. .replace(/\[ext\]/gi, () => ext)
  13266. .replace(/\[name\]/gi, () => basename)
  13267. .replace(/\[path\]/gi, () => directory)
  13268. .replace(/\[folder\]/gi, () => folder)
  13269. .replace(/\[query\]/gi, () => query);
  13270. if (regExp && loaderContext.resourcePath) {
  13271. const match = loaderContext.resourcePath.match(new RegExp(regExp));
  13272. match &&
  13273. match.forEach((matched, i) => {
  13274. url = url.replace(new RegExp('\\[' + i + '\\]', 'ig'), matched);
  13275. });
  13276. }
  13277. if (
  13278. typeof loaderContext.options === 'object' &&
  13279. typeof loaderContext.options.customInterpolateName === 'function'
  13280. ) {
  13281. url = loaderContext.options.customInterpolateName.call(
  13282. loaderContext,
  13283. url,
  13284. name,
  13285. options
  13286. );
  13287. }
  13288. return url;
  13289. }
  13290. var interpolateName_1 = interpolateName$2;
  13291. const getOptions = getOptions_1;
  13292. const parseQuery = parseQuery_1;
  13293. const stringifyRequest = stringifyRequest_1;
  13294. const getRemainingRequest = getRemainingRequest_1;
  13295. const getCurrentRequest = getCurrentRequest_1;
  13296. const isUrlRequest = isUrlRequest_1;
  13297. const urlToRequest = urlToRequest_1;
  13298. const parseString = parseString_1;
  13299. const getHashDigest = getHashDigest_1;
  13300. const interpolateName$1 = interpolateName_1;
  13301. lib$3.getOptions = getOptions;
  13302. lib$3.parseQuery = parseQuery;
  13303. lib$3.stringifyRequest = stringifyRequest;
  13304. lib$3.getRemainingRequest = getRemainingRequest;
  13305. lib$3.getCurrentRequest = getCurrentRequest;
  13306. lib$3.isUrlRequest = isUrlRequest;
  13307. lib$3.urlToRequest = urlToRequest;
  13308. lib$3.parseString = parseString;
  13309. lib$3.getHashDigest = getHashDigest;
  13310. lib$3.interpolateName = interpolateName$1;
  13311. var interpolateName = lib$3.interpolateName;
  13312. var path = path$4;
  13313. /**
  13314. * @param {string} pattern
  13315. * @param {object} options
  13316. * @param {string} options.context
  13317. * @param {string} options.hashPrefix
  13318. * @return {function}
  13319. */
  13320. var genericNames = function createGenerator(pattern, options) {
  13321. options = options || {};
  13322. var context =
  13323. options && typeof options.context === "string"
  13324. ? options.context
  13325. : process.cwd();
  13326. var hashPrefix =
  13327. options && typeof options.hashPrefix === "string" ? options.hashPrefix : "";
  13328. /**
  13329. * @param {string} localName Usually a class name
  13330. * @param {string} filepath Absolute path
  13331. * @return {string}
  13332. */
  13333. return function generate(localName, filepath) {
  13334. var name = pattern.replace(/\[local\]/gi, localName);
  13335. var loaderContext = {
  13336. resourcePath: filepath
  13337. };
  13338. var loaderOptions = {
  13339. content:
  13340. hashPrefix +
  13341. path.relative(context, filepath).replace(/\\/g, "/") +
  13342. "+" +
  13343. localName,
  13344. context: context
  13345. };
  13346. var genericName = interpolateName(loaderContext, name, loaderOptions);
  13347. return genericName
  13348. .replace(new RegExp("[^a-zA-Z0-9\\-_\u00A0-\uFFFF]", "g"), "-")
  13349. .replace(/^((-?[0-9])|--)/, "_$1");
  13350. };
  13351. };
  13352. var unquote$1 = {};
  13353. Object.defineProperty(unquote$1, "__esModule", {
  13354. value: true
  13355. });
  13356. unquote$1.default = unquote;
  13357. // copied from https://github.com/lakenen/node-unquote
  13358. var reg = /['"]/;
  13359. function unquote(str) {
  13360. if (!str) {
  13361. return "";
  13362. }
  13363. if (reg.test(str.charAt(0))) {
  13364. str = str.substr(1);
  13365. }
  13366. if (reg.test(str.charAt(str.length - 1))) {
  13367. str = str.substr(0, str.length - 1);
  13368. }
  13369. return str;
  13370. }
  13371. var parser = {};
  13372. var lib$1 = {};
  13373. Object.defineProperty(lib$1, "__esModule", {
  13374. value: true
  13375. });
  13376. lib$1.replaceAll = replaceAll;
  13377. var matchConstName = /[$#]?[\w-\.]+/g;
  13378. function replaceAll(replacements, text) {
  13379. var matches = void 0;
  13380. while (matches = matchConstName.exec(text)) {
  13381. var replacement = replacements[matches[0]];
  13382. if (replacement) {
  13383. text = text.slice(0, matches.index) + replacement + text.slice(matchConstName.lastIndex);
  13384. matchConstName.lastIndex -= matches[0].length - replacement.length;
  13385. }
  13386. }
  13387. return text;
  13388. }
  13389. lib$1.default = function (css, translations) {
  13390. css.walkDecls(function (decl) {
  13391. return decl.value = replaceAll(translations, decl.value);
  13392. });
  13393. css.walkAtRules('media', function (atRule) {
  13394. return atRule.params = replaceAll(translations, atRule.params);
  13395. });
  13396. };
  13397. Object.defineProperty(parser, "__esModule", {
  13398. value: true
  13399. });
  13400. var _icssReplaceSymbols = lib$1;
  13401. var _icssReplaceSymbols2 = _interopRequireDefault$4(_icssReplaceSymbols);
  13402. function _interopRequireDefault$4(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13403. // Copied from https://github.com/css-modules/css-modules-loader-core
  13404. const importRegexp = /^:import\((.+)\)$/;
  13405. class Parser {
  13406. constructor(pathFetcher, trace) {
  13407. this.pathFetcher = pathFetcher;
  13408. this.plugin = this.plugin.bind(this);
  13409. this.exportTokens = {};
  13410. this.translations = {};
  13411. this.trace = trace;
  13412. }
  13413. plugin() {
  13414. const parser = this;
  13415. return {
  13416. postcssPlugin: "css-modules-parser",
  13417. OnceExit(css) {
  13418. return Promise.all(parser.fetchAllImports(css)).then(() => parser.linkImportedSymbols(css)).then(() => parser.extractExports(css));
  13419. }
  13420. };
  13421. }
  13422. fetchAllImports(css) {
  13423. let imports = [];
  13424. css.each(node => {
  13425. if (node.type == "rule" && node.selector.match(importRegexp)) {
  13426. imports.push(this.fetchImport(node, css.source.input.from, imports.length));
  13427. }
  13428. });
  13429. return imports;
  13430. }
  13431. linkImportedSymbols(css) {
  13432. (0, _icssReplaceSymbols2.default)(css, this.translations);
  13433. }
  13434. extractExports(css) {
  13435. css.each(node => {
  13436. if (node.type == "rule" && node.selector == ":export") this.handleExport(node);
  13437. });
  13438. }
  13439. handleExport(exportNode) {
  13440. exportNode.each(decl => {
  13441. if (decl.type == "decl") {
  13442. Object.keys(this.translations).forEach(translation => {
  13443. decl.value = decl.value.replace(translation, this.translations[translation]);
  13444. });
  13445. this.exportTokens[decl.prop] = decl.value;
  13446. }
  13447. });
  13448. exportNode.remove();
  13449. }
  13450. fetchImport(importNode, relativeTo, depNr) {
  13451. let file = importNode.selector.match(importRegexp)[1],
  13452. depTrace = this.trace + String.fromCharCode(depNr);
  13453. return this.pathFetcher(file, relativeTo, depTrace).then(exports => {
  13454. importNode.each(decl => {
  13455. if (decl.type == "decl") {
  13456. this.translations[decl.prop] = exports[decl.value];
  13457. }
  13458. });
  13459. importNode.remove();
  13460. }, err => console.log(err));
  13461. }
  13462. }
  13463. parser.default = Parser;
  13464. var loader = {};
  13465. Object.defineProperty(loader, "__esModule", {
  13466. value: true
  13467. });
  13468. var _postcss$1 = require$$0$3;
  13469. var _postcss2$1 = _interopRequireDefault$3(_postcss$1);
  13470. var _fs$1 = require$$0$1;
  13471. var _fs2 = _interopRequireDefault$3(_fs$1);
  13472. var _path = path$4;
  13473. var _path2 = _interopRequireDefault$3(_path);
  13474. var _parser$1 = parser;
  13475. var _parser2$1 = _interopRequireDefault$3(_parser$1);
  13476. function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13477. // Copied from https://github.com/css-modules/css-modules-loader-core
  13478. class Core {
  13479. constructor(plugins) {
  13480. this.plugins = plugins || Core.defaultPlugins;
  13481. }
  13482. load(sourceString, sourcePath, trace, pathFetcher) {
  13483. let parser = new _parser2$1.default(pathFetcher, trace);
  13484. return (0, _postcss2$1.default)(this.plugins.concat([parser.plugin()])).process(sourceString, { from: "/" + sourcePath }).then(result => {
  13485. return {
  13486. injectableSource: result.css,
  13487. exportTokens: parser.exportTokens
  13488. };
  13489. });
  13490. }
  13491. }
  13492. // Sorts dependencies in the following way:
  13493. // AAA comes before AA and A
  13494. // AB comes after AA and before A
  13495. // All Bs come after all As
  13496. // This ensures that the files are always returned in the following order:
  13497. // - In the order they were required, except
  13498. // - After all their dependencies
  13499. const traceKeySorter = (a, b) => {
  13500. if (a.length < b.length) {
  13501. return a < b.substring(0, a.length) ? -1 : 1;
  13502. } else if (a.length > b.length) {
  13503. return a.substring(0, b.length) <= b ? -1 : 1;
  13504. } else {
  13505. return a < b ? -1 : 1;
  13506. }
  13507. };
  13508. class FileSystemLoader {
  13509. constructor(root, plugins) {
  13510. this.root = root;
  13511. this.sources = {};
  13512. this.traces = {};
  13513. this.importNr = 0;
  13514. this.core = new Core(plugins);
  13515. this.tokensByFile = {};
  13516. }
  13517. fetch(_newPath, relativeTo, _trace) {
  13518. let newPath = _newPath.replace(/^["']|["']$/g, ""),
  13519. trace = _trace || String.fromCharCode(this.importNr++);
  13520. return new Promise((resolve, reject) => {
  13521. let relativeDir = _path2.default.dirname(relativeTo),
  13522. rootRelativePath = _path2.default.resolve(relativeDir, newPath),
  13523. fileRelativePath = _path2.default.resolve(_path2.default.join(this.root, relativeDir), newPath);
  13524. // if the path is not relative or absolute, try to resolve it in node_modules
  13525. if (newPath[0] !== "." && newPath[0] !== "/") {
  13526. try {
  13527. fileRelativePath = require.resolve(newPath);
  13528. } catch (e) {
  13529. // noop
  13530. }
  13531. }
  13532. const tokens = this.tokensByFile[fileRelativePath];
  13533. if (tokens) {
  13534. return resolve(tokens);
  13535. }
  13536. _fs2.default.readFile(fileRelativePath, "utf-8", (err, source) => {
  13537. if (err) reject(err);
  13538. this.core.load(source, rootRelativePath, trace, this.fetch.bind(this)).then(({ injectableSource, exportTokens }) => {
  13539. this.sources[fileRelativePath] = injectableSource;
  13540. this.traces[trace] = fileRelativePath;
  13541. this.tokensByFile[fileRelativePath] = exportTokens;
  13542. resolve(exportTokens);
  13543. }, reject);
  13544. });
  13545. });
  13546. }
  13547. get finalSource() {
  13548. const traces = this.traces;
  13549. const sources = this.sources;
  13550. let written = new Set();
  13551. return Object.keys(traces).sort(traceKeySorter).map(key => {
  13552. const filename = traces[key];
  13553. if (written.has(filename)) {
  13554. return null;
  13555. }
  13556. written.add(filename);
  13557. return sources[filename];
  13558. }).join("");
  13559. }
  13560. }
  13561. loader.default = FileSystemLoader;
  13562. var generateScopedName$1 = {};
  13563. function hash(str) {
  13564. var hash = 5381,
  13565. i = str.length;
  13566. while(i) {
  13567. hash = (hash * 33) ^ str.charCodeAt(--i);
  13568. }
  13569. /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
  13570. * integers. Since we want the results to be always positive, convert the
  13571. * signed int to an unsigned by doing an unsigned bitshift. */
  13572. return hash >>> 0;
  13573. }
  13574. var stringHash = hash;
  13575. Object.defineProperty(generateScopedName$1, "__esModule", {
  13576. value: true
  13577. });
  13578. generateScopedName$1.default = generateScopedName;
  13579. var _stringHash = stringHash;
  13580. var _stringHash2 = _interopRequireDefault$2(_stringHash);
  13581. function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13582. function generateScopedName(name, filename, css) {
  13583. const i = css.indexOf(`.${name}`);
  13584. const lineNumber = css.substr(0, i).split(/[\r\n]/).length;
  13585. const hash = (0, _stringHash2.default)(css).toString(36).substr(0, 5);
  13586. return `_${name}_${hash}_${lineNumber}`;
  13587. }
  13588. var saveJSON$1 = {};
  13589. Object.defineProperty(saveJSON$1, "__esModule", {
  13590. value: true
  13591. });
  13592. saveJSON$1.default = saveJSON;
  13593. var _fs = require$$0$1;
  13594. function saveJSON(cssFile, json) {
  13595. return new Promise((resolve, reject) => {
  13596. (0, _fs.writeFile)(`${cssFile}.json`, JSON.stringify(json), e => e ? reject(e) : resolve(json));
  13597. });
  13598. }
  13599. var behaviours$1 = {};
  13600. var src$4 = {exports: {}};
  13601. var openParentheses = "(".charCodeAt(0);
  13602. var closeParentheses = ")".charCodeAt(0);
  13603. var singleQuote = "'".charCodeAt(0);
  13604. var doubleQuote = '"'.charCodeAt(0);
  13605. var backslash = "\\".charCodeAt(0);
  13606. var slash = "/".charCodeAt(0);
  13607. var comma = ",".charCodeAt(0);
  13608. var colon = ":".charCodeAt(0);
  13609. var star = "*".charCodeAt(0);
  13610. var uLower = "u".charCodeAt(0);
  13611. var uUpper = "U".charCodeAt(0);
  13612. var plus = "+".charCodeAt(0);
  13613. var isUnicodeRange = /^[a-f0-9?-]+$/i;
  13614. var parse$1 = function(input) {
  13615. var tokens = [];
  13616. var value = input;
  13617. var next,
  13618. quote,
  13619. prev,
  13620. token,
  13621. escape,
  13622. escapePos,
  13623. whitespacePos,
  13624. parenthesesOpenPos;
  13625. var pos = 0;
  13626. var code = value.charCodeAt(pos);
  13627. var max = value.length;
  13628. var stack = [{ nodes: tokens }];
  13629. var balanced = 0;
  13630. var parent;
  13631. var name = "";
  13632. var before = "";
  13633. var after = "";
  13634. while (pos < max) {
  13635. // Whitespaces
  13636. if (code <= 32) {
  13637. next = pos;
  13638. do {
  13639. next += 1;
  13640. code = value.charCodeAt(next);
  13641. } while (code <= 32);
  13642. token = value.slice(pos, next);
  13643. prev = tokens[tokens.length - 1];
  13644. if (code === closeParentheses && balanced) {
  13645. after = token;
  13646. } else if (prev && prev.type === "div") {
  13647. prev.after = token;
  13648. prev.sourceEndIndex += token.length;
  13649. } else if (
  13650. code === comma ||
  13651. code === colon ||
  13652. (code === slash &&
  13653. value.charCodeAt(next + 1) !== star &&
  13654. (!parent ||
  13655. (parent && parent.type === "function" && parent.value !== "calc")))
  13656. ) {
  13657. before = token;
  13658. } else {
  13659. tokens.push({
  13660. type: "space",
  13661. sourceIndex: pos,
  13662. sourceEndIndex: next,
  13663. value: token
  13664. });
  13665. }
  13666. pos = next;
  13667. // Quotes
  13668. } else if (code === singleQuote || code === doubleQuote) {
  13669. next = pos;
  13670. quote = code === singleQuote ? "'" : '"';
  13671. token = {
  13672. type: "string",
  13673. sourceIndex: pos,
  13674. quote: quote
  13675. };
  13676. do {
  13677. escape = false;
  13678. next = value.indexOf(quote, next + 1);
  13679. if (~next) {
  13680. escapePos = next;
  13681. while (value.charCodeAt(escapePos - 1) === backslash) {
  13682. escapePos -= 1;
  13683. escape = !escape;
  13684. }
  13685. } else {
  13686. value += quote;
  13687. next = value.length - 1;
  13688. token.unclosed = true;
  13689. }
  13690. } while (escape);
  13691. token.value = value.slice(pos + 1, next);
  13692. token.sourceEndIndex = token.unclosed ? next : next + 1;
  13693. tokens.push(token);
  13694. pos = next + 1;
  13695. code = value.charCodeAt(pos);
  13696. // Comments
  13697. } else if (code === slash && value.charCodeAt(pos + 1) === star) {
  13698. next = value.indexOf("*/", pos);
  13699. token = {
  13700. type: "comment",
  13701. sourceIndex: pos,
  13702. sourceEndIndex: next + 2
  13703. };
  13704. if (next === -1) {
  13705. token.unclosed = true;
  13706. next = value.length;
  13707. token.sourceEndIndex = next;
  13708. }
  13709. token.value = value.slice(pos + 2, next);
  13710. tokens.push(token);
  13711. pos = next + 2;
  13712. code = value.charCodeAt(pos);
  13713. // Operation within calc
  13714. } else if (
  13715. (code === slash || code === star) &&
  13716. parent &&
  13717. parent.type === "function" &&
  13718. parent.value === "calc"
  13719. ) {
  13720. token = value[pos];
  13721. tokens.push({
  13722. type: "word",
  13723. sourceIndex: pos - before.length,
  13724. sourceEndIndex: pos + token.length,
  13725. value: token
  13726. });
  13727. pos += 1;
  13728. code = value.charCodeAt(pos);
  13729. // Dividers
  13730. } else if (code === slash || code === comma || code === colon) {
  13731. token = value[pos];
  13732. tokens.push({
  13733. type: "div",
  13734. sourceIndex: pos - before.length,
  13735. sourceEndIndex: pos + token.length,
  13736. value: token,
  13737. before: before,
  13738. after: ""
  13739. });
  13740. before = "";
  13741. pos += 1;
  13742. code = value.charCodeAt(pos);
  13743. // Open parentheses
  13744. } else if (openParentheses === code) {
  13745. // Whitespaces after open parentheses
  13746. next = pos;
  13747. do {
  13748. next += 1;
  13749. code = value.charCodeAt(next);
  13750. } while (code <= 32);
  13751. parenthesesOpenPos = pos;
  13752. token = {
  13753. type: "function",
  13754. sourceIndex: pos - name.length,
  13755. value: name,
  13756. before: value.slice(parenthesesOpenPos + 1, next)
  13757. };
  13758. pos = next;
  13759. if (name === "url" && code !== singleQuote && code !== doubleQuote) {
  13760. next -= 1;
  13761. do {
  13762. escape = false;
  13763. next = value.indexOf(")", next + 1);
  13764. if (~next) {
  13765. escapePos = next;
  13766. while (value.charCodeAt(escapePos - 1) === backslash) {
  13767. escapePos -= 1;
  13768. escape = !escape;
  13769. }
  13770. } else {
  13771. value += ")";
  13772. next = value.length - 1;
  13773. token.unclosed = true;
  13774. }
  13775. } while (escape);
  13776. // Whitespaces before closed
  13777. whitespacePos = next;
  13778. do {
  13779. whitespacePos -= 1;
  13780. code = value.charCodeAt(whitespacePos);
  13781. } while (code <= 32);
  13782. if (parenthesesOpenPos < whitespacePos) {
  13783. if (pos !== whitespacePos + 1) {
  13784. token.nodes = [
  13785. {
  13786. type: "word",
  13787. sourceIndex: pos,
  13788. sourceEndIndex: whitespacePos + 1,
  13789. value: value.slice(pos, whitespacePos + 1)
  13790. }
  13791. ];
  13792. } else {
  13793. token.nodes = [];
  13794. }
  13795. if (token.unclosed && whitespacePos + 1 !== next) {
  13796. token.after = "";
  13797. token.nodes.push({
  13798. type: "space",
  13799. sourceIndex: whitespacePos + 1,
  13800. sourceEndIndex: next,
  13801. value: value.slice(whitespacePos + 1, next)
  13802. });
  13803. } else {
  13804. token.after = value.slice(whitespacePos + 1, next);
  13805. token.sourceEndIndex = next;
  13806. }
  13807. } else {
  13808. token.after = "";
  13809. token.nodes = [];
  13810. }
  13811. pos = next + 1;
  13812. token.sourceEndIndex = token.unclosed ? next : pos;
  13813. code = value.charCodeAt(pos);
  13814. tokens.push(token);
  13815. } else {
  13816. balanced += 1;
  13817. token.after = "";
  13818. token.sourceEndIndex = pos + 1;
  13819. tokens.push(token);
  13820. stack.push(token);
  13821. tokens = token.nodes = [];
  13822. parent = token;
  13823. }
  13824. name = "";
  13825. // Close parentheses
  13826. } else if (closeParentheses === code && balanced) {
  13827. pos += 1;
  13828. code = value.charCodeAt(pos);
  13829. parent.after = after;
  13830. parent.sourceEndIndex += after.length;
  13831. after = "";
  13832. balanced -= 1;
  13833. stack[stack.length - 1].sourceEndIndex = pos;
  13834. stack.pop();
  13835. parent = stack[balanced];
  13836. tokens = parent.nodes;
  13837. // Words
  13838. } else {
  13839. next = pos;
  13840. do {
  13841. if (code === backslash) {
  13842. next += 1;
  13843. }
  13844. next += 1;
  13845. code = value.charCodeAt(next);
  13846. } while (
  13847. next < max &&
  13848. !(
  13849. code <= 32 ||
  13850. code === singleQuote ||
  13851. code === doubleQuote ||
  13852. code === comma ||
  13853. code === colon ||
  13854. code === slash ||
  13855. code === openParentheses ||
  13856. (code === star &&
  13857. parent &&
  13858. parent.type === "function" &&
  13859. parent.value === "calc") ||
  13860. (code === slash &&
  13861. parent.type === "function" &&
  13862. parent.value === "calc") ||
  13863. (code === closeParentheses && balanced)
  13864. )
  13865. );
  13866. token = value.slice(pos, next);
  13867. if (openParentheses === code) {
  13868. name = token;
  13869. } else if (
  13870. (uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
  13871. plus === token.charCodeAt(1) &&
  13872. isUnicodeRange.test(token.slice(2))
  13873. ) {
  13874. tokens.push({
  13875. type: "unicode-range",
  13876. sourceIndex: pos,
  13877. sourceEndIndex: next,
  13878. value: token
  13879. });
  13880. } else {
  13881. tokens.push({
  13882. type: "word",
  13883. sourceIndex: pos,
  13884. sourceEndIndex: next,
  13885. value: token
  13886. });
  13887. }
  13888. pos = next;
  13889. }
  13890. }
  13891. for (pos = stack.length - 1; pos; pos -= 1) {
  13892. stack[pos].unclosed = true;
  13893. stack[pos].sourceEndIndex = value.length;
  13894. }
  13895. return stack[0].nodes;
  13896. };
  13897. var walk$2 = function walk(nodes, cb, bubble) {
  13898. var i, max, node, result;
  13899. for (i = 0, max = nodes.length; i < max; i += 1) {
  13900. node = nodes[i];
  13901. if (!bubble) {
  13902. result = cb(node, i, nodes);
  13903. }
  13904. if (
  13905. result !== false &&
  13906. node.type === "function" &&
  13907. Array.isArray(node.nodes)
  13908. ) {
  13909. walk(node.nodes, cb, bubble);
  13910. }
  13911. if (bubble) {
  13912. cb(node, i, nodes);
  13913. }
  13914. }
  13915. };
  13916. function stringifyNode(node, custom) {
  13917. var type = node.type;
  13918. var value = node.value;
  13919. var buf;
  13920. var customResult;
  13921. if (custom && (customResult = custom(node)) !== undefined) {
  13922. return customResult;
  13923. } else if (type === "word" || type === "space") {
  13924. return value;
  13925. } else if (type === "string") {
  13926. buf = node.quote || "";
  13927. return buf + value + (node.unclosed ? "" : buf);
  13928. } else if (type === "comment") {
  13929. return "/*" + value + (node.unclosed ? "" : "*/");
  13930. } else if (type === "div") {
  13931. return (node.before || "") + value + (node.after || "");
  13932. } else if (Array.isArray(node.nodes)) {
  13933. buf = stringify$1(node.nodes, custom);
  13934. if (type !== "function") {
  13935. return buf;
  13936. }
  13937. return (
  13938. value +
  13939. "(" +
  13940. (node.before || "") +
  13941. buf +
  13942. (node.after || "") +
  13943. (node.unclosed ? "" : ")")
  13944. );
  13945. }
  13946. return value;
  13947. }
  13948. function stringify$1(nodes, custom) {
  13949. var result, i;
  13950. if (Array.isArray(nodes)) {
  13951. result = "";
  13952. for (i = nodes.length - 1; ~i; i -= 1) {
  13953. result = stringifyNode(nodes[i], custom) + result;
  13954. }
  13955. return result;
  13956. }
  13957. return stringifyNode(nodes, custom);
  13958. }
  13959. var stringify_1 = stringify$1;
  13960. var unit;
  13961. var hasRequiredUnit;
  13962. function requireUnit () {
  13963. if (hasRequiredUnit) return unit;
  13964. hasRequiredUnit = 1;
  13965. var minus = "-".charCodeAt(0);
  13966. var plus = "+".charCodeAt(0);
  13967. var dot = ".".charCodeAt(0);
  13968. var exp = "e".charCodeAt(0);
  13969. var EXP = "E".charCodeAt(0);
  13970. // Check if three code points would start a number
  13971. // https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
  13972. function likeNumber(value) {
  13973. var code = value.charCodeAt(0);
  13974. var nextCode;
  13975. if (code === plus || code === minus) {
  13976. nextCode = value.charCodeAt(1);
  13977. if (nextCode >= 48 && nextCode <= 57) {
  13978. return true;
  13979. }
  13980. var nextNextCode = value.charCodeAt(2);
  13981. if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
  13982. return true;
  13983. }
  13984. return false;
  13985. }
  13986. if (code === dot) {
  13987. nextCode = value.charCodeAt(1);
  13988. if (nextCode >= 48 && nextCode <= 57) {
  13989. return true;
  13990. }
  13991. return false;
  13992. }
  13993. if (code >= 48 && code <= 57) {
  13994. return true;
  13995. }
  13996. return false;
  13997. }
  13998. // Consume a number
  13999. // https://www.w3.org/TR/css-syntax-3/#consume-number
  14000. unit = function(value) {
  14001. var pos = 0;
  14002. var length = value.length;
  14003. var code;
  14004. var nextCode;
  14005. var nextNextCode;
  14006. if (length === 0 || !likeNumber(value)) {
  14007. return false;
  14008. }
  14009. code = value.charCodeAt(pos);
  14010. if (code === plus || code === minus) {
  14011. pos++;
  14012. }
  14013. while (pos < length) {
  14014. code = value.charCodeAt(pos);
  14015. if (code < 48 || code > 57) {
  14016. break;
  14017. }
  14018. pos += 1;
  14019. }
  14020. code = value.charCodeAt(pos);
  14021. nextCode = value.charCodeAt(pos + 1);
  14022. if (code === dot && nextCode >= 48 && nextCode <= 57) {
  14023. pos += 2;
  14024. while (pos < length) {
  14025. code = value.charCodeAt(pos);
  14026. if (code < 48 || code > 57) {
  14027. break;
  14028. }
  14029. pos += 1;
  14030. }
  14031. }
  14032. code = value.charCodeAt(pos);
  14033. nextCode = value.charCodeAt(pos + 1);
  14034. nextNextCode = value.charCodeAt(pos + 2);
  14035. if (
  14036. (code === exp || code === EXP) &&
  14037. ((nextCode >= 48 && nextCode <= 57) ||
  14038. ((nextCode === plus || nextCode === minus) &&
  14039. nextNextCode >= 48 &&
  14040. nextNextCode <= 57))
  14041. ) {
  14042. pos += nextCode === plus || nextCode === minus ? 3 : 2;
  14043. while (pos < length) {
  14044. code = value.charCodeAt(pos);
  14045. if (code < 48 || code > 57) {
  14046. break;
  14047. }
  14048. pos += 1;
  14049. }
  14050. }
  14051. return {
  14052. number: value.slice(0, pos),
  14053. unit: value.slice(pos)
  14054. };
  14055. };
  14056. return unit;
  14057. }
  14058. var parse = parse$1;
  14059. var walk$1 = walk$2;
  14060. var stringify = stringify_1;
  14061. function ValueParser(value) {
  14062. if (this instanceof ValueParser) {
  14063. this.nodes = parse(value);
  14064. return this;
  14065. }
  14066. return new ValueParser(value);
  14067. }
  14068. ValueParser.prototype.toString = function() {
  14069. return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
  14070. };
  14071. ValueParser.prototype.walk = function(cb, bubble) {
  14072. walk$1(this.nodes, cb, bubble);
  14073. return this;
  14074. };
  14075. ValueParser.unit = requireUnit();
  14076. ValueParser.walk = walk$1;
  14077. ValueParser.stringify = stringify;
  14078. var lib = ValueParser;
  14079. const matchValueName = /[$]?[\w-]+/g;
  14080. const replaceValueSymbols$2 = (value, replacements) => {
  14081. let matches;
  14082. while ((matches = matchValueName.exec(value))) {
  14083. const replacement = replacements[matches[0]];
  14084. if (replacement) {
  14085. value =
  14086. value.slice(0, matches.index) +
  14087. replacement +
  14088. value.slice(matchValueName.lastIndex);
  14089. matchValueName.lastIndex -= matches[0].length - replacement.length;
  14090. }
  14091. }
  14092. return value;
  14093. };
  14094. var replaceValueSymbols_1 = replaceValueSymbols$2;
  14095. const replaceValueSymbols$1 = replaceValueSymbols_1;
  14096. const replaceSymbols$1 = (css, replacements) => {
  14097. css.walk((node) => {
  14098. if (node.type === "decl" && node.value) {
  14099. node.value = replaceValueSymbols$1(node.value.toString(), replacements);
  14100. } else if (node.type === "rule" && node.selector) {
  14101. node.selector = replaceValueSymbols$1(
  14102. node.selector.toString(),
  14103. replacements
  14104. );
  14105. } else if (node.type === "atrule" && node.params) {
  14106. node.params = replaceValueSymbols$1(node.params.toString(), replacements);
  14107. }
  14108. });
  14109. };
  14110. var replaceSymbols_1 = replaceSymbols$1;
  14111. const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;
  14112. const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/;
  14113. const getDeclsObject = (rule) => {
  14114. const object = {};
  14115. rule.walkDecls((decl) => {
  14116. const before = decl.raws.before ? decl.raws.before.trim() : "";
  14117. object[before + decl.prop] = decl.value;
  14118. });
  14119. return object;
  14120. };
  14121. /**
  14122. *
  14123. * @param {string} css
  14124. * @param {boolean} removeRules
  14125. * @param {'auto' | 'rule' | 'at-rule'} mode
  14126. */
  14127. const extractICSS$2 = (css, removeRules = true, mode = "auto") => {
  14128. const icssImports = {};
  14129. const icssExports = {};
  14130. function addImports(node, path) {
  14131. const unquoted = path.replace(/'|"/g, "");
  14132. icssImports[unquoted] = Object.assign(
  14133. icssImports[unquoted] || {},
  14134. getDeclsObject(node)
  14135. );
  14136. if (removeRules) {
  14137. node.remove();
  14138. }
  14139. }
  14140. function addExports(node) {
  14141. Object.assign(icssExports, getDeclsObject(node));
  14142. if (removeRules) {
  14143. node.remove();
  14144. }
  14145. }
  14146. css.each((node) => {
  14147. if (node.type === "rule" && mode !== "at-rule") {
  14148. if (node.selector.slice(0, 7) === ":import") {
  14149. const matches = importPattern.exec(node.selector);
  14150. if (matches) {
  14151. addImports(node, matches[1]);
  14152. }
  14153. }
  14154. if (node.selector === ":export") {
  14155. addExports(node);
  14156. }
  14157. }
  14158. if (node.type === "atrule" && mode !== "rule") {
  14159. if (node.name === "icss-import") {
  14160. const matches = balancedQuotes.exec(node.params);
  14161. if (matches) {
  14162. addImports(node, matches[1]);
  14163. }
  14164. }
  14165. if (node.name === "icss-export") {
  14166. addExports(node);
  14167. }
  14168. }
  14169. });
  14170. return { icssImports, icssExports };
  14171. };
  14172. var extractICSS_1 = extractICSS$2;
  14173. const createImports = (imports, postcss, mode = "rule") => {
  14174. return Object.keys(imports).map((path) => {
  14175. const aliases = imports[path];
  14176. const declarations = Object.keys(aliases).map((key) =>
  14177. postcss.decl({
  14178. prop: key,
  14179. value: aliases[key],
  14180. raws: { before: "\n " },
  14181. })
  14182. );
  14183. const hasDeclarations = declarations.length > 0;
  14184. const rule =
  14185. mode === "rule"
  14186. ? postcss.rule({
  14187. selector: `:import('${path}')`,
  14188. raws: { after: hasDeclarations ? "\n" : "" },
  14189. })
  14190. : postcss.atRule({
  14191. name: "icss-import",
  14192. params: `'${path}'`,
  14193. raws: { after: hasDeclarations ? "\n" : "" },
  14194. });
  14195. if (hasDeclarations) {
  14196. rule.append(declarations);
  14197. }
  14198. return rule;
  14199. });
  14200. };
  14201. const createExports = (exports, postcss, mode = "rule") => {
  14202. const declarations = Object.keys(exports).map((key) =>
  14203. postcss.decl({
  14204. prop: key,
  14205. value: exports[key],
  14206. raws: { before: "\n " },
  14207. })
  14208. );
  14209. if (declarations.length === 0) {
  14210. return [];
  14211. }
  14212. const rule =
  14213. mode === "rule"
  14214. ? postcss.rule({
  14215. selector: `:export`,
  14216. raws: { after: "\n" },
  14217. })
  14218. : postcss.atRule({
  14219. name: "icss-export",
  14220. raws: { after: "\n" },
  14221. });
  14222. rule.append(declarations);
  14223. return [rule];
  14224. };
  14225. const createICSSRules$1 = (imports, exports, postcss, mode) => [
  14226. ...createImports(imports, postcss, mode),
  14227. ...createExports(exports, postcss, mode),
  14228. ];
  14229. var createICSSRules_1 = createICSSRules$1;
  14230. const replaceValueSymbols = replaceValueSymbols_1;
  14231. const replaceSymbols = replaceSymbols_1;
  14232. const extractICSS$1 = extractICSS_1;
  14233. const createICSSRules = createICSSRules_1;
  14234. var src$3 = {
  14235. replaceValueSymbols,
  14236. replaceSymbols,
  14237. extractICSS: extractICSS$1,
  14238. createICSSRules,
  14239. };
  14240. const selectorParser$1 = dist.exports;
  14241. const valueParser = lib;
  14242. const { extractICSS } = src$3;
  14243. const isSpacing = (node) => node.type === "combinator" && node.value === " ";
  14244. function normalizeNodeArray(nodes) {
  14245. const array = [];
  14246. nodes.forEach((x) => {
  14247. if (Array.isArray(x)) {
  14248. normalizeNodeArray(x).forEach((item) => {
  14249. array.push(item);
  14250. });
  14251. } else if (x) {
  14252. array.push(x);
  14253. }
  14254. });
  14255. if (array.length > 0 && isSpacing(array[array.length - 1])) {
  14256. array.pop();
  14257. }
  14258. return array;
  14259. }
  14260. function localizeNode(rule, mode, localAliasMap) {
  14261. const transform = (node, context) => {
  14262. if (context.ignoreNextSpacing && !isSpacing(node)) {
  14263. throw new Error("Missing whitespace after " + context.ignoreNextSpacing);
  14264. }
  14265. if (context.enforceNoSpacing && isSpacing(node)) {
  14266. throw new Error("Missing whitespace before " + context.enforceNoSpacing);
  14267. }
  14268. let newNodes;
  14269. switch (node.type) {
  14270. case "root": {
  14271. let resultingGlobal;
  14272. context.hasPureGlobals = false;
  14273. newNodes = node.nodes.map((n) => {
  14274. const nContext = {
  14275. global: context.global,
  14276. lastWasSpacing: true,
  14277. hasLocals: false,
  14278. explicit: false,
  14279. };
  14280. n = transform(n, nContext);
  14281. if (typeof resultingGlobal === "undefined") {
  14282. resultingGlobal = nContext.global;
  14283. } else if (resultingGlobal !== nContext.global) {
  14284. throw new Error(
  14285. 'Inconsistent rule global/local result in rule "' +
  14286. node +
  14287. '" (multiple selectors must result in the same mode for the rule)'
  14288. );
  14289. }
  14290. if (!nContext.hasLocals) {
  14291. context.hasPureGlobals = true;
  14292. }
  14293. return n;
  14294. });
  14295. context.global = resultingGlobal;
  14296. node.nodes = normalizeNodeArray(newNodes);
  14297. break;
  14298. }
  14299. case "selector": {
  14300. newNodes = node.map((childNode) => transform(childNode, context));
  14301. node = node.clone();
  14302. node.nodes = normalizeNodeArray(newNodes);
  14303. break;
  14304. }
  14305. case "combinator": {
  14306. if (isSpacing(node)) {
  14307. if (context.ignoreNextSpacing) {
  14308. context.ignoreNextSpacing = false;
  14309. context.lastWasSpacing = false;
  14310. context.enforceNoSpacing = false;
  14311. return null;
  14312. }
  14313. context.lastWasSpacing = true;
  14314. return node;
  14315. }
  14316. break;
  14317. }
  14318. case "pseudo": {
  14319. let childContext;
  14320. const isNested = !!node.length;
  14321. const isScoped = node.value === ":local" || node.value === ":global";
  14322. const isImportExport =
  14323. node.value === ":import" || node.value === ":export";
  14324. if (isImportExport) {
  14325. context.hasLocals = true;
  14326. // :local(.foo)
  14327. } else if (isNested) {
  14328. if (isScoped) {
  14329. if (node.nodes.length === 0) {
  14330. throw new Error(`${node.value}() can't be empty`);
  14331. }
  14332. if (context.inside) {
  14333. throw new Error(
  14334. `A ${node.value} is not allowed inside of a ${context.inside}(...)`
  14335. );
  14336. }
  14337. childContext = {
  14338. global: node.value === ":global",
  14339. inside: node.value,
  14340. hasLocals: false,
  14341. explicit: true,
  14342. };
  14343. newNodes = node
  14344. .map((childNode) => transform(childNode, childContext))
  14345. .reduce((acc, next) => acc.concat(next.nodes), []);
  14346. if (newNodes.length) {
  14347. const { before, after } = node.spaces;
  14348. const first = newNodes[0];
  14349. const last = newNodes[newNodes.length - 1];
  14350. first.spaces = { before, after: first.spaces.after };
  14351. last.spaces = { before: last.spaces.before, after };
  14352. }
  14353. node = newNodes;
  14354. break;
  14355. } else {
  14356. childContext = {
  14357. global: context.global,
  14358. inside: context.inside,
  14359. lastWasSpacing: true,
  14360. hasLocals: false,
  14361. explicit: context.explicit,
  14362. };
  14363. newNodes = node.map((childNode) =>
  14364. transform(childNode, childContext)
  14365. );
  14366. node = node.clone();
  14367. node.nodes = normalizeNodeArray(newNodes);
  14368. if (childContext.hasLocals) {
  14369. context.hasLocals = true;
  14370. }
  14371. }
  14372. break;
  14373. //:local .foo .bar
  14374. } else if (isScoped) {
  14375. if (context.inside) {
  14376. throw new Error(
  14377. `A ${node.value} is not allowed inside of a ${context.inside}(...)`
  14378. );
  14379. }
  14380. const addBackSpacing = !!node.spaces.before;
  14381. context.ignoreNextSpacing = context.lastWasSpacing
  14382. ? node.value
  14383. : false;
  14384. context.enforceNoSpacing = context.lastWasSpacing
  14385. ? false
  14386. : node.value;
  14387. context.global = node.value === ":global";
  14388. context.explicit = true;
  14389. // because this node has spacing that is lost when we remove it
  14390. // we make up for it by adding an extra combinator in since adding
  14391. // spacing on the parent selector doesn't work
  14392. return addBackSpacing
  14393. ? selectorParser$1.combinator({ value: " " })
  14394. : null;
  14395. }
  14396. break;
  14397. }
  14398. case "id":
  14399. case "class": {
  14400. if (!node.value) {
  14401. throw new Error("Invalid class or id selector syntax");
  14402. }
  14403. if (context.global) {
  14404. break;
  14405. }
  14406. const isImportedValue = localAliasMap.has(node.value);
  14407. const isImportedWithExplicitScope = isImportedValue && context.explicit;
  14408. if (!isImportedValue || isImportedWithExplicitScope) {
  14409. const innerNode = node.clone();
  14410. innerNode.spaces = { before: "", after: "" };
  14411. node = selectorParser$1.pseudo({
  14412. value: ":local",
  14413. nodes: [innerNode],
  14414. spaces: node.spaces,
  14415. });
  14416. context.hasLocals = true;
  14417. }
  14418. break;
  14419. }
  14420. }
  14421. context.lastWasSpacing = false;
  14422. context.ignoreNextSpacing = false;
  14423. context.enforceNoSpacing = false;
  14424. return node;
  14425. };
  14426. const rootContext = {
  14427. global: mode === "global",
  14428. hasPureGlobals: false,
  14429. };
  14430. rootContext.selector = selectorParser$1((root) => {
  14431. transform(root, rootContext);
  14432. }).processSync(rule, { updateSelector: false, lossless: true });
  14433. return rootContext;
  14434. }
  14435. function localizeDeclNode(node, context) {
  14436. switch (node.type) {
  14437. case "word":
  14438. if (context.localizeNextItem) {
  14439. if (!context.localAliasMap.has(node.value)) {
  14440. node.value = ":local(" + node.value + ")";
  14441. context.localizeNextItem = false;
  14442. }
  14443. }
  14444. break;
  14445. case "function":
  14446. if (
  14447. context.options &&
  14448. context.options.rewriteUrl &&
  14449. node.value.toLowerCase() === "url"
  14450. ) {
  14451. node.nodes.map((nestedNode) => {
  14452. if (nestedNode.type !== "string" && nestedNode.type !== "word") {
  14453. return;
  14454. }
  14455. let newUrl = context.options.rewriteUrl(
  14456. context.global,
  14457. nestedNode.value
  14458. );
  14459. switch (nestedNode.type) {
  14460. case "string":
  14461. if (nestedNode.quote === "'") {
  14462. newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/'/g, "\\'");
  14463. }
  14464. if (nestedNode.quote === '"') {
  14465. newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/"/g, '\\"');
  14466. }
  14467. break;
  14468. case "word":
  14469. newUrl = newUrl.replace(/("|'|\)|\\)/g, "\\$1");
  14470. break;
  14471. }
  14472. nestedNode.value = newUrl;
  14473. });
  14474. }
  14475. break;
  14476. }
  14477. return node;
  14478. }
  14479. function isWordAFunctionArgument(wordNode, functionNode) {
  14480. return functionNode
  14481. ? functionNode.nodes.some(
  14482. (functionNodeChild) =>
  14483. functionNodeChild.sourceIndex === wordNode.sourceIndex
  14484. )
  14485. : false;
  14486. }
  14487. function localizeDeclarationValues(localize, declaration, context) {
  14488. const valueNodes = valueParser(declaration.value);
  14489. valueNodes.walk((node, index, nodes) => {
  14490. const subContext = {
  14491. options: context.options,
  14492. global: context.global,
  14493. localizeNextItem: localize && !context.global,
  14494. localAliasMap: context.localAliasMap,
  14495. };
  14496. nodes[index] = localizeDeclNode(node, subContext);
  14497. });
  14498. declaration.value = valueNodes.toString();
  14499. }
  14500. function localizeDeclaration(declaration, context) {
  14501. const isAnimation = /animation$/i.test(declaration.prop);
  14502. if (isAnimation) {
  14503. const validIdent = /^-?[_a-z][_a-z0-9-]*$/i;
  14504. /*
  14505. The spec defines some keywords that you can use to describe properties such as the timing
  14506. function. These are still valid animation names, so as long as there is a property that accepts
  14507. a keyword, it is given priority. Only when all the properties that can take a keyword are
  14508. exhausted can the animation name be set to the keyword. I.e.
  14509. animation: infinite infinite;
  14510. The animation will repeat an infinite number of times from the first argument, and will have an
  14511. animation name of infinite from the second.
  14512. */
  14513. const animationKeywords = {
  14514. $alternate: 1,
  14515. "$alternate-reverse": 1,
  14516. $backwards: 1,
  14517. $both: 1,
  14518. $ease: 1,
  14519. "$ease-in": 1,
  14520. "$ease-in-out": 1,
  14521. "$ease-out": 1,
  14522. $forwards: 1,
  14523. $infinite: 1,
  14524. $linear: 1,
  14525. $none: Infinity, // No matter how many times you write none, it will never be an animation name
  14526. $normal: 1,
  14527. $paused: 1,
  14528. $reverse: 1,
  14529. $running: 1,
  14530. "$step-end": 1,
  14531. "$step-start": 1,
  14532. $initial: Infinity,
  14533. $inherit: Infinity,
  14534. $unset: Infinity,
  14535. };
  14536. let parsedAnimationKeywords = {};
  14537. let stepsFunctionNode = null;
  14538. const valueNodes = valueParser(declaration.value).walk((node) => {
  14539. /* If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh. */
  14540. if (node.type === "div") {
  14541. parsedAnimationKeywords = {};
  14542. }
  14543. if (node.type === "function" && node.value.toLowerCase() === "steps") {
  14544. stepsFunctionNode = node;
  14545. }
  14546. const value =
  14547. node.type === "word" &&
  14548. !isWordAFunctionArgument(node, stepsFunctionNode)
  14549. ? node.value.toLowerCase()
  14550. : null;
  14551. let shouldParseAnimationName = false;
  14552. if (value && validIdent.test(value)) {
  14553. if ("$" + value in animationKeywords) {
  14554. parsedAnimationKeywords["$" + value] =
  14555. "$" + value in parsedAnimationKeywords
  14556. ? parsedAnimationKeywords["$" + value] + 1
  14557. : 0;
  14558. shouldParseAnimationName =
  14559. parsedAnimationKeywords["$" + value] >=
  14560. animationKeywords["$" + value];
  14561. } else {
  14562. shouldParseAnimationName = true;
  14563. }
  14564. }
  14565. const subContext = {
  14566. options: context.options,
  14567. global: context.global,
  14568. localizeNextItem: shouldParseAnimationName && !context.global,
  14569. localAliasMap: context.localAliasMap,
  14570. };
  14571. return localizeDeclNode(node, subContext);
  14572. });
  14573. declaration.value = valueNodes.toString();
  14574. return;
  14575. }
  14576. const isAnimationName = /animation(-name)?$/i.test(declaration.prop);
  14577. if (isAnimationName) {
  14578. return localizeDeclarationValues(true, declaration, context);
  14579. }
  14580. const hasUrl = /url\(/i.test(declaration.value);
  14581. if (hasUrl) {
  14582. return localizeDeclarationValues(false, declaration, context);
  14583. }
  14584. }
  14585. src$4.exports = (options = {}) => {
  14586. if (
  14587. options &&
  14588. options.mode &&
  14589. options.mode !== "global" &&
  14590. options.mode !== "local" &&
  14591. options.mode !== "pure"
  14592. ) {
  14593. throw new Error(
  14594. 'options.mode must be either "global", "local" or "pure" (default "local")'
  14595. );
  14596. }
  14597. const pureMode = options && options.mode === "pure";
  14598. const globalMode = options && options.mode === "global";
  14599. return {
  14600. postcssPlugin: "postcss-modules-local-by-default",
  14601. prepare() {
  14602. const localAliasMap = new Map();
  14603. return {
  14604. Once(root) {
  14605. const { icssImports } = extractICSS(root, false);
  14606. Object.keys(icssImports).forEach((key) => {
  14607. Object.keys(icssImports[key]).forEach((prop) => {
  14608. localAliasMap.set(prop, icssImports[key][prop]);
  14609. });
  14610. });
  14611. root.walkAtRules((atRule) => {
  14612. if (/keyframes$/i.test(atRule.name)) {
  14613. const globalMatch = /^\s*:global\s*\((.+)\)\s*$/.exec(
  14614. atRule.params
  14615. );
  14616. const localMatch = /^\s*:local\s*\((.+)\)\s*$/.exec(
  14617. atRule.params
  14618. );
  14619. let globalKeyframes = globalMode;
  14620. if (globalMatch) {
  14621. if (pureMode) {
  14622. throw atRule.error(
  14623. "@keyframes :global(...) is not allowed in pure mode"
  14624. );
  14625. }
  14626. atRule.params = globalMatch[1];
  14627. globalKeyframes = true;
  14628. } else if (localMatch) {
  14629. atRule.params = localMatch[0];
  14630. globalKeyframes = false;
  14631. } else if (!globalMode) {
  14632. if (atRule.params && !localAliasMap.has(atRule.params)) {
  14633. atRule.params = ":local(" + atRule.params + ")";
  14634. }
  14635. }
  14636. atRule.walkDecls((declaration) => {
  14637. localizeDeclaration(declaration, {
  14638. localAliasMap,
  14639. options: options,
  14640. global: globalKeyframes,
  14641. });
  14642. });
  14643. } else if (atRule.nodes) {
  14644. atRule.nodes.forEach((declaration) => {
  14645. if (declaration.type === "decl") {
  14646. localizeDeclaration(declaration, {
  14647. localAliasMap,
  14648. options: options,
  14649. global: globalMode,
  14650. });
  14651. }
  14652. });
  14653. }
  14654. });
  14655. root.walkRules((rule) => {
  14656. if (
  14657. rule.parent &&
  14658. rule.parent.type === "atrule" &&
  14659. /keyframes$/i.test(rule.parent.name)
  14660. ) {
  14661. // ignore keyframe rules
  14662. return;
  14663. }
  14664. const context = localizeNode(rule, options.mode, localAliasMap);
  14665. context.options = options;
  14666. context.localAliasMap = localAliasMap;
  14667. if (pureMode && context.hasPureGlobals) {
  14668. throw rule.error(
  14669. 'Selector "' +
  14670. rule.selector +
  14671. '" is not pure ' +
  14672. "(pure selectors must contain at least one local class or id)"
  14673. );
  14674. }
  14675. rule.selector = context.selector;
  14676. // Less-syntax mixins parse as rules with no nodes
  14677. if (rule.nodes) {
  14678. rule.nodes.forEach((declaration) =>
  14679. localizeDeclaration(declaration, context)
  14680. );
  14681. }
  14682. });
  14683. },
  14684. };
  14685. },
  14686. };
  14687. };
  14688. src$4.exports.postcss = true;
  14689. var src$2 = {exports: {}};
  14690. const PERMANENT_MARKER = 2;
  14691. const TEMPORARY_MARKER = 1;
  14692. function createError(node, graph) {
  14693. const er = new Error("Nondeterministic import's order");
  14694. const related = graph[node];
  14695. const relatedNode = related.find(
  14696. (relatedNode) => graph[relatedNode].indexOf(node) > -1
  14697. );
  14698. er.nodes = [node, relatedNode];
  14699. return er;
  14700. }
  14701. function walkGraph(node, graph, state, result, strict) {
  14702. if (state[node] === PERMANENT_MARKER) {
  14703. return;
  14704. }
  14705. if (state[node] === TEMPORARY_MARKER) {
  14706. if (strict) {
  14707. return createError(node, graph);
  14708. }
  14709. return;
  14710. }
  14711. state[node] = TEMPORARY_MARKER;
  14712. const children = graph[node];
  14713. const length = children.length;
  14714. for (let i = 0; i < length; ++i) {
  14715. const error = walkGraph(children[i], graph, state, result, strict);
  14716. if (error instanceof Error) {
  14717. return error;
  14718. }
  14719. }
  14720. state[node] = PERMANENT_MARKER;
  14721. result.push(node);
  14722. }
  14723. function topologicalSort$1(graph, strict) {
  14724. const result = [];
  14725. const state = {};
  14726. const nodes = Object.keys(graph);
  14727. const length = nodes.length;
  14728. for (let i = 0; i < length; ++i) {
  14729. const er = walkGraph(nodes[i], graph, state, result, strict);
  14730. if (er instanceof Error) {
  14731. return er;
  14732. }
  14733. }
  14734. return result;
  14735. }
  14736. var topologicalSort_1 = topologicalSort$1;
  14737. const topologicalSort = topologicalSort_1;
  14738. const matchImports$1 = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/;
  14739. const icssImport = /^:import\((?:"([^"]+)"|'([^']+)')\)/;
  14740. const VISITED_MARKER = 1;
  14741. /**
  14742. * :import('G') {}
  14743. *
  14744. * Rule
  14745. * composes: ... from 'A'
  14746. * composes: ... from 'B'
  14747. * Rule
  14748. * composes: ... from 'A'
  14749. * composes: ... from 'A'
  14750. * composes: ... from 'C'
  14751. *
  14752. * Results in:
  14753. *
  14754. * graph: {
  14755. * G: [],
  14756. * A: [],
  14757. * B: ['A'],
  14758. * C: ['A'],
  14759. * }
  14760. */
  14761. function addImportToGraph(importId, parentId, graph, visited) {
  14762. const siblingsId = parentId + "_" + "siblings";
  14763. const visitedId = parentId + "_" + importId;
  14764. if (visited[visitedId] !== VISITED_MARKER) {
  14765. if (!Array.isArray(visited[siblingsId])) {
  14766. visited[siblingsId] = [];
  14767. }
  14768. const siblings = visited[siblingsId];
  14769. if (Array.isArray(graph[importId])) {
  14770. graph[importId] = graph[importId].concat(siblings);
  14771. } else {
  14772. graph[importId] = siblings.slice();
  14773. }
  14774. visited[visitedId] = VISITED_MARKER;
  14775. siblings.push(importId);
  14776. }
  14777. }
  14778. src$2.exports = (options = {}) => {
  14779. let importIndex = 0;
  14780. const createImportedName =
  14781. typeof options.createImportedName !== "function"
  14782. ? (importName /*, path*/) =>
  14783. `i__imported_${importName.replace(/\W/g, "_")}_${importIndex++}`
  14784. : options.createImportedName;
  14785. const failOnWrongOrder = options.failOnWrongOrder;
  14786. return {
  14787. postcssPlugin: "postcss-modules-extract-imports",
  14788. prepare() {
  14789. const graph = {};
  14790. const visited = {};
  14791. const existingImports = {};
  14792. const importDecls = {};
  14793. const imports = {};
  14794. return {
  14795. Once(root, postcss) {
  14796. // Check the existing imports order and save refs
  14797. root.walkRules((rule) => {
  14798. const matches = icssImport.exec(rule.selector);
  14799. if (matches) {
  14800. const [, /*match*/ doubleQuotePath, singleQuotePath] = matches;
  14801. const importPath = doubleQuotePath || singleQuotePath;
  14802. addImportToGraph(importPath, "root", graph, visited);
  14803. existingImports[importPath] = rule;
  14804. }
  14805. });
  14806. root.walkDecls(/^composes$/, (declaration) => {
  14807. const matches = declaration.value.match(matchImports$1);
  14808. if (!matches) {
  14809. return;
  14810. }
  14811. let tmpSymbols;
  14812. let [
  14813. ,
  14814. /*match*/ symbols,
  14815. doubleQuotePath,
  14816. singleQuotePath,
  14817. global,
  14818. ] = matches;
  14819. if (global) {
  14820. // Composing globals simply means changing these classes to wrap them in global(name)
  14821. tmpSymbols = symbols.split(/\s+/).map((s) => `global(${s})`);
  14822. } else {
  14823. const importPath = doubleQuotePath || singleQuotePath;
  14824. let parent = declaration.parent;
  14825. let parentIndexes = "";
  14826. while (parent.type !== "root") {
  14827. parentIndexes =
  14828. parent.parent.index(parent) + "_" + parentIndexes;
  14829. parent = parent.parent;
  14830. }
  14831. const { selector } = declaration.parent;
  14832. const parentRule = `_${parentIndexes}${selector}`;
  14833. addImportToGraph(importPath, parentRule, graph, visited);
  14834. importDecls[importPath] = declaration;
  14835. imports[importPath] = imports[importPath] || {};
  14836. tmpSymbols = symbols.split(/\s+/).map((s) => {
  14837. if (!imports[importPath][s]) {
  14838. imports[importPath][s] = createImportedName(s, importPath);
  14839. }
  14840. return imports[importPath][s];
  14841. });
  14842. }
  14843. declaration.value = tmpSymbols.join(" ");
  14844. });
  14845. const importsOrder = topologicalSort(graph, failOnWrongOrder);
  14846. if (importsOrder instanceof Error) {
  14847. const importPath = importsOrder.nodes.find((importPath) =>
  14848. // eslint-disable-next-line no-prototype-builtins
  14849. importDecls.hasOwnProperty(importPath)
  14850. );
  14851. const decl = importDecls[importPath];
  14852. throw decl.error(
  14853. "Failed to resolve order of composed modules " +
  14854. importsOrder.nodes
  14855. .map((importPath) => "`" + importPath + "`")
  14856. .join(", ") +
  14857. ".",
  14858. {
  14859. plugin: "postcss-modules-extract-imports",
  14860. word: "composes",
  14861. }
  14862. );
  14863. }
  14864. let lastImportRule;
  14865. importsOrder.forEach((path) => {
  14866. const importedSymbols = imports[path];
  14867. let rule = existingImports[path];
  14868. if (!rule && importedSymbols) {
  14869. rule = postcss.rule({
  14870. selector: `:import("${path}")`,
  14871. raws: { after: "\n" },
  14872. });
  14873. if (lastImportRule) {
  14874. root.insertAfter(lastImportRule, rule);
  14875. } else {
  14876. root.prepend(rule);
  14877. }
  14878. }
  14879. lastImportRule = rule;
  14880. if (!importedSymbols) {
  14881. return;
  14882. }
  14883. Object.keys(importedSymbols).forEach((importedSymbol) => {
  14884. rule.append(
  14885. postcss.decl({
  14886. value: importedSymbol,
  14887. prop: importedSymbols[importedSymbol],
  14888. raws: { before: "\n " },
  14889. })
  14890. );
  14891. });
  14892. });
  14893. },
  14894. };
  14895. },
  14896. };
  14897. };
  14898. src$2.exports.postcss = true;
  14899. const selectorParser = dist.exports;
  14900. const hasOwnProperty = Object.prototype.hasOwnProperty;
  14901. function getSingleLocalNamesForComposes(root) {
  14902. return root.nodes.map((node) => {
  14903. if (node.type !== "selector" || node.nodes.length !== 1) {
  14904. throw new Error(
  14905. `composition is only allowed when selector is single :local class name not in "${root}"`
  14906. );
  14907. }
  14908. node = node.nodes[0];
  14909. if (
  14910. node.type !== "pseudo" ||
  14911. node.value !== ":local" ||
  14912. node.nodes.length !== 1
  14913. ) {
  14914. throw new Error(
  14915. 'composition is only allowed when selector is single :local class name not in "' +
  14916. root +
  14917. '", "' +
  14918. node +
  14919. '" is weird'
  14920. );
  14921. }
  14922. node = node.first;
  14923. if (node.type !== "selector" || node.length !== 1) {
  14924. throw new Error(
  14925. 'composition is only allowed when selector is single :local class name not in "' +
  14926. root +
  14927. '", "' +
  14928. node +
  14929. '" is weird'
  14930. );
  14931. }
  14932. node = node.first;
  14933. if (node.type !== "class") {
  14934. // 'id' is not possible, because you can't compose ids
  14935. throw new Error(
  14936. 'composition is only allowed when selector is single :local class name not in "' +
  14937. root +
  14938. '", "' +
  14939. node +
  14940. '" is weird'
  14941. );
  14942. }
  14943. return node.value;
  14944. });
  14945. }
  14946. const whitespace = "[\\x20\\t\\r\\n\\f]";
  14947. const unescapeRegExp = new RegExp(
  14948. "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)",
  14949. "ig"
  14950. );
  14951. function unescape(str) {
  14952. return str.replace(unescapeRegExp, (_, escaped, escapedWhitespace) => {
  14953. const high = "0x" + escaped - 0x10000;
  14954. // NaN means non-codepoint
  14955. // Workaround erroneous numeric interpretation of +"0x"
  14956. return high !== high || escapedWhitespace
  14957. ? escaped
  14958. : high < 0
  14959. ? // BMP codepoint
  14960. String.fromCharCode(high + 0x10000)
  14961. : // Supplemental Plane codepoint (surrogate pair)
  14962. String.fromCharCode((high >> 10) | 0xd800, (high & 0x3ff) | 0xdc00);
  14963. });
  14964. }
  14965. const plugin = (options = {}) => {
  14966. const generateScopedName =
  14967. (options && options.generateScopedName) || plugin.generateScopedName;
  14968. const generateExportEntry =
  14969. (options && options.generateExportEntry) || plugin.generateExportEntry;
  14970. const exportGlobals = options && options.exportGlobals;
  14971. return {
  14972. postcssPlugin: "postcss-modules-scope",
  14973. Once(root, { rule }) {
  14974. const exports = Object.create(null);
  14975. function exportScopedName(name, rawName) {
  14976. const scopedName = generateScopedName(
  14977. rawName ? rawName : name,
  14978. root.source.input.from,
  14979. root.source.input.css
  14980. );
  14981. const exportEntry = generateExportEntry(
  14982. rawName ? rawName : name,
  14983. scopedName,
  14984. root.source.input.from,
  14985. root.source.input.css
  14986. );
  14987. const { key, value } = exportEntry;
  14988. exports[key] = exports[key] || [];
  14989. if (exports[key].indexOf(value) < 0) {
  14990. exports[key].push(value);
  14991. }
  14992. return scopedName;
  14993. }
  14994. function localizeNode(node) {
  14995. switch (node.type) {
  14996. case "selector":
  14997. node.nodes = node.map(localizeNode);
  14998. return node;
  14999. case "class":
  15000. return selectorParser.className({
  15001. value: exportScopedName(
  15002. node.value,
  15003. node.raws && node.raws.value ? node.raws.value : null
  15004. ),
  15005. });
  15006. case "id": {
  15007. return selectorParser.id({
  15008. value: exportScopedName(
  15009. node.value,
  15010. node.raws && node.raws.value ? node.raws.value : null
  15011. ),
  15012. });
  15013. }
  15014. }
  15015. throw new Error(
  15016. `${node.type} ("${node}") is not allowed in a :local block`
  15017. );
  15018. }
  15019. function traverseNode(node) {
  15020. switch (node.type) {
  15021. case "pseudo":
  15022. if (node.value === ":local") {
  15023. if (node.nodes.length !== 1) {
  15024. throw new Error('Unexpected comma (",") in :local block');
  15025. }
  15026. const selector = localizeNode(node.first, node.spaces);
  15027. // move the spaces that were around the psuedo selector to the first
  15028. // non-container node
  15029. selector.first.spaces = node.spaces;
  15030. const nextNode = node.next();
  15031. if (
  15032. nextNode &&
  15033. nextNode.type === "combinator" &&
  15034. nextNode.value === " " &&
  15035. /\\[A-F0-9]{1,6}$/.test(selector.last.value)
  15036. ) {
  15037. selector.last.spaces.after = " ";
  15038. }
  15039. node.replaceWith(selector);
  15040. return;
  15041. }
  15042. /* falls through */
  15043. case "root":
  15044. case "selector": {
  15045. node.each(traverseNode);
  15046. break;
  15047. }
  15048. case "id":
  15049. case "class":
  15050. if (exportGlobals) {
  15051. exports[node.value] = [node.value];
  15052. }
  15053. break;
  15054. }
  15055. return node;
  15056. }
  15057. // Find any :import and remember imported names
  15058. const importedNames = {};
  15059. root.walkRules(/^:import\(.+\)$/, (rule) => {
  15060. rule.walkDecls((decl) => {
  15061. importedNames[decl.prop] = true;
  15062. });
  15063. });
  15064. // Find any :local selectors
  15065. root.walkRules((rule) => {
  15066. let parsedSelector = selectorParser().astSync(rule);
  15067. rule.selector = traverseNode(parsedSelector.clone()).toString();
  15068. rule.walkDecls(/composes|compose-with/i, (decl) => {
  15069. const localNames = getSingleLocalNamesForComposes(parsedSelector);
  15070. const classes = decl.value.split(/\s+/);
  15071. classes.forEach((className) => {
  15072. const global = /^global\(([^)]+)\)$/.exec(className);
  15073. if (global) {
  15074. localNames.forEach((exportedName) => {
  15075. exports[exportedName].push(global[1]);
  15076. });
  15077. } else if (hasOwnProperty.call(importedNames, className)) {
  15078. localNames.forEach((exportedName) => {
  15079. exports[exportedName].push(className);
  15080. });
  15081. } else if (hasOwnProperty.call(exports, className)) {
  15082. localNames.forEach((exportedName) => {
  15083. exports[className].forEach((item) => {
  15084. exports[exportedName].push(item);
  15085. });
  15086. });
  15087. } else {
  15088. throw decl.error(
  15089. `referenced class name "${className}" in ${decl.prop} not found`
  15090. );
  15091. }
  15092. });
  15093. decl.remove();
  15094. });
  15095. // Find any :local values
  15096. rule.walkDecls((decl) => {
  15097. if (!/:local\s*\((.+?)\)/.test(decl.value)) {
  15098. return;
  15099. }
  15100. let tokens = decl.value.split(/(,|'[^']*'|"[^"]*")/);
  15101. tokens = tokens.map((token, idx) => {
  15102. if (idx === 0 || tokens[idx - 1] === ",") {
  15103. let result = token;
  15104. const localMatch = /:local\s*\((.+?)\)/.exec(token);
  15105. if (localMatch) {
  15106. const input = localMatch.input;
  15107. const matchPattern = localMatch[0];
  15108. const matchVal = localMatch[1];
  15109. const newVal = exportScopedName(matchVal);
  15110. result = input.replace(matchPattern, newVal);
  15111. } else {
  15112. return token;
  15113. }
  15114. return result;
  15115. } else {
  15116. return token;
  15117. }
  15118. });
  15119. decl.value = tokens.join("");
  15120. });
  15121. });
  15122. // Find any :local keyframes
  15123. root.walkAtRules(/keyframes$/i, (atRule) => {
  15124. const localMatch = /^\s*:local\s*\((.+?)\)\s*$/.exec(atRule.params);
  15125. if (!localMatch) {
  15126. return;
  15127. }
  15128. atRule.params = exportScopedName(localMatch[1]);
  15129. });
  15130. // If we found any :locals, insert an :export rule
  15131. const exportedNames = Object.keys(exports);
  15132. if (exportedNames.length > 0) {
  15133. const exportRule = rule({ selector: ":export" });
  15134. exportedNames.forEach((exportedName) =>
  15135. exportRule.append({
  15136. prop: exportedName,
  15137. value: exports[exportedName].join(" "),
  15138. raws: { before: "\n " },
  15139. })
  15140. );
  15141. root.append(exportRule);
  15142. }
  15143. },
  15144. };
  15145. };
  15146. plugin.postcss = true;
  15147. plugin.generateScopedName = function (name, path) {
  15148. const sanitisedPath = path
  15149. .replace(/\.[^./\\]+$/, "")
  15150. .replace(/[\W_]+/g, "_")
  15151. .replace(/^_|_$/g, "");
  15152. return `_${sanitisedPath}__${name}`.trim();
  15153. };
  15154. plugin.generateExportEntry = function (name, scopedName) {
  15155. return {
  15156. key: unescape(name),
  15157. value: unescape(scopedName),
  15158. };
  15159. };
  15160. var src$1 = plugin;
  15161. var src = {exports: {}};
  15162. const ICSSUtils = src$3;
  15163. const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;
  15164. const matchValueDefinition = /(?:\s+|^)([\w-]+):?(.*?)$/;
  15165. const matchImport = /^([\w-]+)(?:\s+as\s+([\w-]+))?/;
  15166. src.exports = (options) => {
  15167. let importIndex = 0;
  15168. const createImportedName =
  15169. (options && options.createImportedName) ||
  15170. ((importName /*, path*/) =>
  15171. `i__const_${importName.replace(/\W/g, "_")}_${importIndex++}`);
  15172. return {
  15173. postcssPlugin: "postcss-modules-values",
  15174. prepare(result) {
  15175. const importAliases = [];
  15176. const definitions = {};
  15177. return {
  15178. Once(root, postcss) {
  15179. root.walkAtRules(/value/i, (atRule) => {
  15180. const matches = atRule.params.match(matchImports);
  15181. if (matches) {
  15182. let [, /*match*/ aliases, path] = matches;
  15183. // We can use constants for path names
  15184. if (definitions[path]) {
  15185. path = definitions[path];
  15186. }
  15187. const imports = aliases
  15188. .replace(/^\(\s*([\s\S]+)\s*\)$/, "$1")
  15189. .split(/\s*,\s*/)
  15190. .map((alias) => {
  15191. const tokens = matchImport.exec(alias);
  15192. if (tokens) {
  15193. const [, /*match*/ theirName, myName = theirName] = tokens;
  15194. const importedName = createImportedName(myName);
  15195. definitions[myName] = importedName;
  15196. return { theirName, importedName };
  15197. } else {
  15198. throw new Error(`@import statement "${alias}" is invalid!`);
  15199. }
  15200. });
  15201. importAliases.push({ path, imports });
  15202. atRule.remove();
  15203. return;
  15204. }
  15205. if (atRule.params.indexOf("@value") !== -1) {
  15206. result.warn("Invalid value definition: " + atRule.params);
  15207. }
  15208. let [, key, value] = `${atRule.params}${atRule.raws.between}`.match(
  15209. matchValueDefinition
  15210. );
  15211. const normalizedValue = value.replace(/\/\*((?!\*\/).*?)\*\//g, "");
  15212. if (normalizedValue.length === 0) {
  15213. result.warn("Invalid value definition: " + atRule.params);
  15214. atRule.remove();
  15215. return;
  15216. }
  15217. let isOnlySpace = /^\s+$/.test(normalizedValue);
  15218. if (!isOnlySpace) {
  15219. value = value.trim();
  15220. }
  15221. // Add to the definitions, knowing that values can refer to each other
  15222. definitions[key] = ICSSUtils.replaceValueSymbols(
  15223. value,
  15224. definitions
  15225. );
  15226. atRule.remove();
  15227. });
  15228. /* If we have no definitions, don't continue */
  15229. if (!Object.keys(definitions).length) {
  15230. return;
  15231. }
  15232. /* Perform replacements */
  15233. ICSSUtils.replaceSymbols(root, definitions);
  15234. /* We want to export anything defined by now, but don't add it to the CSS yet or it well get picked up by the replacement stuff */
  15235. const exportDeclarations = Object.keys(definitions).map((key) =>
  15236. postcss.decl({
  15237. value: definitions[key],
  15238. prop: key,
  15239. raws: { before: "\n " },
  15240. })
  15241. );
  15242. /* Add export rules if any */
  15243. if (exportDeclarations.length > 0) {
  15244. const exportRule = postcss.rule({
  15245. selector: ":export",
  15246. raws: { after: "\n" },
  15247. });
  15248. exportRule.append(exportDeclarations);
  15249. root.prepend(exportRule);
  15250. }
  15251. /* Add import rules */
  15252. importAliases.reverse().forEach(({ path, imports }) => {
  15253. const importRule = postcss.rule({
  15254. selector: `:import(${path})`,
  15255. raws: { after: "\n" },
  15256. });
  15257. imports.forEach(({ theirName, importedName }) => {
  15258. importRule.append({
  15259. value: theirName,
  15260. prop: importedName,
  15261. raws: { before: "\n " },
  15262. });
  15263. });
  15264. root.prepend(importRule);
  15265. });
  15266. },
  15267. };
  15268. },
  15269. };
  15270. };
  15271. src.exports.postcss = true;
  15272. Object.defineProperty(behaviours$1, "__esModule", {
  15273. value: true
  15274. });
  15275. behaviours$1.behaviours = undefined;
  15276. behaviours$1.getDefaultPlugins = getDefaultPlugins;
  15277. behaviours$1.isValidBehaviour = isValidBehaviour;
  15278. var _postcssModulesLocalByDefault = src$4.exports;
  15279. var _postcssModulesLocalByDefault2 = _interopRequireDefault$1(_postcssModulesLocalByDefault);
  15280. var _postcssModulesExtractImports = src$2.exports;
  15281. var _postcssModulesExtractImports2 = _interopRequireDefault$1(_postcssModulesExtractImports);
  15282. var _postcssModulesScope = src$1;
  15283. var _postcssModulesScope2 = _interopRequireDefault$1(_postcssModulesScope);
  15284. var _postcssModulesValues = src.exports;
  15285. var _postcssModulesValues2 = _interopRequireDefault$1(_postcssModulesValues);
  15286. function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15287. const behaviours = behaviours$1.behaviours = {
  15288. LOCAL: "local",
  15289. GLOBAL: "global"
  15290. };
  15291. function getDefaultPlugins({
  15292. behaviour,
  15293. generateScopedName,
  15294. exportGlobals
  15295. }) {
  15296. const scope = (0, _postcssModulesScope2.default)({ generateScopedName, exportGlobals });
  15297. const plugins = {
  15298. [behaviours.LOCAL]: [_postcssModulesValues2.default, _postcssModulesLocalByDefault2.default, _postcssModulesExtractImports2.default, scope],
  15299. [behaviours.GLOBAL]: [_postcssModulesValues2.default, _postcssModulesExtractImports2.default, scope]
  15300. };
  15301. return plugins[behaviour];
  15302. }
  15303. function isValidBehaviour(behaviour) {
  15304. return Object.keys(behaviours).map(key => behaviours[key]).indexOf(behaviour) > -1;
  15305. }
  15306. var _postcss = require$$0$3;
  15307. var _postcss2 = _interopRequireDefault(_postcss);
  15308. var _lodash = lodash_camelcase;
  15309. var _lodash2 = _interopRequireDefault(_lodash);
  15310. var _genericNames = genericNames;
  15311. var _genericNames2 = _interopRequireDefault(_genericNames);
  15312. var _unquote = unquote$1;
  15313. var _unquote2 = _interopRequireDefault(_unquote);
  15314. var _parser = parser;
  15315. var _parser2 = _interopRequireDefault(_parser);
  15316. var _loader = loader;
  15317. var _loader2 = _interopRequireDefault(_loader);
  15318. var _generateScopedName = generateScopedName$1;
  15319. var _generateScopedName2 = _interopRequireDefault(_generateScopedName);
  15320. var _saveJSON = saveJSON$1;
  15321. var _saveJSON2 = _interopRequireDefault(_saveJSON);
  15322. var _behaviours = behaviours$1;
  15323. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15324. function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
  15325. const PLUGIN_NAME = "postcss-modules";
  15326. function getDefaultScopeBehaviour(opts) {
  15327. if (opts.scopeBehaviour && (0, _behaviours.isValidBehaviour)(opts.scopeBehaviour)) {
  15328. return opts.scopeBehaviour;
  15329. }
  15330. return _behaviours.behaviours.LOCAL;
  15331. }
  15332. function getScopedNameGenerator(opts) {
  15333. const scopedNameGenerator = opts.generateScopedName || _generateScopedName2.default;
  15334. if (typeof scopedNameGenerator === "function") return scopedNameGenerator;
  15335. return (0, _genericNames2.default)(scopedNameGenerator, {
  15336. context: process.cwd(),
  15337. hashPrefix: opts.hashPrefix
  15338. });
  15339. }
  15340. function getLoader(opts, plugins) {
  15341. const root = typeof opts.root === "undefined" ? "/" : opts.root;
  15342. return typeof opts.Loader === "function" ? new opts.Loader(root, plugins) : new _loader2.default(root, plugins);
  15343. }
  15344. function isGlobalModule(globalModules, inputFile) {
  15345. return globalModules.some(regex => inputFile.match(regex));
  15346. }
  15347. function getDefaultPluginsList(opts, inputFile) {
  15348. const globalModulesList = opts.globalModulePaths || null;
  15349. const exportGlobals = opts.exportGlobals || false;
  15350. const defaultBehaviour = getDefaultScopeBehaviour(opts);
  15351. const generateScopedName = getScopedNameGenerator(opts);
  15352. if (globalModulesList && isGlobalModule(globalModulesList, inputFile)) {
  15353. return (0, _behaviours.getDefaultPlugins)({
  15354. behaviour: _behaviours.behaviours.GLOBAL,
  15355. generateScopedName,
  15356. exportGlobals
  15357. });
  15358. }
  15359. return (0, _behaviours.getDefaultPlugins)({
  15360. behaviour: defaultBehaviour,
  15361. generateScopedName,
  15362. exportGlobals
  15363. });
  15364. }
  15365. function isOurPlugin(plugin) {
  15366. return plugin.postcssPlugin === PLUGIN_NAME;
  15367. }
  15368. function dashesCamelCase(string) {
  15369. return string.replace(/-+(\w)/g, (_, firstLetter) => firstLetter.toUpperCase());
  15370. }
  15371. build.exports = (opts = {}) => {
  15372. return {
  15373. postcssPlugin: PLUGIN_NAME,
  15374. OnceExit(css, { result }) {
  15375. return _asyncToGenerator(function* () {
  15376. const getJSON = opts.getJSON || _saveJSON2.default;
  15377. const inputFile = css.source.input.file;
  15378. const pluginList = getDefaultPluginsList(opts, inputFile);
  15379. const resultPluginIndex = result.processor.plugins.findIndex(function (plugin) {
  15380. return isOurPlugin(plugin);
  15381. });
  15382. if (resultPluginIndex === -1) {
  15383. throw new Error('Plugin missing from options.');
  15384. }
  15385. const earlierPlugins = result.processor.plugins.slice(0, resultPluginIndex);
  15386. const loaderPlugins = [...earlierPlugins, ...pluginList];
  15387. const loader = getLoader(opts, loaderPlugins);
  15388. const fetcher = function fetcher(file, relativeTo, depTrace) {
  15389. const unquoteFile = (0, _unquote2.default)(file);
  15390. const resolvedResult = typeof opts.resolve === 'function' && opts.resolve(unquoteFile);
  15391. const resolvedFile = resolvedResult instanceof Promise ? resolvedResult : Promise.resolve(resolvedResult);
  15392. return resolvedFile.then(function (f) {
  15393. return loader.fetch.call(loader, `"${f || unquoteFile}"`, relativeTo, depTrace);
  15394. });
  15395. };
  15396. const parser = new _parser2.default(fetcher);
  15397. yield (0, _postcss2.default)([...pluginList, parser.plugin()]).process(css, {
  15398. from: inputFile
  15399. });
  15400. const out = loader.finalSource;
  15401. if (out) css.prepend(out);
  15402. if (opts.localsConvention) {
  15403. const isFunc = typeof opts.localsConvention === "function";
  15404. parser.exportTokens = Object.entries(parser.exportTokens).reduce(function (tokens, [className, value]) {
  15405. if (isFunc) {
  15406. tokens[opts.localsConvention(className, value, inputFile)] = value;
  15407. return tokens;
  15408. }
  15409. switch (opts.localsConvention) {
  15410. case "camelCase":
  15411. tokens[className] = value;
  15412. tokens[(0, _lodash2.default)(className)] = value;
  15413. break;
  15414. case "camelCaseOnly":
  15415. tokens[(0, _lodash2.default)(className)] = value;
  15416. break;
  15417. case "dashes":
  15418. tokens[className] = value;
  15419. tokens[dashesCamelCase(className)] = value;
  15420. break;
  15421. case "dashesOnly":
  15422. tokens[dashesCamelCase(className)] = value;
  15423. break;
  15424. }
  15425. return tokens;
  15426. }, {});
  15427. }
  15428. result.messages.push({
  15429. type: "export",
  15430. plugin: "postcss-modules",
  15431. exportTokens: parser.exportTokens
  15432. });
  15433. // getJSON may return a promise
  15434. return getJSON(css.source.input.file, parser.exportTokens, result.opts.to);
  15435. })();
  15436. }
  15437. };
  15438. };
  15439. build.exports.postcss = true;
  15440. function compileStyle(options) {
  15441. return doCompileStyle({
  15442. ...options,
  15443. isAsync: false
  15444. });
  15445. }
  15446. function compileStyleAsync(options) {
  15447. return doCompileStyle({
  15448. ...options,
  15449. isAsync: true
  15450. });
  15451. }
  15452. function doCompileStyle(options) {
  15453. const { filename, id, scoped = false, trim = true, isProd = false, modules = false, modulesOptions = {}, preprocessLang, postcssOptions, postcssPlugins } = options;
  15454. const preprocessor = preprocessLang && processors[preprocessLang];
  15455. const preProcessedSource = preprocessor && preprocess(options, preprocessor);
  15456. const map = preProcessedSource
  15457. ? preProcessedSource.map
  15458. : options.inMap || options.map;
  15459. const source = preProcessedSource ? preProcessedSource.code : options.source;
  15460. const shortId = id.replace(/^data-v-/, '');
  15461. const longId = `data-v-${shortId}`;
  15462. const plugins = (postcssPlugins || []).slice();
  15463. plugins.unshift(cssVarsPlugin({ id: shortId, isProd }));
  15464. if (trim) {
  15465. plugins.push(trimPlugin$1());
  15466. }
  15467. if (scoped) {
  15468. plugins.push(scopedPlugin$1(longId));
  15469. }
  15470. let cssModules;
  15471. if (modules) {
  15472. if (!options.isAsync) {
  15473. throw new Error('[@vue/compiler-sfc] `modules` option can only be used with compileStyleAsync().');
  15474. }
  15475. plugins.push(build.exports({
  15476. ...modulesOptions,
  15477. getJSON: (_cssFileName, json) => {
  15478. cssModules = json;
  15479. }
  15480. }));
  15481. }
  15482. const postCSSOptions = {
  15483. ...postcssOptions,
  15484. to: filename,
  15485. from: filename
  15486. };
  15487. if (map) {
  15488. postCSSOptions.map = {
  15489. inline: false,
  15490. annotation: false,
  15491. prev: map
  15492. };
  15493. }
  15494. let result;
  15495. let code;
  15496. let outMap;
  15497. // stylus output include plain css. so need remove the repeat item
  15498. const dependencies = new Set(preProcessedSource ? preProcessedSource.dependencies : []);
  15499. // sass has filename self when provided filename option
  15500. dependencies.delete(filename);
  15501. const errors = [];
  15502. if (preProcessedSource && preProcessedSource.errors.length) {
  15503. errors.push(...preProcessedSource.errors);
  15504. }
  15505. const recordPlainCssDependencies = (messages) => {
  15506. messages.forEach(msg => {
  15507. if (msg.type === 'dependency') {
  15508. // postcss output path is absolute position path
  15509. dependencies.add(msg.file);
  15510. }
  15511. });
  15512. return dependencies;
  15513. };
  15514. try {
  15515. result = require$$0$3(plugins).process(source, postCSSOptions);
  15516. // In async mode, return a promise.
  15517. if (options.isAsync) {
  15518. return result
  15519. .then(result => ({
  15520. code: result.css || '',
  15521. map: result.map && result.map.toJSON(),
  15522. errors,
  15523. modules: cssModules,
  15524. rawResult: result,
  15525. dependencies: recordPlainCssDependencies(result.messages)
  15526. }))
  15527. .catch(error => ({
  15528. code: '',
  15529. map: undefined,
  15530. errors: [...errors, error],
  15531. rawResult: undefined,
  15532. dependencies
  15533. }));
  15534. }
  15535. recordPlainCssDependencies(result.messages);
  15536. // force synchronous transform (we know we only have sync plugins)
  15537. code = result.css;
  15538. outMap = result.map;
  15539. }
  15540. catch (e) {
  15541. errors.push(e);
  15542. }
  15543. return {
  15544. code: code || ``,
  15545. map: outMap && outMap.toJSON(),
  15546. errors,
  15547. rawResult: result,
  15548. dependencies
  15549. };
  15550. }
  15551. function preprocess(options, preprocessor) {
  15552. return preprocessor(options.source, options.inMap || options.map, {
  15553. filename: options.filename,
  15554. ...options.preprocessOptions
  15555. }, options.preprocessCustomRequire);
  15556. }
  15557. // API
  15558. const walk = estreeWalker.walk;
  15559. exports.MagicString = MagicString;
  15560. exports.babelParse = parser$2.parse;
  15561. exports.extractIdentifiers = compilerCore.extractIdentifiers;
  15562. exports.generateCodeFrame = compilerCore.generateCodeFrame;
  15563. exports.isInDestructureAssignment = compilerCore.isInDestructureAssignment;
  15564. exports.isStaticProperty = compilerCore.isStaticProperty;
  15565. exports.walkIdentifiers = compilerCore.walkIdentifiers;
  15566. exports.shouldTransformRef = reactivityTransform.shouldTransform;
  15567. exports.transformRef = reactivityTransform.transform;
  15568. exports.transformRefAST = reactivityTransform.transformAST;
  15569. exports.compileScript = compileScript;
  15570. exports.compileStyle = compileStyle;
  15571. exports.compileStyleAsync = compileStyleAsync;
  15572. exports.compileTemplate = compileTemplate;
  15573. exports.parse = parse$4;
  15574. exports.rewriteDefault = rewriteDefault;
  15575. exports.walk = walk;